#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,O3,unroll-loops")
#define int long long
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vpi vector<pii>
#define vvpi vector<vpi>
#define vb vector<bool>
#define vvb vector<vb>
#define endl "\n"
#define sp << " " <<
#define F(i, s, n) for(int i = s; i < n; i++)
#define pb push_back
#define fi first
#define se second
int inf = LLONG_MAX >> 3;
void solve() {
int n;
cin >> n;
vpi a(n);
F(i, 0, n) cin >> a[i].first >> a[i].second;
//sort(a.begin(), a.end(), [](pii one, pii two) {
// return min(one.fi, one.se) > min(two.fi, two.se);
//});
int mx = 0;
int mnx = inf, mny = inf;
F(i, 0, n) {
mnx = min(mnx, a[i].fi);
mny = min(mny, a[i].se);
mx = max(mx, mnx * mny * (i+1));
}
cout << mx << endl;
}
void setIO() {
ios::sync_with_stdio(0); cin.tie(0);
#ifdef Local
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
}
signed main() {
setIO();
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |