#P2659. 美丽的序列
美丽的序列
Description
To study how beautiful this sequence is, GD defines the "beauty" and the "beauty coefficient" of a sequence.
- For any subarray of this sequence, the "beauty" of this subarray is the product of its length and the minimum value within it.
- The "beauty coefficient" of the whole sequence is the maximum "beauty" among all its subarrays.
Now GD wants you to compute the "beauty coefficient" of this sequence.
Input Format
The first line contains an integer , the number of elements in the sequence. The second line contains integers , describing the sequence.
Output Format
Output a single integer, the "beauty coefficient" of the sequence.
3
1 2 3
4
Hint
Sample Explanation: Choose the subarray to obtain the maximum "beauty coefficient", which is .
Constraints:
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , .
Hint: You may need fast I/O.
Translated by ChatGPT 5
京公网安备 11011102002149号