Advertisement
Guest User

Untitled

a guest
May 20th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. using ll = long long;
  5. using ld = long double;
  6. using str = string;
  7. const int N = 2e5 + 3, INF = 1e9;
  8.  
  9. int main()
  10. {
  11.     ios :: sync_with_stdio(0);
  12.     cin.tie(), cout.tie();
  13.     ll w, h, n;
  14.     cin >> w >> h >> n;
  15.     ll l = 0, r = max(w * n, h * n);
  16.     while(l < r){
  17.         ll m = (l + r) / 2;
  18.         if((m / h) * (m / w) >= n) r = m;
  19.         else l = m + 1;
  20.     }
  21.     cout << l;
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement