Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define s second
- #define f first
- #define ll long long
- #define p pair <int, int>
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0); cout.tie(0);
- ll n, m, t;
- cin >> n >> m >> t;
- ll l = 0, r = min(n, m);
- while (r - l > 1) {
- ll mid = (r + l) / 2;
- if (m * n - (m - 2 * mid) * (n - 2 * mid) <= t) l = mid;
- else r = mid;
- }
- cout << l;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement