Advertisement
senb1

krsu 3332

Mar 8th, 2023
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.02 KB | None | 0 0
  1. /*
  2. * by: senb1
  3. */
  4. #include <algorithm>
  5. #include <iomanip>
  6. #include <iostream>
  7. #include <locale>
  8. #include <numeric>
  9. #include <cstring>
  10. #include <cmath>
  11.  
  12. #include <deque>
  13. #include <list>
  14. #include <map>
  15. #include <stack>
  16. #include <string>
  17. #include <vector>
  18. #include <array>
  19. #include <queue>
  20. #include <set>
  21.  
  22. using namespace std;
  23.  
  24. #define all(x) x.begin(), x.end()
  25. #define rall(x) x.rbegin(), x.rend()
  26. #define yes cout << "YES\n"
  27. #define no cout << "NO\n"
  28. #define fr first
  29. #define sc second
  30. #define endl "\n"
  31. #define ll long long
  32. #define ull unsigned long long
  33. #define ld long double
  34. #define nl cout << "\n";
  35.  
  36. const ll maxn = 1e6 + 10; // 1000000 + 10
  37. const ll mod = 1000000000;
  38. const int inf = 1000000000;
  39. // 4294967296
  40.  
  41. ll binpow(ll a, ll b) {
  42.     ll res = 1;
  43.     while (b > 0) {
  44.         if (b & 1)
  45.             res = res * a % mod;
  46.         a = a * a % mod;
  47.         b >>= 1 % mod;
  48.     }
  49.     return res % mod;
  50. }
  51.  
  52. ll divup(ll x, ll y) {
  53.     return (x - 1) / y + 1;
  54. }
  55.  
  56. ll gcd(ll a, ll b) {
  57.     if (a % b == 0)
  58.         return b;
  59.     if (b % a == 0)
  60.         return a;
  61.     if (a > b)
  62.         return gcd(a % b, b);
  63.     return gcd(a, b % a);
  64. }
  65.  
  66. ll lcm(ll a, ll b) {
  67.     return (a * b) / gcd(a, b);
  68. }
  69.  
  70. bool isPrime(int x) {
  71.     if (x <= 1) return false;
  72.     for (int i = 2; i <= sqrt(x) + 1; i++) {
  73.         if (x % i == 0)
  74.             return false;
  75.     }
  76.     return true;
  77. }
  78.  
  79. int main() {
  80.     ios::sync_with_stdio(0); cin.tie(0);
  81.     //cout << fixed << setprecision(12);
  82.     //setlocale(LC_ALL, "RUS");
  83.  
  84.     int n;
  85.     cin >> n;
  86.     vector<pair<int,int> > v;
  87.     for (int i = 1; i < n; i++) {
  88.         for (int j = 1; j < sqrt(n); j++) {
  89.             if (j * j * 20 + 30 * j * i > n)
  90.                 break;
  91.             v.push_back(make_pair(i, j));
  92.         }
  93.     }
  94.  
  95.     int mx = 0;
  96.     for (int i = 0; i < v.size(); i++) {
  97.         mx = max(mx, v[i].fr * v[i].sc * v[i].sc);
  98.     }
  99.  
  100.     /*
  101.     for (auto x : v)
  102.         cout << x.fr << ' ' << x.sc << endl;
  103.     */
  104.     cout << mx;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement