fork download
  1. // ORZVANH14
  2. //⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⣤⣤⣤⣤⣶⣦⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀
  3. //⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⡿⠛⠉⠙⠛⠛⠛⠛⠻⢿⣿⣷⣤⡀⠀⠀⠀⠀⠀
  4. //⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⠈⢻⣿⣿⡄⠀⠀⠀⠀
  5. //⠀⠀⠀⠀⠀⠀⠀⣸⣿⡏⠀⠀⠀⣠⣶⣾⣿⣿⣿⠿⠿⠿⢿⣿⣿⣿⣄⠀⠀⠀
  6. //⠀⠀⠀⠀⠀⠀⠀⣿⣿⠁⠀⠀⢰⣿⣿⣯⠁⠀⠀⠀⠀⠀⠀⠀⠈⠙⢿⣷⡄⠀
  7. //⠀⠀⣀⣤⣴⣶⣶⣿⡟⠀⠀⠀⢸⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣷⠀
  8. //⠀⢰⣿⡟⠋⠉⣹⣿⡇⠀⠀⠀⠘⣿⣿⣿⣿⣷⣦⣤⣤⣤⣶⣶⣶⣶⣿⣿⣿⠀
  9. //⠀⢸⣿⡇⠀⠀⣿⣿⡇⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀
  10. //⠀⣸⣿⡇⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠉⠻⠿⣿⣿⣿⣿⡿⠿⠿⠛⢻⣿⡇⠀⠀
  11. //⠀⣿⣿⠁⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣧⠀⠀
  12. //⠀⣿⣿⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀
  13. //⠀⣿⣿⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀
  14. //⠀⢿⣿⡆⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀
  15. //⠀⠸⣿⣧⡀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠃⠀⠀
  16. //⠀⠀⠛⢿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⣰⣿⣿⣷⣶⣶⣶⣶⠶⠀⢠⣿⣿⠀⠀⠀
  17. //⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⣿⣿⡇⠀⣽⣿⡏⠁⠀⠀⢸⣿⡇⠀⠀⠀
  18. //⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⣿⣿⡇⠀⢹⣿⡆⠀⠀⠀⣸⣿⠇⠀⠀⠀
  19. //⠀⠀⠀⠀⠀⠀⠀⢿⣿⣦⣄⣀⣠⣴⣿⣿⠁⠀⠈⠻⣿⣿⣿⣿⡿⠏⠀⠀⠀⠀
  20. //⠀⠀⠀⠀⠀⠀⠀⠈⠛⠻⠿⠿⠿⠿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. #include <bits/stdc++.h>
  30.  
  31. using namespace std;
  32.  
  33. #define int unsigned long long
  34. #define ld long double
  35. #define pb push_back
  36. #define fi first
  37. #define se second
  38. #define nn '\n'
  39. #define pi pair<ll,ll>
  40. #define unmp unordered_map
  41. #define uns unordered_set
  42. #define lb lower_bound
  43. #define ub upper_bound
  44. #define pq priority_queue
  45. #define queue q
  46. #define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  47. #define TASK " "
  48. int mod = 1e9+7;
  49. const int N = 1e5 + 5;
  50. int MOD = 998244353;
  51. int bit[200000];
  52. int n, w, h;
  53. int a[N];
  54. bool anhphucbell(int mid){
  55. int hehe = (mid / w) * (mid / h);
  56. return hehe >= n;
  57. }
  58. signed main(){
  59. ios_base::sync_with_stdio(0);
  60. cin.tie(0);
  61. cout.tie(0);
  62. if(fopen(TASK".INP","r")){
  63. freopen(TASK".INP","r",stdin);
  64. freopen(TASK".OUT","w",stdout);
  65. }
  66. cin >> w >> h >> n;
  67. int l = 1, r = 1e18, kq = -1;
  68. while(l <= r){
  69. int mid = (l + r) / 2;
  70. if(anhphucbell(mid)){
  71. kq = mid;
  72. r = mid - 1;
  73. }
  74. else{
  75. l = mid + 1;
  76. }
  77.  
  78. }
  79. cout << kq << nn;
  80. return 0;
  81. }
  82.  
  83.  
Success #stdin #stdout 0.01s 5288KB
stdin
2 3 10
stdout
9