Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main(){
- #ifdef ERFANUL007
- clock_t tStart = clock();
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #endif
- int t, cs = 0;
- scanf("%d", &t);
- while(t--){
- int n; scanf("%d", &n);
- int a[n];
- for(int i=0; i<n; i++) scanf("%d", &a[i]);
- int area = 0;
- for(int i=0; i<n; i++){
- int width = 1;
- for(int j=i+1; j<n; j++){
- if(a[j] < a[i]) break;
- width++;
- }
- for(int j=i-1; j>=0; j--){
- if(a[j] < a[i]) break;
- width++;
- }
- area = max(area, width * a[i]);
- }
- printf("Case %d: %d\n", ++cs, area);
- }
- #ifdef ERFANUL007
- fprintf(stderr, ">>> Runtime : %.9f\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
- #endif
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement