Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define mp make_pair
- #define pb push_back
- const long double eps = 1e-7;
- int w,h,n;
- bool F(int t)
- {
- return (t/w)*(t/h) >= n;
- }
- signed main() {
- ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
- //freopen("input.txt","r",stdin);
- //freopen("output.txt","w",stdout);
- cin >> w >> h >> n;
- int L = 0,R=max(w,h)*n;
- int mid;
- while(R-L>1)
- {
- mid = (L+R)/2;
- if(F(mid))
- R = mid;
- else
- L = mid;
- }
- cout << (F(L) ? L : R);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement