Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * by: senb1
- */
- #include <algorithm>
- #include <iomanip>
- #include <iostream>
- #include <locale>
- #include <numeric>
- #include <cstring>
- #include <cmath>
- #include <deque>
- #include <list>
- #include <map>
- #include <stack>
- #include <string>
- #include <vector>
- #include <array>
- #include <queue>
- #include <set>
- using namespace std;
- #define all(x) x.begin(), x.end()
- #define rall(x) x.rbegin(), x.rend()
- #define yes cout << "YES\n"
- #define no cout << "NO\n"
- #define fr first
- #define sc second
- #define endl "\n"
- #define ll long long
- #define ull unsigned long long
- #define ld long double
- #define nl cout << "\n";
- const ll maxn = 1e6 + 10; // 1000000 + 10
- const ll mod = 1000000000;
- const int inf = 1000000000;
- // 4294967296
- ll binpow(ll a, ll b) {
- ll res = 1;
- while (b > 0) {
- if (b & 1)
- res = res * a % mod;
- a = a * a % mod;
- b >>= 1 % mod;
- }
- return res % mod;
- }
- ll divup(ll x, ll y) {
- return (x - 1) / y + 1;
- }
- ll gcd(ll a, ll b) {
- if (a % b == 0)
- return b;
- if (b % a == 0)
- return a;
- if (a > b)
- return gcd(a % b, b);
- return gcd(a, b % a);
- }
- ll lcm(ll a, ll b) {
- return (a * b) / gcd(a, b);
- }
- bool isPrime(int x) {
- if (x <= 1) return false;
- for (int i = 2; i <= sqrt(x) + 1; i++) {
- if (x % i == 0)
- return false;
- }
- return true;
- }
- int main() {
- ios::sync_with_stdio(0); cin.tie(0);
- //cout << fixed << setprecision(12);
- //setlocale(LC_ALL, "RUS");
- int n;
- cin >> n;
- vector<pair<int,int> > v;
- for (int i = 1; i < n; i++) {
- for (int j = 1; j < sqrt(n); j++) {
- if (j * j * 20 + 30 * j * i > n)
- break;
- v.push_back(make_pair(i, j));
- }
- }
- int mx = 0;
- for (int i = 0; i < v.size(); i++) {
- mx = max(mx, v[i].fr * v[i].sc * v[i].sc);
- }
- /*
- for (auto x : v)
- cout << x.fr << ' ' << x.sc << endl;
- */
- cout << mx;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement