Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define ll long long
- 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)+1;
- while (r - l > 1){
- ll o = (r+l)/2;
- if (m - 2 * o < 0 || n - 2 * o < 0) {
- r = o;
- }
- else if(n*m - (n-2*o)*(m-2*o) > t){
- r = o;
- }
- else l = o;
- }
- cout << l;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement