SHARE
TWEET

Untitled

lalalalalalalaalalla Jun 24th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <iomanip>
  5. #include <queue>
  6. #include <cmath>
  7. #include <algorithm>
  8. #include <tuple>
  9. #include <iomanip>
  10. #include <stdio.h>
  11. #include <numeric>
  12. #include <map>
  13.  
  14. #define ll long long
  15. #define i(n) for (int i = 0; i < n; i++)
  16. #define j(n) for (int j = 0; j < n; j++)
  17. #define vi vector<int>
  18. #define vvi vector<vector<int>>
  19. #define all(a) a.begin(), a.end()
  20. #define pii pair<int, int>
  21. #define pb push_back
  22.  
  23. using namespace std;
  24.  
  25. int main()
  26. {
  27.     ios_base::sync_with_stdio(0);
  28.     cin.tie(0);
  29.     cout.tie(0);
  30.     int w, h, n;
  31.     cin >> w >> h >> n;
  32.     unsigned ll r = 1, l = 1, mid;
  33.     while ((r / h) * (r / w) < n) r *= 2;
  34.     l = r / 2;
  35.     while (r - l > 1) {
  36. //        cout << l << " " << r << "\n";
  37.         mid = (unsigned ll) (l + r) / 2;
  38.         if ((unsigned ll) mid / h * (unsigned ll) mid / w >= n) {
  39.             r = mid;
  40.         } else {
  41.             l = mid;
  42.         }
  43. //        cout << l << " " << r << "\n";
  44.     }
  45.     cout << l << " " << mid << " " << r;
  46. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top