Task
Steaua București is the team with the greatest achievements in the history of Romanian football.
It has had incredible seasons. For example, in , it managed to win the UEFA Champions League.
In , the team won the Romanian Championship, and the staff organized a celebration.
After a few hours of fun, the coaches Elias and Mihai started thinking about interesting statistics from the team's history.
The two were analyzing the list of the team's points at the end of each season over the past years.
Then, Mihai posed the following problem to Elias:
We define a change of maximum as the appearance of a value greater than all previously encountered values. If we are at the first value, then this property is automatically fulfilled.
The question is: Given the list of the team's points at the end of each season over the past years, what is the longest continuous sequence of values among these with exactly changes of maximum when traversing the values from left to right and exactly changes of maximum when traversing the values from right to left?
Since the celebration was a great success, coaches Mihai and Elias cannot solve the problem on their own, so they are asking for your help.
Input data
The first line contains the numbers , , and , separated by a space.
The second line contains an array of length , representing the scores at the end of each season over the past years, in chronological order, separated by a space.
Output data
The output contains the length of the longest continuous sequence with the property described in the statement if there is at least one, or otherwise.
Constraints and clarifications
- ;
- ;
- .
# | Score | Restrictions |
---|---|---|
1 | 20 | |
2 | 25 | |
3 | 30 | |
4 | 25 | No additional restrictions |
Example
stdin
12 3 5
1 3 1 2 1 3 4 5 4 3 2 1
stdout
11
Explanation
There are sequences where there are exactly changes of maximum from left to right and exactly changes of maximum from right to left: , . The longest among them is , having a length of .