Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define s second
  4. #define f first
  5. #define ll long long
  6. #define p pair <int, int>
  7.  
  8. using namespace std;
  9.  
  10. int main() {
  11.     ios_base::sync_with_stdio(0);
  12.     cin.tie(0); cout.tie(0);
  13.     ll n, m, t;
  14.     cin >> n >> m >> t;
  15.     ll l = 0, r = min(n, m) + 1;
  16.     while (r - l > 1) {
  17.         ll mid = (r + l) / 2;
  18.         if (m * n - (m - 2 * mid) * (n - 2 * mid) <= t) l = mid;
  19.         else r = mid;
  20.     }
  21.     cout << l;
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement