Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- using ll = long long;
- using ld = long double;
- using str = string;
- const int N = 2e5 + 3, INF = 1e9;
- int main()
- {
- ios :: sync_with_stdio(0);
- cin.tie(), cout.tie();
- ll w, h, n;
- cin >> w >> h >> n;
- ll l = 0, r = max(w * n, h * n);
- while(l < r){
- ll m = (l + r) / 2;
- if((m / h) * (m / w) >= n) r = m;
- else l = m + 1;
- }
- cout << l;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement