daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. #define int long long
  3.  
  4. using namespace std;
  5.  
  6. signed main(){
  7.     int n, m;
  8.     cin >> n >> m;
  9.  
  10.     int l = 0, r = 1e9+7;
  11.     while(l + 1 < r){
  12.         int mid = (l + r) / 2;
  13.         int TOTAL_X = 0;
  14.         for(int i = 0; i < n; i++){
  15.             TOTAL_X += (вычисление количества шариков для i челика);
  16.         }
  17.         if(TOTAL_X >= m){
  18.             r = mid;
  19.         } else {
  20.             l = mid;
  21.         }
  22.     }
  23.     cout << r << endl;
  24.     return 0;
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top