Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/minmax/longest-run-of-the-maximum

Longest run of the maximum

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Medium 1000 ms 128 MB 58%
Share

A positive integer and integers are given. Find the greatest length of a segment of consecutive elements, each of which is equal to the largest value.

The longest segment of consecutive elements equal to the largest value

Input

The first line contains a positive integer . The next line contains integers .

Output

One integer.

Note


Examples

Input #1
9
5 7 7 2 7 7 7 1 7
Output #1
3
Input #2
4
-1 3 -1 2
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.