This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n;
cin >> n;
pair<int, int> a[n+5];
for(int i = 0; i<n; i++) {
cin >> a[i].first;
cin >> a[i].second;
}
int ans = 0;
for(int i = 0; i<n; i++){
int mn1 = 1e18, mn2 = 1e18;
for(int j = i; j<n; j++){
mn1 = min(a[j].first, mn1);
mn2 = min(a[j].second, mn2);
// cout << i << " " << j << " "<< mn1 << " " << mn2 << endl;
ans = max(mn1 * mn2 * (j - i + 1) ,ans );
}
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |