#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
int n; cin >> n;
vector<pair<int,int>> a(n); for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
int ans = 0;
for (int i = 0; i < n; i++) {
int h = a[i].first, w = a[i].second;
ans = max(ans, h*w);
for (int j = i-1; j >= 0; j--) {
h = min(h, a[j].first);
w = min(w, a[j].second);
ans = max(ans, h*w*(i-j+1));
}
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |