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 ll long long
#define int ll
#define ii pair<int,int>
#define F first
#define S second
#define endl '\n'
signed main(){
int n;
cin >> n;
vector<int> a(n), b(n);
for(int i=0; i<n; ++i){
cin >> a[i] >> b[i];
}
int ans = 0;
for(int r=0; r<n; ++r){
int mnA = 1e7, mnB = 1e7;
for(int l=r; l>=0; --l){
mnA = min(mnA, a[l]);
mnB = min(mnB, b[l]);
ans = max(ans, (r-l+1) * mnA * mnB);
}
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |