You are given array $a_1, a_2, \dots, a_n$. Find the subsegment $a_l, a_{l+1}, \dots, a_r$ ($1 \le l \le r \le n$) with maximum arithmetic mean $\frac{1}{r - l + 1}\sum\limits_{i=l}^{r}{a_i}$ (in floating-point numbers, i.e. without any rounding).

If there are many such subsegments find the longest one.


-----Input-----

The first line contains single integer $n$ ($1 \le n \le 10^5$) — length of the array $a$.

The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($0 \le a_i \le 10^9$) — the array $a$.


-----Output-----

Print the single integer — the length of the longest subsegment with maximum possible arithmetic mean.


-----Example-----
Input
5
6 1 6 6 0

Output
2



-----Note-----

The subsegment $[3, 4]$ is the longest among all subsegments with maximum arithmetic mean.

Difficulty: EASY

Solutions:
n = int(input())
a = list(map(int, input().split()))
val = max(a)
ans = temp = 0
for elem in a:
	if elem == val:
		temp += 1
	else:
		temp = 0
	ans = max(ans, temp)
print(ans)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
c = 0
p = []
for i in a:
	if i == m:
		c += 1
	else:
		p.append(c)
		c = 0
p.append(c)
print(max(p))


n = int(input())
arr = list(map(int, input().split()))
k = max(arr)
a = []
c = 0
for i in range(n):
	if arr[i] == k:
		c += 1
	else:
		a.append(c)
		c = 0
a.append(c)
print(max(a))


x = int(input())
a = list(map(int, input().split()))
t = max(a)
t1 = 0
l = 0
for i in range(x):
	if a[i] == t:
		t1 = t1 + 1
	elif a[i] != t:
		t1 = 0
	l = max(l, t1)
print(l)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
l = 0
maxl = 0
for i in a:
	if i == m:
		l += 1
	else:
		l = 0
	if l > maxl:
		maxl = l
print(maxl)


line = input()
n = int(line)
line = input()
line = line.split()
l = []
for i in range(n):
	l.append(int(line[i]))
maxn = 0
maxl = 0
curl = 0
for i in range(n):
	if l[i] > maxn:
		maxn = l[i]
		curl = 1
		maxl = 0
	elif l[i] == maxn:
		curl += 1
	else:
		if maxl < curl:
			maxl = curl
		curl = 0
if maxl < curl:
	maxl = curl
print(maxl)


def solve(l):
	prev = -1
	cur_count = 0
	max_num = -1
	max_count = 0
	for num in l:
		if num != prev:
			prev = num
			cur_count = 1
		else:
			cur_count += 1
		if num > max_num:
			max_num = num
			max_count = 1
		elif num == max_num:
			max_count = max(max_count, cur_count)
	print(max_count)
input()
l = list(map(int, input().split()))
solve(l)


n = int(input())
l = list(map(int, input().split()))
m = max(l)
ans = 0
c = 1
for i in range(1, n):
	if l[i - 1] == l[i] == m:
		c += 1
	else:
		ans = max(c, ans)
		c = 1
print(max(ans, c))


from sys import stdin, stdout

def inp():
	return stdin.readline()

def minp():
	return map(int, stdin.readline().rstrip().split())

def linp():
	return list(minp())

def main():
	n = int(inp())
	lst = linp()
	m = max(lst)
	a = []
	cnt = 0
	cnt2 = 0
	s = 0
	for i in range(n):
		if lst[i] == m:
			cnt += 1
		else:
			a.append(cnt)
			cnt = 0
	a.append(cnt)
	print(max(a))
main()


num = int(input())
list_1 = [int(i) for i in input().split()]
maximum = max(list_1)
n = 0
max_1 = 1
for i in list_1:
	if i == maximum:
		n += 1
	else:
		max_1 = max(max_1, n)
		n = 0
	max_1 = max(max_1, n)
print(max_1)


N = int(input())
l = list(map(int, input().split()))
l1 = [[i, l[i]] for i in range(N)]
l1.sort(key=lambda x: (-x[1], x[0]))
m = l1[0][1]
s = 0
i = 1
j = 0
lngth = 1
ans = 1
while i < N:
	if l1[i][1] != m:
		break
	if l1[i][0] - 1 == l1[i - 1][0]:
		lngth += 1
		ans = max(ans, lngth)
	else:
		lngth = 1
	i += 1
print(ans)


n = int(input())
a = list(map(int, input().strip().split()))
max_elem = max(a)
max_count = 1
curr_count = 0
for (idx, elem) in enumerate(a):
	if elem == max_elem:
		curr_count += 1
		if curr_count > max_count:
			max_count = curr_count
	else:
		curr_count = 0
print(max_count)


n = int(input())
A = [int(x) for x in input().split()]
mx = max(A)
streak = 0
cur = 0
for a in A:
	if a == mx:
		cur += 1
		streak = max(streak, cur)
	else:
		cur = 0
print(streak)


n = int(input())
a = [int(x) for x in input().split()]
m = max(a)
ans = -1
c = 0
for i in a:
	if i == m:
		c += 1
	else:
		ans = max(ans, c)
		c = 0
ans = max(ans, c)
print(ans)


n = int(input())
arr = list(map(int, input().split()))
mx = max(arr)
cnt = 0
maxLen = 0
for i in range(n):
	if arr[i] == mx:
		cnt += 1
		if cnt > maxLen:
			maxLen = cnt
	else:
		cnt = 0
print(maxLen)


def main(arr):
	x = max(arr)
	nums = []
	for i in range(len(arr)):
		if arr[i] == x:
			nums.append(i)
	c = 1
	x = 0
	t = 0
	for i in range(1, len(nums)):
		if nums[i] - nums[i - 1] == 1:
			x += 1
		else:
			x = 0
		t = max(x, t)
	print(c + t)
input()
arr = list(map(int, input().split(' ')))
main(arr)


n = int(input())
a = list(map(int, input().split()))
maxn = max(a)
count = 0
ans = 0
for i in range(n):
	if a[i] == maxn:
		count += 1
	else:
		count = 0
	ans = max(ans, count)
print(ans)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
ans = []
flag = False
tmp = 0
for i in range(n):
	if flag:
		if a[i] == m:
			tmp += 1
		else:
			flag = False
			ans.append(tmp)
	elif a[i] == m:
		tmp = 1
		flag = True
if flag:
	ans.append(tmp)
print(max(ans))


import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians, log10
if sys.version_info.minor >= 5:
	from math import gcd
else:
	from fractions import gcd
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import copy, deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def round(x):
	return int((x * 2 + 1) // 2)

def fermat(x, y, MOD):
	return x * pow(y, MOD - 2, MOD) % MOD

def lcm(x, y):
	return x * y // gcd(x, y)

def lcm_list(nums):
	return reduce(lcm, nums, 1)

def gcd_list(nums):
	return reduce(gcd, nums, nums[0])

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST():
	return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7
N = INT()
A = LIST()
l = r = 0
mx = A[0]
ans = 1
for i in range(1, N):
	if A[i] == A[i - 1] == mx:
		r = i
	elif A[i] > mx:
		mx = A[i]
		l = r = i
		ans = 1
	elif A[i] >= mx:
		mx = A[i]
		l = r = i
	ans = max(ans, r - l + 1)
print(ans)


n = int(input())
a = list(map(int, input().split())) + [9999999999]
b = sorted(a)
ans = 1
cur = 0
for i in range(n):
	if a[i] == a[i + 1] and a[i] == b[-2]:
		cur += 1
	else:
		ans = max(ans, cur + 1)
		cur = 0
print(ans)


length = int(input().split()[0])
arr = list(map(int, input().split()))
max = max(arr)
len = 0
counter = 0
for el in arr:
	if el == max:
		counter += 1
	else:
		counter = 0
	if counter > len:
		len = counter
print(len)


n = int(input())
arr = list(map(int, input().split()))
num = max(arr)
maxstreak = 0
i = 0
while i < n:
	if arr[i] == num:
		streak = 1
		j = i + 1
		while j < n and arr[j] == num:
			streak += 1
			j += 1
		i += streak
		if streak > maxstreak:
			maxstreak = streak
	else:
		i += 1
print(maxstreak)


n = int(input())
a = list(map(int, input().split()))
mx = None
indx = []
for i in range(n):
	if mx is None:
		indx.append(i)
		mx = a[0]
	elif mx < a[i]:
		mx = a[i]
		indx = [i]
	elif mx == a[i]:
		indx.append(i)
ans = 1
cnt = 1
for i in range(1, len(indx)):
	if indx[i] == indx[i - 1] + 1:
		cnt += 1
	else:
		cnt = 1
	ans = max(ans, cnt)
print(ans)


n = int(input())
na = input()
na = na.split()
kt = []
kq = []
for i in range(0, n):
	na[i] = eval(na[i])
c = max(na)
kt.append(na.index(c))
kq.append(1)
for i in range(na.index(c), n):
	if na[i] == c:
		if i == kt[-1] + 1:
			kt[-1] = kt[-1] + 1
			kq[-1] = kq[-1] + 1
		else:
			kt = kt + [i]
			kq = kq + [1]
	else:
		pass
print(max(kq))


n = int(input())
a = list(map(int, input().split()))
max = -float('inf')
meet = []
for i in range(0, n):
	if a[i] > max:
		meet = []
		meet.append(i)
		max = a[i]
	elif a[i] == max:
		meet.append(i)
max = 0
t = 0
m = -2
for i in range(0, len(meet)):
	if meet[i] != m + 1:
		if t > max:
			max = t
		t = 1
		m = meet[i]
	elif meet[i] == m + 1:
		t += 1
		m = meet[i]
if t > max:
	max = t
	t = 1
	m = meet[i]
print(max)


n = int(input())
a = [int(t) for t in input().split(' ')]
mx = max(a)
length = 0
max_length = 1
for ai in a + [-1]:
	if ai == mx:
		length += 1
	else:
		max_length = max(length, max_length)
		length = 0
print(max_length)


num = int(input().strip())
nums = [int(i) for i in input().strip().split()]
max_num = max(nums)
max_len = 1
if nums[0] == max_num:
	count = 1
else:
	count = 0
for i in range(1, num):
	if nums[i] == max_num:
		if nums[i - 1] == max_num:
			count += 1
			if count > max_len:
				max_len = count
		else:
			count = 1
	else:
		count = 0
print(max_len)


n = int(input())
n += 1
arr = list(map(int, input().strip().split()))
arr.append(-10)
x = max(arr)
ans = []
z = 0
for i in range(n):
	if arr[i] == x:
		z += 1
	else:
		ans.append(z)
		z = 0
print(max(ans))


n = int(input())
C = 1
p = input().rstrip().split(' ')
x = list(p)
x.sort(key=int, reverse=True)
a = int(x[0])
M = 0
for i in range(0, len(p)):
	if int(p[i]) == a:
		M += 1
	else:
		if M > C:
			C = M
		M = 0
if M > C:
	C = M
print(C)


from sys import stdin, stdout
from collections import defaultdict as dd
inp = lambda : (int(o) for o in stdin.readline().split())
sinp = lambda : (o for o in stdin.readline().split())
out = lambda : stdout.write(str())
I = lambda : map(int, input().split())
Y = lambda : int(input())
n = int(input())
a = list(I())
m = max(a)
mx = 1
c = 1
for i in range(n - 1):
	if a[i] == a[i + 1] == m:
		c += 1
	else:
		c = 1
	mx = max(mx, c)
print(mx)


n = int(input())
m = list(map(int, input().split(' ')))
M = max(m)
count = 0
l = 0
r = 0
i = 0
mmax = -99999
while i <= n - 1:
	count = 0
	if m[i] == M:
		while i <= n - 1 and m[i] == M:
			count += 1
			i += 1
		if count > mmax:
			mmax = count
	i += 1
print(mmax)
pass


n = int(input())
a = list(map(int, input().split()))
m = max(a)
i = 0
count = 0
while i < n:
	j = 0
	while i + j < n and a[i + j] == m:
		j += 1
	if j != 0 and j > count:
		count = j
	i += 1 + j
if count == 0:
	print(1)
else:
	print(count)


n = int(input())
a = list(map(int, input().split()))
mx = max(a)
c = 0
ans = 0
for i in a:
	if i == mx:
		c += 1
	else:
		c = 0
	ans = max(c, ans)
print(ans)


n = int(input())
l = list(map(int, input().split()))
d = max(l)
solve = []
c = 0
for i in range(n):
	try:
		if l[i] == d and l[i + 1] == d:
			c += 1
		else:
			solve.append(c + 1)
			c = 0
	except:
		solve.append(c + 1)
if solve == []:
	print(1)
else:
	print(max(solve))


n = int(input())
a = [int(x) for x in input().split()]
m = max(a)
maxi = 1
i = 0
while i < n:
	if a[i] == m:
		z = 1
		while i < n and a[i] == m:
			i += 1
			z += 1
		maxi = max(maxi, z)
	i += 1
print(maxi - 1)


n = int(input())
a = list(map(int, input().split()))
x = max(a)
res = -1
ans = 0
for i in range(n):
	if a[i] == x:
		ans += 1
		res = max(res, ans)
	else:
		res = max(res, ans)
		ans = 0
print(res)


n = int(input())
a = list(map(int, input().strip().split()))
b = max(a)
c = []
d = 0
for i in range(n):
	if a[i] == b:
		d = d + 1
	else:
		c.append(d)
		d = 0
c.append(d)
d = 0
print(max(c))


n = int(input())
l = list(map(int, input().split()))
r = max(l)
k = 0
m = 0
for i in range(n):
	if l[i] == r:
		k = k + 1
	else:
		k = 0
	m = max(k, m)
print(m)


(n, a) = (input(), list(map(int, input().split())))
m = max(a)
max_l = 1
l = 0
for x in a:
	if x == m:
		l += 1
		max_l = max(l, max_l)
	else:
		l = 0
print(max_l)


n = int(input())
a = list(map(int, input().split()))
result = 0
tmp = 0
maximum = max(a)
z = -1
ind = 0
while z < len(a):
	try:
		ind = a.index(maximum, z + 1)
	except:
		if result < tmp:
			result = tmp
		break
	else:
		if ind == z + 1:
			tmp += 1
		else:
			if result < tmp:
				result = tmp
			tmp = 1
		z = ind
print(result)


n = int(input())
arr = list(map(int, input().split(' ')))
k = max(arr)
res = 0
max_res = 0
for elem in arr:
	if elem == k:
		res += 1
	else:
		if res > max_res:
			max_res = res
		res = 0
print(max(max_res, res))


n = int(input())
a = input()
l = list(map(int, a.split()))
ma = max(l)
co = 1
le = 1
for i in range(1, n):
	if l[i] == ma and l[i - 1] == ma:
		le = le + 1
		if le > co:
			co = le
	else:
		le = 1
print(co)


x = int(input())
y = input().split()
y = list(map(int, y))
l = 1
maxl = 1
i = 0
maxy = max(y)
while i < x:
	if y[i] == maxy:
		l = 1
		while i + 1 < len(y) and y[i + 1] == maxy:
			l += 1
			i += 1
		if l > maxl:
			maxl = l
	i += 1
if maxy == 0:
	print(len(y))
else:
	print(maxl)


n = int(input())
A = list(map(int, input().split()))
M = max(A)
cnt = 0
ans = 1
for a in A:
	if a == M:
		cnt += 1
	else:
		cnt = 0
	ans = max(cnt, ans)
print(ans)


n = int(input())
l = list(map(int, input().split()))
a = max(l)
i = 0
mx = -1
while i != n:
	cou = 0
	if i >= n:
		break
	if l[i] == a:
		for j in range(i, n):
			if l[j] == a:
				cou += 1
				i += 1
			else:
				break
	if mx < cou:
		mx = cou
	i += 1
print(mx)


import itertools
n = int(input())
a = list(map(int, input().split()))
v = [(k, len(list(g))) for (k, g) in itertools.groupby(a)]
print(max(v)[1])


n = int(input())
a = list(map(int, input().split()))
maxxn = max(a)
l = []
summ = 0
f = -123
maxxi = -1
x = []
for i in range(len(a)):
	summ += a[i]
	l.append(summ)
	if a[i] == maxxn:
		x.append(i)
t = []
for i in range(len(x)):
	if i != len(x) - 1:
		t.append(x[i + 1] - x[i])
b = False
cntlst = []
for i in range(len(t)):
	if t[i] == 1 and b == False:
		b = True
		cnt = 1
		if i == len(t) - 1:
			cntlst.append(cnt)
	elif t[i] == 1 and b == True:
		cnt += 1
		if i == len(t) - 1:
			cntlst.append(cnt)
	elif t[i] != 1 and b == False:
		pass
	elif t[i] != 1 and b == True:
		cntlst.append(cnt)
		b = False
if cntlst:
	print(max(cntlst) + 1)
else:
	print(1)


n = int(input())
A = list(map(int, input().split()))
a = max(A)
acc = 0
ans = 1
for b in A:
	if b == a:
		acc += 1
	else:
		acc = 0
	ans = max(ans, acc)
print(ans)


n = int(input())
a = list(map(int, input().split()))
currMean = float(a[0])
count = 1
maxMean = float(a[0])
final = 1
for i in range(1, n):
	val = (currMean * count + a[i]) / (count + 1)
	if val >= float(a[i]):
		currMean = val
		count = count + 1
	else:
		currMean = float(a[i])
		count = 1
	if maxMean < currMean:
		maxMean = currMean
		final = count
	elif maxMean == currMean:
		if count > final:
			final = count
print(final)


n = int(input())
tab = list(map(int, input().split()))
bat = tab
bat.append(-1)
x = sorted(bat)
mks = x[n]
wynik = 0
tymczas = 0
for i in range(n + 1):
	if bat[i] != mks:
		wynik = max(wynik, tymczas)
		tymczas = 0
		continue
	if bat[i] == mks:
		tymczas += 1
print(wynik)


n = int(input())
arr = list(map(int, input().split()))
m = max(arr)
length = 0
mlen = 0
for num in arr:
	if num == m:
		mlen += 1
		length = max(length, mlen)
	else:
		mlen = 0
print(length)


from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import defaultdict
from itertools import *
import functools
import sys
import math
MAX = sys.maxsize
MAXN = 10 ** 6 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b, x, y):
	return abs(a - x) + abs(b - y)

def numIN():
	return map(int, sys.stdin.readline().strip().split())

def charIN():
	return sys.stdin.readline().strip().split()

def chk(x, y):
	print(x, '=', y)

def ncr(n, k):
	res = 1
	c = [0] * (k + 1)
	c[0] = 1
	for i in range(1, n + 1):
		for j in range(min(i, k), 0, -1):
			c[j] = (c[j] + c[j - 1]) % MOD
	return c[k]
n = int(input())
l = list(numIN()) + [-1]
mx = max(l)
cnt = 0
i = 0
ans = []
f = 1
while i <= n:
	if l[i] == mx:
		if f:
			cnt = 1
		if l[i + 1] == l[i]:
			cnt += 1
			f = 0
	else:
		ans.append(cnt)
		cnt = 0
		f = 1
	i += 1
print(max(ans))


n = int(input())
a = list(map(int, input().split()))
m = max(a)
a = [' ' if i != m else '1' for i in a]
print(len(max(''.join(a).split())))


n = int(input())
a = [int(i) for i in input().split()]
highest = -1
for i in a:
	if i > highest:
		highest = i
longest = 0
streak = 0
idx = 0
while idx < n:
	if a[idx] == highest:
		streak += 1
	else:
		streak = 0
	longest = max(longest, streak)
	idx += 1
print(longest)


n = int(input())
a = list(map(int, input().split()))
k = max(a)
ans = []
sr = 1
for i in range(n - 1):
	if a[i + 1] == a[i] and a[i] == k:
		sr += 1
	else:
		ans.append(sr)
		sr = 1
ans.append(sr)
print(max(ans))


a = int(input())
b = input().strip().split()
max = 0
for i in range(len(b)):
	if int(b[i]) >= max:
		max = int(b[i])
max_count = 0
count = 0
for i in range(len(b)):
	if int(b[i]) == max:
		count += 1
	else:
		if count > max_count:
			max_count = count
		count = 0
if count > max_count:
	max_count = count
print(max_count)


n = int(input())
a = list(map(int, input().split()))
z = 0
ans = 0
ma = max(a)
for i in range(len(a)):
	if a[i] == ma:
		ans += 1
		z = max(z, ans)
	else:
		ans = 0
		continue
print(z)


input()
a = [*map(int, input().split())]
m = max(a)
print(max(map(len, ''.join(('. '[x < m] for x in a)).split())))


n = int(input())
maxi = 0
count = 0
maxc = 0
A = []
a = input()
A = a.split()
for i in A:
	if int(i) == maxi:
		count += 1
		if maxc < count:
			maxc = count
	elif int(i) > maxi:
		count = 1
		maxi = int(i)
		maxc = 1
	else:
		count = 0
print(maxc)


input()
arr = map(int, input().split())
maxx = 0
maxCount = 0
mmaxCount = 0
for i in arr:
	if maxx < i:
		maxx = i
		maxCount = 1
		mmaxCount = 1
	elif maxx == i:
		maxCount += 1
	else:
		maxCount = 0
	if mmaxCount < maxCount:
		mmaxCount = maxCount
print(mmaxCount)


input()
a = [*map(int, input().split())]
m = max(a)
r = l = 0
for x in a:
	if x < m:
		l = 0
	else:
		l += 1
		r = max(r, l)
print(r)


from math import *
from collections import *
from random import *
from bisect import *
import sys
input = sys.stdin.readline
t = 1
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	x = max(a)
	r = 0
	c = 0
	for i in a:
		if i == x:
			c += 1
		else:
			r = max(r, c)
			c = 0
	r = max(r, c)
	print(r)


n = int(input())
l = list(map(int, input().split()))
d = max(l)
q = []
c = 0
for i in range(n):
	if l[i] == d:
		c = c + 1
		q.append(c)
	else:
		c = 0
print(max(q))


def read_input():
	n = int(input())
	s2 = input()
	a = [int(i) for i in s2.split()]
	return (n, a)

def problem_a(n, a):
	largest = max(a)
	i = 0
	old_streak_begin = 0
	old_streak_end = 0
	while i < n:
		if a[i] == largest:
			streak_begin = i
			while i < n and a[i] == largest:
				i += 1
			streak_end = i - 1
			i -= 1
			if streak_end - streak_begin < old_streak_end - old_streak_begin:
				streak_begin = old_streak_begin
				streak_end = old_streak_end
			else:
				old_streak_begin = streak_begin
				old_streak_end = streak_end
		i += 1
	print(streak_end - streak_begin + 1)
(n, a) = read_input()
problem_a(n, a)


n = int(input())
a = list(map(int, input().split()))
c = max(a)
ml = 0
(k, z) = (0, 0)
u = []
for i in range(len(a)):
	if a[i] == c:
		ml += 1
	if ml > 0 and a[i] != c or i == len(a) - 1:
		u.append(ml)
		ml = 0
t = max(u)
print(t)


n = int(input())
a = list(map(int, input().split()))
z = max(a)
c = 0
m = 0
for e in a:
	if e == z:
		c += 1
		m = max(c, m)
	else:
		c = 0
print(m)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
ml = 0
length = 0
for i in range(n):
	if a[i] == m:
		length += 1
	else:
		if length > ml:
			ml = length
		length = 0
print(max(length, ml))


n = int(input())
arr = [int(i) for i in input().split()]
max = arr[0]
best_seq = 1
seq = 1
for i in range(1, n):
	if arr[i] > max:
		max = arr[i]
		seq = 1
		best_seq = 1
	elif arr[i] == max:
		seq += 1
	elif arr[i] < max:
		seq = 0
	if seq > best_seq:
		best_seq = seq
print(best_seq)


(a, b, c, d) = (0, 0, input(), 0)
for w in map(int, input().split()):
	(c, d) = (w, d * (w == c) + 1)
	(a, b) = max((a, b), (c, d))
print(b)


n = int(input())
numbers = list(map(int, input().split()))
m = max(numbers)
current_len = 0
max_len = 0
for i in numbers:
	if i == m:
		current_len += 1
	else:
		max_len = max(max_len, current_len)
		current_len = 0
max_len = max(max_len, current_len)
print(max_len)


from functools import reduce
a = input()
b = list(map(int, input().split()))
c = max(b)
print(max(reduce(lambda acc, cur: [acc[0] + 1, acc[1]] if cur == c else [0, max(acc)], b, [0, 0])))


n = int(input())
a = list(map(int, input().split()))
m = max(a)
ans = 0
st = -1
for i in range(n):
	if a[i] == m:
		if st == -1:
			st = i
		ans = max(ans, i - st + 1)
	else:
		st = -1
print(ans)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
best = 0
cur = 0
for i in a:
	if i == m:
		cur += 1
	else:
		best = max(best, cur)
		cur = 0
if cur != 0:
	best = max(best, cur)
print(best)


import math
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
max_len = 0
now_len = 0
for i in range(n):
	if a[i] == mx:
		now_len += 1
		max_len = max(max_len, now_len)
	else:
		now_len = 0
print(max_len)


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
maximum = max(a)
last = -1
ans = 0
count = 0
for i in a:
	if i != last:
		if last == maximum:
			ans = max(ans, count)
		count = 1
		last = i
	else:
		count += 1
if last == maximum:
	ans = max(ans, count)
print(ans)


_ = input()
arr = list(map(int, input().strip().split()))
l = 1
maxl = 1
m = max(arr)
for i in range(len(arr) - 1):
	if arr[i] == m and arr[i + 1] == m:
		l += 1
	else:
		l = 1
	maxl = max(l, maxl)
print(maxl)


n = int(input())
ar = list(map(int, input().split()))
b = max(ar)
d = [1]
if ar.count(b) > 1:
	i = 0
	while i < n - 1:
		if ar[i] == b:
			count = 1
			while True:
				if ar[i + count] == b:
					count += 1
					d.append(count)
					if i + count > n - 1:
						i += count
						break
				else:
					i += count
					break
		else:
			i += 1
	print(max(d))
else:
	print(1)


def mi():
	return list(map(int, input().split()))
n = int(input())
a = list(mi())
t = max(a)
cnt = 0
i = 0
while i < n:
	if a[i] == t:
		curcnt = 0
		while i < n and a[i] == t:
			curcnt += 1
			i += 1
		cnt = max(cnt, curcnt)
	i += 1
print(cnt)


from itertools import groupby
input()
xs = map(int, input().split())
ys = map(lambda a: [a[0], len([*a[1]])], groupby(xs))
print(max(ys)[1])


n = int(input())
a = list(map(int, input().split()))
c = 0
m = max(a)
x = 0
for i in range(n):
	if a[i] == m:
		x += 1
	if a[i] != m:
		x = 0
	c = max(x, c)
print(c)


n = int(input())
a = list(map(int, input().split()))
mx = -1
mxlen = 0
alen = 0
amx = -1
for i in a:
	if i != amx:
		amx = i
		alen = 0
	alen += 1
	if amx > mx:
		mx = amx
		mxlen = 0
	if amx == mx:
		mxlen = max(mxlen, alen)
print(mxlen)


input()
s = input()
s = [int(i) for i in s.split(' ')]
cur = 0
ans = 1
m = max(s)
for i in s:
	if i < m:
		cur = 0
	else:
		m = i
		cur = cur + 1
		ans = max(ans, cur)
print(ans)


import sys
from math import *

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())
n = mint()
a = list(mints())
b = max(a)
c = 0
r = 0
for i in a:
	if i == b:
		c += 1
	else:
		c = 0
	r = max(r, c)
print(r)


n = int(input())
a = list(map(int, input().split()))
r = max(a)
ans = 1
run = 0
for A in a:
	if A == r:
		run += 1
		ans = max(ans, run)
	else:
		run = 0
print(ans)


n = int(input())
li = list(map(int, input().split()))
b = max(li)
cr = 0
mx = 0
for i in range(n):
	if li[i] == b:
		cr += 1
	else:
		cr = 0
	mx = max(cr, mx)
print(mx)


import math
import os
import random
import re
import sys
n = int(input())
l = list(map(int, input().split()))
m = max(l)
mx = 1
c = 0
for i in range(n):
	if l[i] == m:
		c += 1
	else:
		mx = max(c, mx)
		c = 0
	if l[i] == m and i == n - 1:
		mx = max(c, mx)
print(mx)


n = int(input())
d = [int(x) for x in input().strip().split()]
mx = max(d)
r = 1
curlen = 0
for i in range(n):
	if d[i] == mx:
		curlen = curlen + 1
	else:
		curlen = 0
	r = max(r, curlen)
print(r)


n = int(input())
a = list(map(int, input().strip().split()))
m = max(a)
ma = 1
i = 0
c = 1
while i < len(a) - 1:
	if a[i] == m:
		if a[i] == a[i + 1]:
			c += 1
		else:
			c = 1
	ma = max(ma, c)
	i += 1
print(ma)


n = int(input())
a = [int(x) for x in input().split()]
an = 1
mx = max(a)
cur = 0
for i in range(n):
	if a[i] == mx:
		cur += 1
	else:
		an = max(an, cur)
		cur = 0
print(max(an, cur))


n = int(input())
inp = list(map(int, input().split()))
mx = max(inp)
cnt = 0
ans = 0
for i in inp:
	if i == mx:
		cnt += 1
	else:
		cnt = 0
	ans = max(ans, cnt)
print(ans)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
d = 0
dm = 1
for i in range(n):
	if a[i] == m:
		d += 1
	else:
		d = 0
	dm = max(dm, d)
print(dm)


import sys
n = int(sys.stdin.readline())
arr = list(map(int, sys.stdin.readline().split()))
val = max(arr)
ans = 0
i = 0
j = 0
while i < n:
	if arr[i] == val:
		j = i
		while j < n:
			if arr[j] == val:
				j += 1
			else:
				break
		ans = max(ans, j - i)
		i = j + 1
	else:
		i += 1
print(ans)


TN = 1

def solution():
	n = int(input())
	a = list(map(int, input().split()))
	ans = 1
	mx = max(a)
	x = 0
	for i in range(n):
		if a[i] == mx:
			x += 1
		else:
			x = 0
		if x > ans:
			ans = x
	print(ans)
while TN != 0:
	solution()
	TN -= 1


n = int(input())
arr = list(map(int, input().split()))
maxx = max(arr)
c = 0
ans = -1
for i in range(n):
	if arr[i] == maxx:
		c += 1
	else:
		ans = max(ans, c)
		c = 0
ans = max(ans, c)
print(ans)


n = int(input())
l = list(map(int, input().split()))
a = max(l)
y = 0
z = 0
for i in range(n):
	if l[i] != a:
		if z > y:
			y = z
		z = 0
	else:
		z += 1
if z != 0:
	if z > y:
		y = z
print(y)


(n, a) = (int(input()), list(map(int, input().split())) + [-1])
max_a = max(a)
cnt = maxcnt = 0
for i in range(n + 1):
	if a[i] == max_a:
		cnt += 1
	else:
		maxcnt = max(cnt, maxcnt)
		cnt = 0
print(maxcnt)


n = input()
a = list(map(int, input().split(' ')))
mx = max(a)
res = 0
pre = 0
for num in a:
	if num != mx:
		pre = 0
	else:
		pre += 1
		res = max(res, pre)
print(res)


import sys, collections, math, itertools, random, bisect
INF = sys.maxsize

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
mod = 1000000007
n = int(input())
arr = get_array()
cnt = 0
mx = max(arr)
len = 0
for i in arr:
	if i == mx:
		cnt += 1
	else:
		len = max(len, cnt)
		cnt = 0
print(max(len, cnt))


n = int(input())
list = [int(i) for i in input().split()]
maxx = list[0]
maxlen = 0
len = 0
for i in list:
	if maxx == i:
		maxlen += 1
		if len < maxlen:
			len = maxlen
	elif maxx < i:
		(len, maxlen, maxx) = (1, 1, i)
	else:
		maxlen = 0
print(len)


n = input()
arr = input()
numbers = [int(a) for a in arr.split()]
maior = max(numbers)
cont = 0
ans = 0
for a in numbers:
	if a == maior:
		cont += 1
	else:
		cont = 0
	ans = max(ans, cont)
print(ans)


n = int(input())
a = list(map(int, input().split()))
prev = a[0]
count = 1
length = 1
ans = max(a)
for i in range(1, n):
	if a[i] == prev and a[i] == ans:
		count += 1
	else:
		count = 1
		prev = a[i]
	if count > length:
		length = count
print(length)


n = int(input())
a = [int(s) for s in input().split()]
x = max(a)
maxlen = -10 ** 10
leng = 0
for i in range(len(a)):
	if a[i] == x:
		leng += 1
	elif a[i] != x:
		if leng > maxlen:
			maxlen = leng
		leng = 0
if leng > maxlen:
	maxlen = leng
print(maxlen)


n = int(input())
a = [int(i) for i in input().split()]
x = max(a)
cnt = 0
r = 0
for i in range(1, n):
	if a[i] == x and a[i - 1] == x:
		cnt += 1
	else:
		cnt = 0
	r = max(r, cnt)
print(r + 1)


n = int(input())
a = list(map(int, input().split()))
ma = max(a)
me = 0
re = 0
for i in range(n):
	if a[i] == ma:
		me = me + 1
	else:
		me = 0
	if re < me:
		re = me
print(re)


n = int(input())
A = list(map(int, input().split()))
m = max(A)
count = 0
max_count = 0
for i in A:
	if i == m:
		count += 1
	else:
		max_count = max(max_count, count)
		count = 0
max_count = max(max_count, count)
print(max_count)


n = int(input())
l = list(map(int, input().split()))
x = max(l)
lf = -1
c = 0
ans = 0
rf = -1
for i in range(n):
	if l[i] == x:
		c += 1
	else:
		ans = max(ans, c)
		c = 0
ans = max(c, ans)
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
if a.count(max(a)) == 1:
	print(1)
else:
	maxi = max(a)
	longest = 1
	current = 0
	for i in range(n):
		if a[i] == maxi:
			current += 1
		else:
			current = 0
		longest = max(longest, current)
	print(longest)


n = int(input())
a = list(map(int, input().split()))
w = max(a)
len1 = 0
c = 0
if len(a) == 1:
	print(1)
else:
	for i in range(n - 1):
		if i == n - 2 and a[i] == a[i + 1] and (a[i] == w):
			c += 2
			if len1 < c:
				len1 = c
				c = 0
		elif i == n - 2 and a[i] != a[i + 1] and (a[i] == w):
			c += 1
			if len1 < c:
				len1 = c
				c = 0
		elif i == n - 2 and a[i] != w and (a[i + 1] == w):
			c += 1
			if len1 < c:
				len1 = c
				c = 0
		elif a[i] == a[i + 1] and a[i] == w:
			c += 1
		elif a[i] == w and a[i] != a[i + 1]:
			c += 1
			if len1 < c:
				len1 = c
				c = 0
		elif a[i] != w:
			if len1 < c:
				len1 = c
			c = 0
	print(len1)


N = int(input())
l = list(map(int, input().split()))
M = 0
for i in l:
	M = max(M, i)
len_l = []
c = 0
for i in range(len(l)):
	if l[i] == M:
		c += 1
	else:
		len_l.append(c)
		c = 0
len_l.append(c)
print(max(len_l))


n = int(input())
lst = list(map(int, input().split()))
m_x = max(lst)
ans = []
cur = 0
for i in range(len(lst)):
	if lst[i] == m_x:
		cur += 1
		ans.append(cur)
	else:
		cur = 0
		ans.append(cur)
print(max(ans))


n = int(input())
a = list(map(int, input().split()))
ma = max(a)
j = 0
jm = 0
for i in range(n):
	if a[i] == ma:
		j += 1
		if j > jm:
			jm = j
	else:
		j = 0
print(jm)


n = int(input())
l = list(map(int, input().split()))
k = max(l)
a = []
count = 0
for i in range(n):
	if l[i] == k:
		count += 1
	else:
		a.append(count)
		count = 0
	a.append(count)
print(max(a))


n = int(input())
lis = list(map(int, input().split()))
m = max(lis)
d = 0
c = 0
for i in range(n):
	if lis[i] == m:
		c += 1
		if i == n - 1:
			d = max(d, c)
	else:
		d = max(d, c)
		c = 0
print(d)


n = int(input())
l = list(map(int, input().split()))
m = max(l)
fg = 0
ans = 0
c = 0
for i in range(len(l)):
	if l[i] == m:
		fg = 1
		c += 1
	elif fg == 1:
		fg = 0
		ans = max(ans, c)
		c = 0
if fg == 1:
	ans = max(ans, c)
print(ans)


def go():
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	m = max(a)
	i = 0
	t = 0
	while i < n:
		if a[i] == m:
			c_t = 1
			j = i + 1
			while j < n and a[j] == m:
				c_t += 1
				j += 1
			if c_t > t:
				t = c_t
			i = j
		else:
			i += 1
	return t
print(go())


def ia():
	return list(map(int, input().split()))

def ca():
	return input().split()

def ii():
	return int(input())
n = ii()
a = ia()
m = 0
k = max(a)
c = 0
i = 0
while i < n:
	if a[i] == k:
		c = 1
		i += 1
		while i < n and a[i] == k:
			i += 1
			c += 1
		if m < c:
			m = c
	i += 1
print(m)


n = int(input())
a = list(map(int, input().split()))
t = max(a)
ans = 1
for i in range(n):
	if a[i] != t or (i < n - 1 and a[i + 1] == a[i]):
		continue
	for j in range(n):
		if i - j < 0 or a[i - j] != t:
			break
		ans = max(ans, j + 1)
print(ans)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
n = int(input())
l = list(map(int, input().split()))
i = 0
z = max(l)
ans = 1
while i < n:
	if l[i] == z:
		k = 0
		while l[i] == z:
			k += 1
			i += 1
			if i == n:
				break
		ans = max(k, ans)
	else:
		i += 1
print(ans)


n = int(input())
a = map(int, input().split())

def longest_max(iter):
	highest = 0
	cur = 0
	longest = 1
	for val in iter:
		if val > highest:
			highest = val
			longest = 1
			cur = 1
		elif val == highest:
			cur += 1
			longest = max(longest, cur)
		else:
			longest = max(longest, cur)
			cur = 0
		yield longest
last = None
for last in longest_max(a):
	pass
print(last)


n = int(input())
m = 1
a = list(map(int, input().split()))
x = max(a)
a.append(-1)
s = 0
for t in range(n + 1):
	if a[t] == x:
		s += 1
	else:
		m = max(s, m)
		s = 0
print(m)


n = int(input())
s = list(map(int, input().split()))
f = max(s)
ans = 0
c = 0
for i in s:
	if i == f:
		c += 1
		ans = max(ans, c)
	else:
		c = 0
print(ans)


from sys import stdin

def get_max_element(arr, n):
	marr = []
	mx = max(arr)
	for i in range(len(arr)):
		if arr[i] == mx:
			marr.append(i)
	return marr
n = int(stdin.readline().strip())
arr = list(map(int, stdin.readline().split()))
marr = get_max_element(arr, n)
l = 1
cur = 1
for i in range(1, len(marr)):
	if marr[i] == marr[i - 1] + 1:
		l = max(l, cur + 1)
		cur += 1
	else:
		cur = 1
print(l)


import sys
from functools import reduce
from math import sqrt, floor

def eprint(*args, **kwargs):
	if not __debug__:
		print(*args, file=sys.stderr, **kwargs)
eprint('Local\n')
for t in range(int(input()) if not __debug__ else 1):
	n = int(input())
	arr = list(map(int, input().split()))
	max_a = max(arr)
	res = 0
	cur_res = 0
	for a in arr:
		if a < max_a:
			cur_res = 0
		else:
			cur_res += 1
		res = max(res, cur_res)
	print(res)


n = int(input())
a = [*map(int, input().split())]
mx = max(a)
ans = 1
i = 0
while i < n:
	count = 0
	while i < n and a[i] == mx:
		count += 1
		i += 1
	i += 1
	ans = max(ans, count)
print(ans)


input()
a = [i for i in input().split()]
a = list(map(int, a))
b = max(a)
dem = 1
d = 1
for i in range(len(a) - 1):
	if a[i] == b and a[i + 1] == b:
		dem = dem + 1
	else:
		dem = 1
	d = max(d, dem)
print(d)


n = int(input())
arr = list(map(int, input().split()))
this = max(arr)
c = 1
i = 0
while i < n:
	z = 1
	if arr[i] == this:
		while i + z < n and arr[i + z] == this:
			z += 1
	c = max(z, c)
	i += z
print(c)


n = int(input())
a = list(map(int, input().split()))
cnt = 0
ans = 0
mx = max(a)
for _ in a:
	if _ == mx:
		cnt += 1
	else:
		cnt = 0
	ans = max(ans, cnt)
print(ans)


import sys
input = sys.stdin.readline
n = int(input())
l = input().split()
li = [int(i) for i in l]
maxa = max(li)
dp = [0 for i in range(n)]
if li[0] == maxa:
	dp[0] = 1
for i in range(1, n):
	if li[i] == maxa:
		dp[i] = dp[i - 1] + 1
	else:
		dp[i] = 0
print(max(dp))


n = int(input())
arr_str = input().split()
arr = [int(x) for x in arr_str]
max_el = arr[0]
cnt = 1
max_cnt = 1
for i in range(1, len(arr)):
	if arr[i] > max_el:
		max_el = arr[i]
		max_cnt = 1
		cnt = 1
	elif arr[i] == max_el:
		cnt += 1
	else:
		if cnt > max_cnt:
			max_cnt = cnt
		cnt = 0
if cnt > max_cnt:
	max_cnt = cnt
print(max_cnt)


def main():
	n = int(input())
	a = list(map(int, input().split()))
	(ret, curr, max_val) = (1, 1, a[0])
	for i in range(1, n):
		if a[i] > max_val:
			curr = ret = 1
			max_val = a[i]
		elif a[i] == max_val:
			if a[i] == a[i - 1]:
				curr += 1
			else:
				curr = 1
		else:
			curr = 0
		ret = max(ret, curr)
	print(ret)
main()


b = int(input())
a = [int(x) for x in input().split(' ')]
c = max(a)
xx = xx1 = 0
for xxx in a:
	if xxx < c:
		xx = 0
	else:
		xx += 1
		xx1 = max(xx1, xx)
print(xx1)


n = int(input())
ar = list(map(int, input().split()))
k = max(ar)
temp = [0 for i in range(n)]
for i in range(0, n):
	if ar[i] == k:
		if i > 0 and temp[i - 1] != 0:
			temp[i] = 1 + temp[i - 1]
		else:
			temp[i] = 1
print(max(temp))


n = int(input())
A = list(map(int, input().split()))
p = 0
m = max(A)
pm = 1
for i in A:
	if i == m:
		p += 1
		if p > pm:
			pm = p
	else:
		p = 0
print(pm)


n = int(input())
arr = list(map(int, input().split()))
max1 = max(arr)
i = 0
ans = 1
while i < n:
	if arr[i] == max1:
		count = 0
		while i < n and arr[i] == max1:
			count += 1
			i += 1
		ans = max(ans, count)
	i += 1
print(ans)


n = int(input())
arr = list(map(int, input().split()))
m = max(arr)
size = 0
size = 1
l_size = 1
i = arr.index(m)
while True:
	try:
		tmp = arr.index(m, i + 1)
		if tmp == i + 1:
			l_size += 1
		else:
			if l_size > size:
				size = l_size
			l_size = 1
		i = tmp
	except:
		if l_size > size:
			size = l_size
		break
print(size)


n = int(input())
l = [int(i) for i in input().split()]
a = max(l)
gm = 1
lm = 1
for i in range(n - 1):
	if l[i + 1] == l[i] and l[i] == a:
		lm += 1
	else:
		lm = 1
	if lm > gm:
		gm = lm
print(gm)


n = int(input())
a = [int(x) for x in input().split()]
s = []
max_a = max(a)
cnt = 0
for i in range(n - 1):
	if a[i] == max_a:
		if a[i] == a[i + 1]:
			cnt += 1
		else:
			s.append(cnt)
			cnt = 0
s.append(cnt)
print(max(s) + 1)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
c = 1
i = 0
while i < n:
	t = 1
	if a[i] == m:
		i += 1
		while i < n and a[i] == m:
			i += 1
			t += 1
	c = max(t, c)
	i += 1
print(c)


n = int(input())
a = list(map(int, input().split()))
arr = []
ans = 1
ind = 0
for i in range(1, n):
	if a[i] >= a[ind]:
		ind = i
for j in range(0, n):
	if a[j] == a[ind]:
		arr.append(j)
arr.sort()
prev = arr[0]
num = 1
for k in range(1, len(arr)):
	if arr[k] != prev + num:
		prev = arr[k]
		ans = max(ans, num)
		num = 1
	else:
		num += 1
ans = max(ans, num)
print(ans)


Size = int(input())
X = list(map(int, input().split()))
Indexes = []
Max = max(X)
for i in range(Size):
	if X[i] == Max:
		Indexes.append(i)
MaxSub = 1
Now = 1
for i in range(1, len(Indexes)):
	if Indexes[i] - Indexes[i - 1] == 1:
		Now += 1
	else:
		MaxSub = max(MaxSub, Now)
		Now = 1
print(max(MaxSub, Now))


(n, ls, maxi, maxs, currs) = (int(input()), map(int, input().split()), -1, 0, 0)
for l in ls:
	if l > maxi:
		(maxi, currs, maxs) = (l, 1, 1)
	elif l == maxi:
		currs += 1
	else:
		(maxs, currs) = (currs, 0) if currs > maxs else (maxs, 0)
print(currs if currs > maxs else maxs)


def main():
	n = int(input())
	L = [int(x) for x in input().split()]
	print(solver(L))

def solver(L):
	n = len(L)
	maxLength = 1
	length = 1
	prev = L[0]
	maxNum = L[0]
	for i in range(1, n):
		cur = L[i]
		if prev == cur:
			length += 1
		else:
			if prev > maxNum:
				maxLength = length
				maxNum = prev
			elif prev == maxNum and length > maxLength:
				maxLength = length
			length = 1
		prev = cur
	if prev > maxNum:
		maxLength = length
		maxNum = prev
	elif prev == maxNum and length > maxLength:
		maxLength = length
	return maxLength
main()


n = int(input())
array = list(map(int, input().split()))
maxm = max(array)
i = 0
count = 0
m = 0
while i < len(array):
	if array[i] == maxm:
		if i != 0 and array[i] == array[i - 1]:
			count += 1
		else:
			count = 1
	else:
		count = 0
	m = max(m, count)
	i += 1
print(m)


n = int(input())
a = list(map(int, input().split()))
b = max(a)
ans = 0
max_ans = 1
stop = False
for i in range(n):
	if a[i] == b:
		if stop:
			ans += 1
		else:
			ans = 1
			stop = True
	else:
		max_ans = max(ans, max_ans)
		ans = 0
max_ans = max(ans, max_ans)
print(max_ans)


def best_segment(n, arr):
	max_value = 0
	current_count = 0
	max_count = 0
	for (i, ele) in enumerate(arr):
		if ele > max_value:
			max_value = ele
			current_count = 1
			max_count = 1
		elif ele == max_value:
			current_count += 1
			if i == n - 1:
				max_count = max([max_count, current_count])
		else:
			max_count = max([max_count, current_count])
			current_count = 0
	return max_count
n = int(input())
arr = map(int, input().split(' '))
result = best_segment(n, arr)
print(result)


n = int(input())
v = list(map(int, input().split()))
m = 0
for i in range(n):
	m = max(m, v[i])
dmax = 0
d = 0
for i in range(n):
	if v[i] != m:
		d = 0
	else:
		d += 1
		dmax = max(d, dmax)
print(dmax)


from itertools import groupby
from operator import itemgetter
n = input()
arr = list(map(int, input().split()))

def max_max_len(arr):
	groups = ((x[0], len(list(x[1]))) for x in groupby(arr))
	return max(groups, key=itemgetter(0, 1))[1]
print(max_max_len(arr))


n = int(input())
a = list(map(int, input().split()))
max_val = max(a)
max_l = 0
l = 0
for v in a:
	if v == max_val:
		l += 1
	else:
		max_l = max(max_l, l)
		l = 0
print(max(max_l, l))


n = int(input())
s = input()
s = s.split()
s1 = []
max = 0
ans = 1
max_len = 1
for i in range(n):
	s1.append(int(s[i]))
for k in s1:
	if k > max:
		max = k
if len(s1) == 1:
	max_len = 1
for i in range(n):
	if s1[i] == max:
		if i != n - 1 and s1[i + 1] == max:
			ans += 1
		else:
			if ans > max_len:
				max_len = ans
			ans = 1
print(max_len)


n = int(input())
a = []
for i in input().split(' '):
	a.append(int(i))
maximum = max(a)
now = 0
r = 0
for i in a:
	if i == maximum:
		now += 1
	else:
		if now > r:
			r = now
		now = 0
if now > r:
	r = now
print(r)


n = int(input())
arr = list(map(int, input().split()))
m = max(arr)
c = 0
temp = 0
for x in arr:
	if x == m:
		c += 1
	else:
		if temp < c:
			temp = c
		c = 0
if temp < c:
	temp = c
print(temp)


n = int(input())
p = list(map(int, input().strip().split(' ')))
m = max(p)
j = 0
c_max = 0
while j < n:
	if p[j] == m:
		c = 0
		while j < n and p[j] == m:
			j += 1
			c += 1
		if c > c_max:
			c_max = c
	else:
		j += 1
print(c_max)


m = int(input())
lis = list(map(int, input().split()))
ma = max(lis)
ct = 0
li2 = m * [0]
prev = 0
if len(lis) == 1:
	print(1)
else:
	if lis[0] == ma:
		li2[0] = 1
		prev = 1
	for i in range(m - 1):
		if lis[i + 1] == ma:
			li2[i + 1] = prev + 1
			prev += 1
		else:
			prev = 0
	print(max(li2))


n = int(input())
a = list(map(int, input().split()))
m = max(a)
i = 0
l = 0
while i < n:
	j = i + 1
	if a[i] == m:
		while j < n:
			if a[j] == m:
				j += 1
			else:
				break
		l = max(l, j - i)
	i = j
print(l)


input()
a = tuple(map(int, input().split()))
x = max(a)
c = r = 0
for ai in a:
	if ai == x:
		c += 1
	else:
		c = 0
	r = max(c, r)
print(r)


n = int(input())
li = list(map(int, input().split()))
m = max(li)
ans = 1
i = 0
while i < n:
	if li[i] == m:
		j = i
		while j < n and li[j] == m:
			j += 1
		ans = max(ans, j - i)
		i = j
	else:
		i += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
MAX = max(a)
dp = [0] * n
dp[0] = 1 if a[0] == MAX else 0
for i in range(1, n):
	if a[i] == MAX:
		dp[i] = dp[i - 1] + 1
ans = 0
for i in range(n):
	ans = max(ans, dp[i])
print(ans)


n = int(input())
arr = list(map(int, input().split()))
m = max(arr)
le = 0
l = 0
for i in arr:
	if i == m:
		l += 1
	else:
		le = max(le, l)
		l = 0
if arr[n - 1] == m:
	le = max(le, l)
print(le)


import sys
from bisect import bisect_left, bisect_right, insort
from collections import deque, Counter
from math import gcd, sqrt, factorial, ceil, log10, log2
from itertools import permutations
from heapq import heappush, heappop, heapify
inf = float('inf')
mod = 1000000007

def factorial_p(n, p):
	ans = 1
	if n <= p // 2:
		for i in range(1, n + 1):
			ans = ans * i % p
	else:
		for i in range(1, p - n):
			ans = ans * i % p
		ans = pow(ans, p - 2, p)
		if n % 2 == 0:
			ans = p - ans
	return ans

def nCr_p(n, r, p):
	ans = 1
	while n != 0 or r != 0:
		(a, b) = (n % p, r % p)
		if a < b:
			return 0
		ans = ans * factorial_p(a, p) * pow(factorial_p(b, p), p - 2, p) * pow(factorial_p(a - b, p), p - 2, p) % p
		n //= p
		r //= p
	return ans

def prime_sieve(n):
	flag = n % 6 == 2
	sieve = bytearray((n // 3 + flag >> 3) + 1)
	for i in range(1, int(n ** 0.5) // 3 + 1):
		if not sieve[i >> 3] >> (i & 7) & 1:
			k = 3 * i + 1 | 1
			for j in range(k * k // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
			for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
	return sieve

def prime_list(n):
	res = []
	if n > 1:
		res.append(2)
	if n > 2:
		res.append(3)
	if n > 4:
		sieve = prime_sieve(n + 1)
		res.extend((3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not sieve[i >> 3] >> (i & 7) & 1))
	return res

def binary(number):
	result = 0
	while number:
		result = result + 1
		number = number & number - 1
	return result

def is_prime(n):
	if n < 5 or n & 1 == 0 or n % 3 == 0:
		return 2 <= n <= 3
	s = (n - 1 & 1 - n).bit_length() - 1
	d = n >> s
	for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]:
		p = pow(a, d, n)
		if p == 1 or p == n - 1 or a % n == 0:
			continue
		for _ in range(s):
			p = p * p % n
			if p == n - 1:
				break
		else:
			return False
	return True

def all_factors(n):
	(small, large) = ([], [])
	for i in range(1, int(n ** 0.5) + 1, 2 if n & 1 else 1):
		if not n % i:
			small.append(i)
			large.append(n // i)
	if small[-1] == large[-1]:
		large.pop()
	large.reverse()
	small.extend(large)
	return small

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
Arr = get_array()
if len(Arr) == len(set(Arr)):
	print(1)
	exit()
maxi = max(Arr)
if Arr.count(maxi) == 1:
	print(1)
	exit()
curr_length = 0
maxi_length = 0
for i in range(n):
	if i == 0 and Arr[i] == maxi or (i > 0 and Arr[i] == maxi and (Arr[i - 1] != maxi)):
		curr_length += 1
	elif Arr[i] == maxi and Arr[i - 1] == maxi:
		curr_length += 1
	elif Arr[i] != maxi and Arr[i - 1] == maxi:
		maxi_length = max(curr_length, maxi_length)
		curr_length = 0
print(max(maxi_length, curr_length))


n = int(input())
a = [int(s) for s in input().split()]
a.append(-1)
mx = max(a)
ans = 1
k = 0
for i in range(n + 1):
	if a[i] == mx:
		k += 1
	else:
		ans = max(ans, k)
		k = 0
print(ans)


n = int(input())
a1 = input()
a2 = a1.split()
a = list(map(int, a2))
max = 0
for i in range(len(a)):
	if a[i] > max:
		max = a[i]
maxfreq = 0
i = 0
while i < len(a):
	freq = 0
	while i < len(a):
		if a[i] == max:
			freq += 1
			i += 1
		else:
			i += 1
			break
	if freq > maxfreq:
		maxfreq = freq
print(maxfreq)


n = int(input())
arr = list(map(int, input().split()))
x = max(arr)
count = 0
j = 0
for i in arr:
	count = max(count, j)
	if i == x:
		j += 1
	else:
		j = 0
count = max(count, j)
print(count)


n = int(input())
stack = [int(x) for x in input().split()]

def calc(n, stack):
	condition = True
	for i in stack:
		if i != 0:
			condition = False
	if condition == False:
		max_ = max(stack)
		stack.append(0)
		temp = 0
		i = 0
		while i <= len(stack) - 1:
			if stack[i] == max_:
				count = 1
				index = i + 1
				while True:
					if stack[index] == max_:
						count += 1
						i += 1
						index += 1
					else:
						i += 1
						break
				if temp < count:
					temp = count
			else:
				i += 1
		return temp
	else:
		return len(stack)
print(calc(n, stack))


n = int(input())
A = [int(i) for i in input().split()]
m = max(A)
cnt = 0
ans = 0
for a in A:
	if a == m:
		cnt += 1
	else:
		ans = max(ans, cnt)
		cnt = 0
print(max(ans, cnt))


n = int(input())
a = list(map(int, input().split()))
m = max(a)
best = 0
count = 0
for i in range(len(a)):
	if a[i] == m:
		count += 1
	else:
		count = 0
	best = max(best, count)
print(best)


n = int(input())
v = [int(i) for i in input().split()]
mx = max(v)
cnt = 0
ans = 0
for i in v:
	if i == mx:
		cnt += 1
	else:
		cnt = 0
	ans = max(ans, cnt)
print(ans)


def main():
	n = int(input())
	a = list(map(int, input().split()))
	mx = max(a)
	cnt = 0
	mxcnt = 0
	for i in range(len(a)):
		if a[i] == mx:
			cnt += 1
		else:
			mxcnt = max(cnt, mxcnt)
			cnt = 0
	print(max(mxcnt, max(1, cnt)))
	return
main()


n = int(input())
a = list(map(int, input().split()))
m = max(a)
mcnt = 0
cnt = 0
for i in range(0, n):
	if a[i] != m:
		cnt = 0
	else:
		cnt += 1
		mcnt = max(cnt, mcnt)
print(mcnt)


n = int(input())
li1 = list(map(int, input().split()))
li1.append(-1)
cn = 0
li2 = []
ab = max(li1)
for i in range(n + 1):
	if li1[i] != ab:
		li2.append(cn)
		cn = 0
	else:
		cn += 1
print(max(li2))


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest
from math import ceil, floor, log, log2, sqrt, gcd, factorial, pow

def binNumber(n, size=4):
	return bin(n)[2:].zfill(size)

def iar():
	return list(map(int, input().split()))

def ini():
	return int(input())

def isp():
	return map(int, input().split())

def sti():
	return str(input())

def par(a):
	return ' '.join(list(map(str, a)))

def tdl(outerListSize, innerListSize, defaultValue=0):
	return [[defaultValue] * innerListSize for i in range(outerListSize)]

class pair:

	def __init__(self, f, s):
		self.fi = f
		self.se = s

	def __lt__(self, other):
		return (self.fi, self.se) < (other.fi, other.se)
n = ini()
a = iar()
s = max(a)
l = 0
mi = -1
for i in a:
	if i == s:
		l += 1
	else:
		mi = max(mi, l)
		l = 0
mi = max(mi, l)
print(mi)


length = int(input())
array = input()
numbers = [int(a) for a in array.split()]
maxnum = max(numbers)
maxLength = 1
count = numbers.count(maxnum)
ans = 1
check = [maxnum]
for i in range(length - 1):
	if count > 1 and numbers[i] == maxnum:
		if numbers[i] == numbers[i + 1]:
			check.append(numbers[i + 1])
			if len(check) > maxLength:
				maxLength = len(check)
		else:
			if len(check) > maxLength:
				maxLength = len(check)
			check.clear()
			check.append(maxnum)
	ans = maxLength
	if count == 1:
		ans = 1
print(ans, '\n')


n = int(input())
ar = list((int(x) for x in input().split()))
m = max(ar)
s = 0
best = 0
for a in ar:
	if a == m:
		s += 1
		best = max(s, best)
	else:
		s = 0
print(best)


n = input()
temp = input()
l = list(map(int, temp.split()))
n = int(n)
mx = max(l)
count = ans = 0
for x in l:
	if x == mx:
		count += 1
	else:
		ans = max(ans, count)
		count = 0
ans = max(ans, count)
print(ans)


n = int(input())
l = list(map(int, input().split()))
a = max(l)
p = 1
p1 = 0
for i in l:
	if i == a:
		p1 += 1
	else:
		p = max(p, p1)
		p1 = 0
p = max(p, p1)
print(p)


n = int(input())
ln = [int(a) for a in input().split(' ')]
k = max(ln)
MaxL = 0
L = 0
if ln[0] == k:
	L = 1
if n == 1:
	print(L)
else:
	for i in range(1, n):
		if ln[i] == ln[i - 1] and ln[i] == k or ln[i] == k:
			L += 1
			if i == n - 1:
				if L > MaxL:
					MaxL = L
		elif ln[i] != ln[i - 1] and ln[i - 1] == k:
			if L > MaxL:
				MaxL = L
			L = 0
	print(MaxL)


n = int(input())
a = list(map(int, input().split()))
max_ = max(a)
maxlength = 0
length = 0
flag = False
for i in range(n):
	if a[i] == max_:
		length += 1
	elif length > maxlength:
		maxlength = length
		length = 0
	else:
		length = 0
if length > maxlength:
	maxlength = length
print(maxlength)


n = int(input())
s = [int(x) for x in input().split()]
el = max(s)
pos1 = -1
pos2 = -1
c = 0
ans = 0
for i in range(0, len(s)):
	if s[i] == el:
		c = c + 1
	else:
		ans = max(ans, c)
		c = 0
ans = max(ans, c)
print(ans)


n = int(input())
a = list(map(int, input().split(' ')))
k = 0
m = max(a)
maxk = 0
for i in range(len(a)):
	if a[i] == m:
		k += 1
	else:
		if maxk < k:
			maxk = k
		k = 0
if maxk < k:
	maxk = k
print(maxk)


n = int(input())
mas = list(map(int, input().split()))
mx = max(mas)
(lenmx, ln) = (1, 0)
for i in mas:
	if i == mx:
		ln += 1
	else:
		if ln > lenmx:
			lenmx = ln
		ln = 0
if ln > lenmx:
	lenmx = ln
print(lenmx)


n = int(input())
cur = -1
ma = -1
curlen = 0
maxlen = 0
p = list(map(int, input().split()))
for a in p:
	if a != cur:
		cur = a
		curlen = 0
	curlen += 1
	if ma < cur:
		ma = cur
		maxlen = curlen
	if ma == cur:
		maxlen = max(maxlen, curlen)
print(maxlen)


n = int(input())
a = list(map(int, input().split()))
maxa = max(a)
total = 0
res = 0
count = 0
for i in range(n):
	total += a[i]
	count += 1
	if total / count == maxa:
		if count > res:
			res = count
		continue
	else:
		total = 0
		count = 0
print(res)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	n = I()
	a = LI() + [-1]
	m = max(a)
	t = 0
	r = 1
	for c in a:
		if c == m:
			t += 1
		else:
			if r < t:
				r = t
			t = 0
	return r
print(main())


n = int(input())
arr = list(map(int, input().split()))
(maxi, max_len) = (max(arr), 0)
maxx = max_len
i = 0
while i <= len(arr) - 1:
	while i <= len(arr) - 1 and arr[i] == maxi:
		max_len += 1
		i += 1
		maxx = max(maxx, max_len)
	max_len = 0
	i += 1
print(maxx)


n = int(input())
a = list(map(int, input().split()))
c = 0
co = 0
maxi = 0
for q in range(n):
	if c < a[q]:
		c = a[q]
for w in range(n):
	if a[w] == c:
		co = co + 1
	if maxi < co:
		maxi = co
	if a[w] != c:
		co = 0
print(maxi)


n = int(input())
l = list(map(int, input().split()))
m = max(l)
i = 0
ans = 1
while i < n:
	if l[i] == m:
		count = 0
		while i < n and l[i] == m:
			count += 1
			i += 1
		if count > ans:
			ans = count
	else:
		i += 1
print(ans)


n = int(input())
arr = [int(x) for x in input().split()]
ans = l = 0
max_ = max(arr)
for i in arr:
	if i < max_:
		ans = 0
	else:
		ans += 1
		l = max(ans, l)
print(l)


n = int(input())
a = list(map(int, input().split()))
ma = max(a)
ans = 1
cnt = 0
i = 0
while i < n:
	if a[i] == ma:
		cnt += 1
	else:
		cnt = 0
	ans = max(cnt, ans)
	i += 1
print(ans)


_ = input()
n = int(_)
_ = input()
a = _.split()
a = [int(_) for _ in a]
i = 0
answer = 0
_max = 0
while i < n:
	if _max < a[i]:
		answer = 1
	if _max <= a[i]:
		_max = a[i]
		a_leng = 1
		i = i + 1
		while i < n and a[i] == _max:
			a_leng = a_leng + 1
			i = i + 1
		if answer < a_leng:
			answer = a_leng
		continue
	i = i + 1
print(answer)


n = int(input())
a = list(map(int, input().split()))
ans = 0
temp = 0
max1 = max(a)
for i in a:
	if max1 == i:
		temp += 1
	else:
		ans = max(temp, ans)
		temp = 0
ans = max(temp, ans)
print(ans)


n = int(input())
s = list(map(int, input().split(' ')))
maxk = 1
i = 0
ms = max(s)
if s.count(ms) == 1:
	print(maxk)
else:
	while i < n:
		if s[i] == ms:
			k = i
			while k < n and s[k] == ms:
				k += 1
			temp = k - i
			maxk = max(temp, maxk)
			i = k
		i += 1
	print(maxk)


import sys
from itertools import groupby

def get_max_sublist(l):
	m = max(l)
	r = (len(list(i[1])) for i in groupby(l) if i[0] == m)
	return max(r)
if len(sys.argv) > 1 and sys.argv[1] == 'test':
	tests = [[[1], 1], [[1, 2, 2, 3], 1], [[1, 2, 2, 1], 2], [[1, 2, 3], 1], [[1, 1, 4, 4], 2], [[4, 1, 4, 4, 4], 3], [[4, 1, 4, 5, 4], 1]]
	for t in tests:
		print(get_max_sublist(t[0]), t[1])
else:
	first_line = input()
	second_line = input()
	l = list(map(int, second_line.split()))
	print(get_max_sublist(l))


n = int(input())
a = [int(x) for x in input().split()]
answer = 0
streak = 0
maximum = max(a)
for i in range(n):
	if a[i] == maximum:
		streak += 1
		answer = max(answer, streak)
	else:
		streak = 0
print(answer)


n = int(input())
l = list(map(int, input().split()))
mx = max(l)
le = 0
a = 0
for i in range(n):
	if l[i] == mx:
		a += 1
	else:
		a = 0
	if a > le:
		le = a
print(le)


n = int(input())
l = [int(a) for a in input().split()]
m = max(l)
r = 0
maxR = 0
for i in range(n):
	if l[i] == m:
		r += 1
	else:
		r = 0
	if maxR < r:
		maxR = r
print(maxR)


from sys import stdin
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
n = int(input())
a = listin()
z = max(a)
mcount = 0
count = 0
for i in a:
	if i == z:
		count += 1
	else:
		mcount = max(count, mcount)
		count = 0
mcount = max(mcount, count)
print(mcount)


n = int(input().strip())
arr = list(map(int, input().strip().split()))
arr.append(-1)
m = max(arr)
ans = 0
c = 0
for i in range(len(arr)):
	if arr[i] == m:
		c += 1
	else:
		ans = max(ans, c)
		c = 0
print(ans)


input()
p = [*map(int, input().split())]
m = max(p)
len = 0
maxlen = 0
for a in p:
	if a == m:
		len = len + 1
		maxlen = max(len, maxlen)
	else:
		len = 0
print(maxlen)


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = list(map(int, input().split(' ')))
	temp = max(a)
	cnt = 0
	ans = 0
	for x in range(n):
		if a[x] == temp:
			cnt += 1
			ans = max(ans, cnt)
		else:
			cnt = 0
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
s = list(map(int, input().split()))
m = -1
row = 0
mr = 0
for i in s:
	if i == m:
		row += 1
	elif i > m:
		m = i
		row = 1
		mr = 0
	else:
		row = 0
	mr = max(mr, row)
print(mr)


n = int(input())
a = list(map(int, input().split()))
f = max(a)
maxlen = 0
curlen = 0
started = False
for i in range(len(a)):
	if a[i] == f:
		if not started:
			curlen = 1
			started = True
		else:
			curlen += 1
	else:
		started = False
		maxlen = max(maxlen, curlen)
maxlen = max(maxlen, curlen)
print(maxlen)


n = int(input())
arr = list(map(int, input().split()))
maxctr = 0
ctr = 0
largest = max(arr)
for i in range(0, n):
	if arr[i] == largest:
		ctr = ctr + 1
		if ctr > maxctr:
			maxctr = ctr
	else:
		if ctr > maxctr:
			maxctr = ctr
		ctr = 0
print(maxctr)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
count = 1
m_c = 0
for i in range(1, n):
	if a[i] == a[i - 1] and a[i] == m:
		count += 1
	else:
		m_c = max(m_c, count)
		count = 1
	m_c = max(m_c, count)
if m_c == 0:
	print(1)
else:
	print(m_c)


n = int(input())
a = [int(i) for i in input().split()]
L = 1
M = max(a)
Temp = 0
for i in a:
	if i != M:
		Temp = 0
	else:
		Temp += 1
		if Temp > L:
			L = Temp
print(L)


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return list(map(int, sys.stdin.readline().split()))

def input():
	return sys.stdin.readline()

def main():
	n = int(input())
	arr = get_array()
	maxi = max(arr)
	(mx, curr) = (0, 0)
	for i in range(n):
		if arr[i] == maxi:
			curr += 1
			mx = max(mx, curr)
		else:
			curr = 0
	print(mx)

def __starting_point():
	main()
__starting_point()


n = int(input())
a = []
b = []
a = list(map(int, input().split()))
for i in range(n):
	b.append(a[i])
b.sort()
max = b[n - 1]
ans = 0
cnt = 0
i = 0
while i < n:
	if a[i] == max:
		cnt = 0
		j = i
		while j < n and a[j] == max:
			cnt += 1
			j += 1
		if cnt > ans:
			ans = cnt
		i = j
	else:
		i += 1
print(ans)


n = int(input())
l = [int(i) for i in input().split()]
m = max(l)
i = 0
maxi = 0
while i < n:
	if l[i] == m:
		c = 0
		while i < n and l[i] == m:
			c += 1
			i += 1
		maxi = max(maxi, c)
	i += 1
print(maxi)


amount = int(input())
array = [int(s) for s in input().split()]
max_ = max(array)
counter = 0
counter_max = 0
for i in range(len(array)):
	if array[i] == max_:
		counter += 1
		if counter > counter_max:
			counter_max = counter
	else:
		counter = 0
print(counter_max)


N = int(input())
v = [int(x) for x in input().split()]
length = [1]
avg = [v[0]]
if N == 1:
	print(1)
	exit()
for i in range(1, N):
	new_avg = (avg[i - 1] * length[i - 1] + v[i]) / (length[i - 1] + 1)
	if new_avg >= v[i] and new_avg >= avg[i - 1]:
		avg.append(new_avg)
		length.append(length[i - 1] + 1)
	else:
		length.append(1)
		avg.append(v[i])
d = list(zip(avg, length))
a = [v[1] for v in sorted(d, key=lambda kv: (kv[0], kv[1]))]
print(a[-1])


n = int(input())
a = list(map(int, input().split()))
if n == 1:
	print(1)
	exit()
m = max(a)
count = res = 1
for i in range(1, n):
	if a[i] == a[i - 1] == m:
		count += 1
		res = max(res, count)
	else:
		count = 1
print(res)


n = input()
a = list(map(int, input().split()))
m = max(a)
max_len = 0
act_len = 0
for val in a:
	if val == m:
		act_len += 1
		max_len = max(max_len, act_len)
	else:
		act_len = 0
print(max_len)


n = int(input())
a = [int(x) for x in input().split()]
ma = max(a)
j = 0
ans = 0
for i in a:
	if i == ma:
		j += 1
	else:
		j = 0
	ans = max(ans, j)
print(ans)


cnt = lambda s, i: s.count(i)
ii = lambda : int(input())
si = lambda : input()
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
n = ii()
l = il()
c = 0
m = []
mx = max(l)
for i in range(n):
	if l[i] == mx:
		c += 1
	else:
		c = 0
	m.append(c)
print(max(m))


n = int(input())
a = list(map(int, input().split()))
m = max(a)
current = 0
longest = 0
for x in a:
	if x == m:
		current += 1
	else:
		longest = max(current, longest)
		current = 0
longest = max(current, longest)
print(longest)


n = int(input())
a = list(map(int, input().split()))
ma = max(a)
z = 0
maxz = 1
for i in range(n):
	if a[i] == ma:
		z += 1
	else:
		if z > maxz:
			maxz = z
		z = 0
if z > maxz:
	maxz = z
print(maxz)


n = int(input())
arr = [int(i) for i in input().split()]
x = max(arr)
ans = 0
A = []
j = arr.index(x)
for i in range(j, n):
	if arr[i] == x:
		ans += 1
	else:
		A.append(ans)
		ans = 0
A.append(ans)
print(max(A))


def f(l):
	mt = [l[0], 1]
	rt = [l[0], 1]
	n = len(l)
	l.append(-1)
	for i in range(1, n + 1):
		if l[i] == l[i - 1]:
			rt[1] += 1
			continue
		if rt[0] > mt[0] or (rt[0] == mt[0] and rt[1] > mt[1]):
			mt = [rt[0], rt[1]]
		rt = [l[i], 1]
	return mt[1]
n = int(input())
l = list(map(int, input().split()))
print(f(l))


n = int(input())
array = list(map(int, input().split()))
f = max(array)
l = 0
lm = 1
while l < n:
	if array[l] != f:
		l += 1
	else:
		r = l
		while r + 1 < n and array[r + 1] == f:
			r += 1
		if r - l + 1 > lm:
			lm = r - l + 1
		l = r + 1
print(lm)


n = int(input())
l = [int(i) for i in input().split()]
n1 = max(l)
c1 = 0
i = 0
while i < n:
	if l[i] == n1:
		c = 1
		for j in range(i + 1, n):
			if l[j] == n1:
				c += 1
			else:
				break
		i += c
		c1 = max(c1, c)
	else:
		i += 1
print(c1)


n = int(input())
mas = input().split(' ')
for i in range(n):
	mas[i] = int(mas[i])
max_e = mas[0]
for i in range(1, n):
	if max_e < mas[i]:
		max_e = mas[i]
col = 0
el = []
for i in range(n):
	if max_e == mas[i]:
		col += 1
		el.append(i)
temp = 1
k = []
for i in range(len(el) - 1):
	if el[i] + 1 == el[i + 1]:
		temp += 1
	else:
		k.append(temp)
		temp = 1
if len(k) > 0:
	print(max(max(k), temp))
else:
	print(temp)


n = int(input())
a = list(map(int, input().split()))
mx = max(a)
foo = 0
a = [-1] + a
a = a + [-1]
y = 0
for i in range(len(a) - 1):
	if a[i] != mx and a[i + 1] == mx:
		y = i
	elif a[i] == mx and a[i + 1] != mx:
		foo = max(foo, i - y)
print(foo)


import sys
from collections import defaultdict as dd
from itertools import permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
import heapq
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
n = ri(1)
a = ri()
f = max(a)
ans = 0
now = [0 for i in range(n + 1)]
now = a[0] == f
ans = 1
for i in range(1, n):
	if a[i] == f:
		now += 1
	else:
		now = 0
	ans = max(ans, now)
print(ans)


import sys
import math as mt
import bisect
input = sys.stdin.readline
t = 1

def solve():
	maxi = max(l[:])
	(ans, cnt) = (0, 0)
	for i in range(n):
		if l[i] == maxi:
			cnt += 1
		else:
			ans = max(ans, cnt)
			cnt = 0
	ans = max(ans, cnt)
	return ans
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	print(solve())


n = int(input())
a = [int(x) for x in input().split()]
b = []
c = 1
for i in range(n):
	if i == 0:
		b.append([a[i], c])
		c = c + 1
	elif a[i] > (b[i - 1][0] * i + a[i]) / (i + 1):
		c = 1
		b.append([a[i], 1])
		c = c + 1
	else:
		b.append([(b[i - 1][0] * i + a[i]) / (i + 1), c])
		c = c + 1
b.sort(reverse=True)
z = b[0][0]
y = b[0][1]
for i in range(n):
	if b[i][0] == z:
		if b[i][1] > y:
			y = b[i][1]
	else:
		break
print(y)


N = int(input())
A = [int(a) for a in input().split()]
m = max(A)
ma = 0
c = 0
for i in range(N):
	if A[i] == m:
		c += 1
		ma = max(ma, c)
	else:
		c = 0
print(ma)


n = int(input())
L = list(map(int, input().split()))
ma = max(L)
(lm, gm) = (0, 0)
for i in range(n):
	if L[i] == ma:
		lm += 1
	else:
		lm = 0
	gm = max(lm, gm)
print(gm)


t = int(input())
lst = list(map(int, input().split()))
lst2 = []
lst3 = set()
count = 1
m = max(lst)
lst3.add(1)
for c in range(t):
	if m == lst[c]:
		lst2.append(c)
for c in range(len(lst2) - 1):
	if lst2[c] == lst2[c + 1] - 1:
		count += 1
	else:
		lst3.add(count)
		count = 1
lst3.add(count)
print(max(lst3))


n = int(input())
a = list(map(int, input().split()))
b = sum(a)
b = b / n
count = 1
count1 = 0
max = -1
maxx = -1
sum = 0
for i in range(len(a) - 1):
	if sum == 0:
		sum += a[i]
	if a[i] == a[i + 1]:
		count += 1
		sum += a[i + 1]
	else:
		if sum / count > max:
			max = sum / count
			count1 = count
		elif sum / count == max and count > count1:
			max = sum / count
			count1 = count
		count = 1
		sum = 0
if len(a) > 1:
	if a[len(a) - 1] != a[len(a) - 2]:
		sum = a[len(a) - 1]
		count = 1
		if sum / count > max:
			max = sum / count
			count1 = count
		elif sum / count == max and count > count1:
			max = sum / count
			count1 = count
	elif sum / count > max:
		max = sum / count
		count1 = count
	elif sum / count == max and count > count1:
		max = sum / count
		count1 = count
	print(count1)
else:
	print(1)


n = int(input())
l = list(map(int, input().split()))
max = l[0]
for i in range(n - 1):
	if max < l[i + 1]:
		max = l[i + 1]
max_length = 0
temp = 0
for i in l:
	if i == max:
		temp += 1
	else:
		if temp > max_length:
			max_length = temp
		temp = 0
if temp > max_length:
	max_length = temp
print(max_length)


from sys import stdin, stdout
n = [int(x) for x in stdin.readline().rstrip().split()][0]
A = [int(x) for x in stdin.readline().rstrip().split()]
vmax = max(A)
max_l = 0
l = 0
for i in range(n):
	if A[i] == vmax:
		l += 1
	else:
		l = 0
	max_l = max(max_l, l)
print(max_l)


n = int(input())
a = list(map(int, input().split()))
(q, t, r) = (max(a), 0, 0)
for i in a:
	if i == q:
		r += 1
	else:
		t = max(t, r)
		r = 0
print(max(t, r))


__author__ = 'Esfandiar'
n = int(input())
a = list(map(int, input().split()))
m = max(a)
t = 0
M = float('-inf')
for i in range(n):
	if a[i] == m:
		t += 1
	else:
		M = max(t, M)
		t = 0
print(max(M, t))


N = int(input())
A = [int(n) for n in input().split()]
mx = max(A)
length = 0
score = 0
for i in range(N):
	if A[i] == mx:
		length += 1
	else:
		length = 0
	if score < length:
		score = length
print(score)


n = int(input())
arr = list(map(int, input().split()))
mm = max(arr)
ll = 0
i = 0
ans = 0
while i < n:
	if arr[i] == mm:
		ll += 1
	else:
		ans = max(ans, ll)
		ll = 0
	i += 1
ans = max(ans, ll)
print(ans)


n = int(input())
a = list(map(int, input().split()))
r = 1
c = 1
m = a[0]
for (i, ai) in enumerate(a[1:], 1):
	if ai == a[i - 1]:
		c += 1
	else:
		c = 1
	if ai > m:
		m = ai
		r = 1
	elif ai == m and c > r:
		r = c
print(r)


n = int(input())
a = [int(o) for o in input().split()]
u = max(a)
ml = 1
l = 1
for i in range(n - 1):
	if a[i] == u and a[i + 1] == u:
		l += 1
		if l > ml:
			ml = l
	else:
		l = 1
print(ml)


n = int(input())
a = list(map(int, input().split()))
a = [[a[i], i] for i in range(n)]
a.sort(reverse=True)
ls = []
for i in range(n):
	if a[i][0] == a[0][0]:
		ls.append(a[i][1])
ans = 1
temp = 1
for i in range(1, len(ls)):
	if ls[i - 1] - ls[i] == 1:
		temp += 1
	else:
		ans = max(ans, temp)
		temp = 1
ans = max(ans, temp)
print(ans)


from sys import stdin
n = int(stdin.readline())
arr = list(map(int, stdin.readline().split()))
a = max(arr)
ans = []
count = 0
for i in range(n):
	if arr[i] == a:
		count += 1
	else:
		count = 0
	ans.append(count)
print(max(ans))


import itertools as it
n = int(input())
A = [int(x) for x in input().split()]
m = max(A)
result = max([len(list(x[1])) for x in it.groupby(A) if x[0] == m])
print(result)


n = eval(input())
a = list(map(int, input().split()))
m = max(a)
j = 0
ans = 1
while j < n:
	c = 1
	while j + 1 < n and a[j] == m and (a[j + 1] == m):
		j += 1
		c += 1
	ans = max(c, ans)
	j += 1
print(ans)


n = int(input())
v = list(map(int, input().split()))
mx = max(v)
(res, accu) = (0, 0)
for i in range(n):
	if mx == v[i]:
		accu += 1
	else:
		res = max(res, accu)
		accu = 0
	res = max(res, accu)
print(res)


n = int(input())
l = list(map(int, input().split()))
m = max(l)
count = 0
mc = 1
for i in l:
	if i == m:
		count += 1
	else:
		count = 0
	mc = max(mc, count)
print(mc)


n = int(input())
l = list(map(int, input().split()))
x = max(l)
ans = 0
flag = True
cur = 0
for i in range(n):
	if l[i] == x:
		cur += 1
	else:
		ans = max(ans, cur)
		cur = 0
ans = max(ans, cur)
print(ans)


__author__ = 'NIORLYS'
n = int(input())
a_i = list(map(int, input().split()))
a_m = max(a_i)
count = 1
partial_count = 0
for i in range(n):
	if a_m == a_i[i]:
		partial_count += 1
		continue
	count = max(partial_count, count)
	partial_count = 0
count = max(partial_count, count)
print(count)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
(mcc, i) = (0, 0)
while i < n:
	g = 0
	while i < n and a[i] == m:
		g += 1
		i += 1
	if g > mcc:
		mcc = g
	i += 1
print(mcc)


from itertools import groupby
nb_elements = int(input())
elements = [int(x) for x in input().split()]
maxs = max(elements)
ele_Group = groupby(elements)
max_len = 0
for (k, g) in ele_Group:
	if k == maxs:
		max_len = max(max_len, len(list(g)))
print(max_len)


import sys
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
GOSA = 1.0 / 10 ** 10
MOD = 10 ** 9 + 7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z') + 1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def DP(N, M, first):
	return [[first] * M for n in range(N)]

def DP3(N, M, L, first):
	return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe

def dump(*args):
	names = {id(v): k for (k, v) in currentframe().f_back.f_locals.items()}
	print(', '.join((names.get(id(arg), '???') + ' => ' + repr(arg) for arg in args)), file=sys.stderr)

def local_input():
	from pcm.utils import set_stdin
	import sys
	from pathlib import Path
	parentdir = Path(os.path.dirname(__file__)).parent
	inputfile = parentdir.joinpath('test/sample-1.in')
	if len(sys.argv) == 1:
		set_stdin(inputfile)

def solve():
	n = int(input())
	A = list(map(int, input().split()))
	m = max(A)
	res = 0
	c = 0
	for a in A:
		if a == m:
			c += 1
			res = max(res, c)
		else:
			c = 0
	print(res)
	return 0

def __starting_point():
	try:
		local_input()
	except:
		pass
	solve()
__starting_point()


num = int(input())
list_str = input()
list_token = list_str.split(' ')
mylist = list()
for i in list_token:
	mylist.append(int(i))
if num == 0:
	print(0)
else:
	left = 0
	right = 1
	max_l = 1
	max_v = mylist[0]
	cur_v = mylist[0]
	while right < num:
		if mylist[right] != cur_v:
			left = right
			cur_v = mylist[right]
		if cur_v >= max_v:
			if cur_v > max_v:
				max_l = right - left + 1
				max_v = cur_v
			elif right - left + 1 > max_l:
				max_l = right - left + 1
		right += 1
	print(max_l)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
c = 1
curc = 1
for i in range(1, n):
	if a[i] == a[i - 1] and a[i] == m:
		curc += 1
	else:
		curc = 1
	c = max(c, curc)
print(c)


n = int(input())
A = [i for i in map(int, input().split())]
big = max(A)
bigrec = 1
total = A.count(big)
places = []
for i in range(len(A)):
	if A[i] == big:
		places.append(i)
lenbig = 1
for i in range(len(places) - 1):
	if places[i] + 1 == places[i + 1]:
		lenbig += 1
	else:
		if lenbig > bigrec:
			bigrec = lenbig
		lenbig = 1
if lenbig > bigrec:
	bigrec = lenbig
print(bigrec)


def ok(arr1):
	n = len(arr1)
	mx = max(arr1)
	ans = 0
	count = 0
	for i in arr1:
		if i == mx:
			count += 1
		else:
			count = 0
		ans = max(ans, count)
	return ans
n = int(input())
arr1 = list(map(int, input().split()))
print(ok(arr1))


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = 1
for tt in range(t):
	n = int(input())
	a = list(map(int, sys.stdin.readline().split(' ')))
	m = max(a)
	ans = 0
	c = 0
	for i in range(n):
		if a[i] == m:
			c += 1
		else:
			ans = max(ans, c)
			c = 0
	print(max(ans, c))
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


n = input()
a = list(map(int, input().split()))
r = max(a)
ans = 0
k = 0
for i in a:
	if i == r:
		k += 1
	else:
		ans = max(k, ans)
		k = 0
ans = max(k, ans)
print(ans)


a = int(input())
z = list(map(int, input().split()))
t = max(z)
ans = []
maxa = 1
count = 0
for i in range(len(z)):
	if z[i] == t:
		if count == 0:
			count = 1
			continue
		else:
			if z[i - 1] == t:
				count += 1
			maxa = max(count, maxa)
	else:
		count = 0
print(maxa)


n = int(input())
l = list(map(int, input().split()))
max_length = 1
max_value = 0
j = 0
while j < n:
	if l[j] > max_value:
		max_value = l[j]
		length = 0
		while j < n and l[j] == max_value:
			length += 1
			j += 1
		max_length = length
	elif l[j] == max_value:
		length = 0
		while j < n and l[j] == max_value:
			length += 1
			j += 1
		if length > max_length:
			max_length = length
	else:
		j += 1
print(max_length)


n = int(input())
arr = list(map(int, input().split()))
max_arr = max(arr)
l = 0
i = 0
while i <= n - 1:
	if arr[i] == max_arr:
		temp_l = 0
		j = i
		while j <= n - 1:
			if arr[j] == max_arr:
				temp_l += 1
				j += 1
			else:
				break
		if temp_l > l:
			l = temp_l
		i = j + 1
	else:
		i += 1
print(l)


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations

def li():
	return list(map(int, input().split()))

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def solve():
	t = 1
	for it in range(t):
		n = nu()
		a = li()
		aa = sorted(a)
		zz = 0
		mx = 0
		pp = aa[n - 1]
		for i in range(n):
			if pp == a[i]:
				zz += 1
			else:
				mx = max(zz, mx)
				zz = 0
		mx = max(zz, mx)
		print(mx)
solve()


n = int(input())
a = list(map(int, input().split()))
m = max(a)
ans = 0
state = 0
cnt = 0
for i in a:
	if i == m:
		if state == 1:
			cnt += 1
		else:
			cnt = 1
			state = 1
	elif state == 1:
		state = 0
		if cnt > ans:
			ans = cnt
		cnt = 0
ans = max(ans, cnt)
print(ans)


def longest_sequence(n, a):
	m = max(a)
	max_seq = 0
	cur_seq = 0
	for i in range(len(a)):
		if a[i] == m:
			cur_seq += 1
			max_seq = max(max_seq, cur_seq)
		else:
			cur_seq = 0
	return max_seq
n = int(input())
a = list(map(int, input().split()))
print(longest_sequence(n, a))


def All_Negative_Test(array):
	for x in array:
		if x > 0:
			return False
	return True

def Find_Max(n, array):
	Max = len_Max = len_temp = -1
	continuity = False
	for x in array:
		if int(x) > Max:
			Max = int(x)
			len_temp = 1
			continuity = True
			len_Max = 0
			len_Max = max(len_Max, len_temp)
		elif int(x) == Max and continuity == True:
			len_temp += 1
			continuity = True
			len_Max = max(len_Max, len_temp)
		elif int(x) == Max and continuity == False:
			len_temp = 1
			continuity = True
		else:
			len_temp = 0
			continuity = False
	return len_Max
N = input().split()
Array = input().split()
print(Find_Max(N, Array))


input()
A = list(map(int, input().split()))
x = max(A)
m = k = 0
for a in A:
	if a == x:
		k += 1
		m = max(m, k)
	else:
		k = 0
print(m)


n = int(input())
arrayInput = input().split(' ')
arr = [int(x) for x in arrayInput]
max_arr = max(arr)
arr_result = []
max_leng = 0
for i in arr:
	if i == max_arr:
		max_leng += 1
		arr_result.append(max_leng)
	else:
		max_leng = 0
print(max(arr_result))


n = int(input())
a = list(map(int, input().split()))
m = max(a)
i = 0
ans = 0
while i < n:
	if a[i] == m:
		count = 1
		i += 1
		while i < n:
			if a[i] == m:
				count += 1
				i += 1
			else:
				break
		ans = max(ans, count)
	i += 1
print(ans)


def best_mean(lst):
	(m, result, answer) = (max(lst), 0, 0)
	for i in range(len(lst)):
		if lst[i] != m:
			result = max(answer, result)
			answer = 0
		else:
			answer += 1
	return max(answer, result)
n = int(input())
a = [int(j) for j in input().split()]
print(best_mean(a))


n = int(input())
a = list(map(int, input().split()))
s = max(a)
kq = 0
kq_ = 0
i = 0
done = True
while i <= n - 1 and done == True:
	kq_ = 0
	if a[i] == s:
		kq_ = 1
		for j in range(i + 1, n):
			if a[j] == s:
				kq_ += 1
			else:
				break
	i += kq_ + 1
	kq = max(kq, kq_)
print(kq)


t = int(input())
a = list(map(int, input().split()))
p = max(a)
c = 1
j = 0
m = 1
while j < t - 1:
	if a[j] == p:
		if a[j] == a[j + 1]:
			c += 1
			m = max(m, c)
		else:
			c = 1
	else:
		c = 1
	j += 1
print(m)


n = int(input())
a = list(map(int, input().split()))
maxi = max(a)
counti = count = 0
for ai in a:
	if ai == maxi:
		count += 1
	else:
		counti = max(counti, count)
		count = 0
print(max(counti, count))


n = int(input())
a = list(map(int, input().split()))
mx = max(a)
p = 0
l1 = []
for i in range(n):
	if a[i] == mx:
		p += 1
	else:
		l1.append(p)
		p = 0
l1.append(p)
print(max(l1))


n = int(input())
ar = []
ar = input().split()
for i in range(0, n):
	ar[i] = int(ar[i])
mx = max(ar)
len = 0
lnt = []
lnt.append(0)
if ar[0] == mx:
	lnt[0] = 1
for i in range(1, n):
	lnt.append(0)
	if ar[i] == mx:
		lnt[i] = lnt[i - 1] + 1
print(max(lnt))


n = int(input())
a = [int(x) for x in input().split()]
v = max(a)
a.append(10 ** 100)
counter = 0
prev = 10 ** 100
max_counter = 0
for item in a:
	if item == v:
		counter += 1
	else:
		if counter > max_counter:
			max_counter = counter
		counter = 0
print(max_counter)


n = int(input())
a = list(map(int, input().split()))
x = max(a)
i = 0
ans = 0
while i < n:
	j = i
	while i < n and a[i] == a[j]:
		i += 1
	if a[j] == x:
		ans = max(ans, i - j)
print(ans)


n = int(input())
arr = list(map(int, input().split()))
mx = max(arr)
l = 0
first = False
longest = 0
curr = 0
for i in range(n):
	if arr[i] == mx:
		if not first:
			(first, curr) = (True, curr + 1)
		else:
			curr += 1
	elif first:
		longest = max(longest, curr)
		first = False
		curr = 0
if first:
	longest = max(longest, curr)
print(longest)


n = int(input())
a = [int(i) for i in input().split()]
p = max(a)
ct = 0
ans = 1
for i in range(len(a)):
	if a[i] == p:
		ct += 1
	ans = max(ans, ct)
	if a[i] != p:
		ct = 0
print(ans)


n = int(input())
arr = list(map(int, input().split()))
k = max(arr)
ans = 1
summ = 0
d = 0
for i in range(n):
	if arr[i] == k:
		d += 1
		ans = max(d, ans)
	else:
		d = 0
print(ans)


n = int(input())
inp = input().split(' ')
a = []
for i in inp:
	a.append(int(i))
mean = a[0]
max_l = 1
l = 1
for i in range(1, len(a)):
	if a[i] > mean:
		mean = a[i]
		l = 1
		max_l = 1
	elif a[i] == mean:
		l += 1
		if l > max_l:
			max_l = l
	else:
		l = 0
print(max_l)


n = int(input())
a = list(map(int, input().split()))
mal = 0
a2 = a[:]
a2.sort()
ma = a2[-1]
l = 0
for i in range(n):
	if a[i] == ma:
		l += 1
	else:
		mal = max(l, mal)
		l = 0
print(max(mal, l))


(_, lst) = (input(), list(map(int, input().split())))
(k, length, read) = (max(lst), 0, 0)
for i in lst:
	read = read + 1 if k == i else 0
	length = max(read, length)
else:
	print(length)


input()
A = [(0, 0)]
for w in map(int, input().split()):
	(c, d) = A[-1]
	A.append((w, d * (w == c) + 1))
print(max(A)[1])


n = int(input())
l = list(map(int, input().split())) + [-1]
v = max(l)
k = []
s = 0
for i in l:
	if i == v:
		s += 1
	else:
		k.append(s)
		s = 0
print(max(k))


n = int(input())
entrada = input()
a = [int(x) for x in entrada.split()]
delta = max(a)
maxi = 0
counter = 0
a = a + [-1]
for i in range(n + 1):
	if a[i] == delta:
		counter += 1
	else:
		maxi = max([counter, maxi])
		counter = 0
print(maxi)


n = int(input())
l = list(map(int, input().split()))
m = max(l)
c = 1
k = 1
l2 = []
for i in range(1, n):
	if l[i] == m and l[i - 1] == m:
		c += 1
		if c > k:
			k = c
	else:
		c = 1
print(k)


n = int(input())
array = [int(x) for x in input().split(' ')]
maxx = max(array)
if array == [maxx] * n:
	print(n)
else:
	prev = array[0]
	count = 1
	longest = 1
	for i in range(1, n):
		if array[i] == maxx:
			if array[i] == prev:
				count += 1
				prev = array[i]
				longest = max(count, longest)
			else:
				prev = array[i]
		else:
			count = 1
			prev = array[i]
	print(longest)


n = int(input())
a = list(map(int, input().split()))
f = max(a)
k = 1
b = [1]
for i in range(0, n - 1):
	if a[i] == f and a[i + 1] == f:
		k += 1
		b.append(k)
	else:
		k = 1
print(max(b))


n = int(input())
a = [int(i) for i in input().split()]
bol = max(a)
a.append(-1)
p = 1
c = 1
for i in range(n):
	if a[i] == bol:
		if a[i + 1] == bol:
			p += 1
		elif p > c:
			c = p
	else:
		p = 1
print(c)


t = int(input())
a = list(map(int, input().split()))
if t >= 3:
	m = max(a)
	j = 0
	i = 0
	while i < t:
		c = 0
		if a[i] == m:
			while a[i] == m:
				c += 1
				i += 1
				if i == t:
					break
		else:
			i += 1
		if j < c:
			j = c
	print(j)
elif t == 2:
	if a[0] == a[1]:
		print(2)
	else:
		print(1)
else:
	print(1)


def find_max_length(a):
	max_v = a[0]
	prev = a[0]
	v_len = 1
	max_v_len = 1
	for i in range(1, len(a)):
		if prev == a[i]:
			v_len += 1
		else:
			v_len = 1
		if max_v < a[i]:
			max_v = a[i]
			max_v_len = 1
		elif max_v == a[i]:
			max_v_len = max(max_v_len, v_len)
		prev = a[i]
	return max_v_len
input()
a = [int(v) for v in input().split()]
print(find_max_length(a))


x = int(input())
s = list(map(int, input().split()))
l = 0
m = 0
k = max(s)
for n in s:
	if n == k:
		m += 1
		l = max(l, m)
	else:
		m = 0
print(l)


n = int(input())
temp = input().split(' ')
arr = list(map(lambda t: int(t), temp))
maxi = 0
for i in range(len(arr)):
	if maxi < arr[i]:
		maxi = arr[i]
length = 0
temp_length = 0
for i in range(len(arr)):
	if arr[i] == maxi:
		temp_length = temp_length + 1
		if temp_length > length:
			length = temp_length
	else:
		temp_length = 0
print(length)


n = int(input())
a = list(map(int, input().split()))
mx = max(a)
ans = 1
f = False
k = 1
for x in a:
	if x == mx:
		if not f:
			f = True
			k = 1
		else:
			k += 1
	else:
		f = False
		if k > ans:
			ans = k
if f:
	if k > ans:
		ans = k
print(ans)


n = int(input())
a = list(map(int, input().split()))
count = 0
maxi = 0
k = max(a)
for item in a:
	if item == k:
		count = count + 1
		if count > maxi:
			maxi = count
	else:
		count = 0
print(maxi)


import sys
inn = lambda : input().strip()
N = int(inn())
A = tuple((int(a) for a in inn().split(' ')))
mx = max(A)
mxIndex = tuple((i for i in range(N) if A[i] == mx))
maxCount = 1
count = 1
before = mxIndex[0]
for i in range(1, len(mxIndex)):
	if mxIndex[i] - before == 1:
		count += 1
		maxCount = max(maxCount, count)
	else:
		count = 1
	before = mxIndex[i]
print(maxCount)


n = int(input())
arr = [int(x) for x in input().split()]
m = max(arr)
(ans, cnt) = (1, 0)
for x in arr:
	if x == m:
		cnt += 1
	else:
		ans = max(ans, cnt)
		cnt = 0
print(max(ans, cnt))


n = int(input())
A = [int(x) for x in input().split()]
m = max(A)
t = 0
i = 0
b = 0
while i < n:
	if A[i] == m:
		t += 1
	else:
		b = max(t, b)
		t = 0
	i += 1
b = max(t, b)
print(b)


n = int(input())
l = list(map(int, input().split()))
ans = 1
t = 1
mx = max(l)
for i in range(1, n):
	if l[i] == mx and l[i - 1] == mx:
		t = t + 1
	else:
		t = 1
	ans = max(ans, t)
print(ans)


n = int(input())
a = list(map(int, input().split()))
max_a = max(a)
ans = 0
l = 0
for i in a:
	if i == max_a:
		l += 1
	else:
		ans = max(ans, l)
		l = 0
print(max(ans, l))


n = int(input())
a = list(map(int, input().split()))
z = max(a)
c = 0
r = 0
for i in range(n):
	if a[i] < z:
		c = 0
	else:
		c = c + 1
		r = max(r, c)
print(r)


n = int(input())
a = list(map(int, input().split()))
prefix = [0]
s = 0
for i in a:
	prefix.append(s + i)
	s += i
to_find = max(a)
ans = 1
curr = 0
for i in a:
	if i == to_find:
		curr += 1
		ans = max(ans, curr)
	else:
		curr = 0
print(ans)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
counting = False
l = 1
lm = 1
for i in range(n):
	if counting:
		if a[i] == m:
			l += 1
		else:
			counting = False
			lm = max(lm, l)
	elif a[i] == m:
		l = 1
		counting = True
lm = max(lm, l)
print(lm)


kam = int(input())
n = list(map(int, input().split()))
p = 0
jam = []
s = 0
la = max(n)
p = 0
for x in range(kam):
	if n[x] == la:
		s = 1
	if s == 1:
		if n[x] == la:
			p += 1
		else:
			jam.append(p)
			p = 0
			s = 0
jam.append(p)
print(max(jam))


n = int(input())
a = [0] + [int(e) for e in input().split()]
mx = max(a)
b = [0 for i in range(n + 1)]
for i in range(1, n + 1):
	if a[i] == mx:
		b[i] = b[i - 1] + 1
	else:
		b[i] = 0
print(max(b))


n = int(input())
arr = list(map(int, input().split()))
arr2 = [-1] * n
k = max(arr)
for i in range(n):
	if arr[i] == k:
		arr2[i] = 1

def maxSubArraySum(a, size):
	l = list()
	c = 0
	for i in range(size):
		if a[i] > 0:
			c += 1
		else:
			l.append(c)
			c = 0
	l.append(c)
	return max(l)
print(maxSubArraySum(arr2, n))


from sys import stdin, stdout
from collections import *
from math import gcd, floor, ceil

def st():
	return list(stdin.readline().strip())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def inp():
	return int(stdin.readline())

def pr(n):
	return stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	n = inp()
	l = li()
	a = max(l)
	i = 0
	ans = 0
	while i < n:
		if l[i] == a:
			c = 0
			while i < n and l[i] == a:
				c += 1
				i += 1
			ans = max(ans, c)
		else:
			i += 1
	pr(ans)
for _ in range(1):
	solve()


n = int(input())
a = [int(i) for i in input().split(' ')]
r = max(a)
p = 0
ma = -1
for i in range(n):
	if a[i] == r:
		if p != 0:
			p += 1
			ma = max(ma, p)
		else:
			p = 1
	else:
		p = 0
if ma == -1:
	print(1)
else:
	print(ma)


maximo = 0
n = int(input())
vec = list(map(int, input().split()))
for i in range(n):
	if vec[i] > maximo:
		maximo = vec[i]
suma = 1
cont = 0
for i in range(n):
	if vec[i] == maximo:
		cont = cont + 1
		if cont > suma:
			suma = cont
	else:
		cont = 0
print(suma)


n = int(input())
l = list(map(int, input().split()))
a = max(l)
c = 0
if l[0] == a:
	c = 1
f = c
for i in range(1, n):
	if l[i] == a:
		c += 1
	else:
		if c > f:
			f = c
		c = 0
if c > f:
	f = c
print(f)


n = int(input())
l = list(map(int, input().split()))
ans = 0
c = 0
i = 0
while i < len(l):
	curr = l[i]
	cnt = 0
	while i < len(l) and curr == l[i]:
		i += 1
		cnt += 1
	if curr > ans:
		ans = curr
		c = cnt
	if curr == ans and c < cnt:
		c = cnt
print(c)


n = int(input())
a = list(map(int, input().split()))
mx = max(a)
temp = 0
sol = 0
for i in range(n):
	if a[i] == mx:
		temp += 1
	else:
		temp = 0
	sol = max(sol, temp)
print(sol)


import collections, atexit, math, sys, bisect
sys.setrecursionlimit(1000000)

def getIntList():
	return list(map(int, input().split()))
isdebug = False
try:
	import numpy

	def dprint(*args, **kwargs):
		print(*args, file=sys.stderr)
	dprint('debug mode')
	isdebug = True
except Exception:

	def dprint(*args, **kwargs):
		pass
inId = 0
outId = 0
if not isdebug:
	inId = 0
	outId = 0
if inId > 0:
	dprint('use input', inId)
	try:
		f = open('input' + str(inId) + '.txt', 'r')
		sys.stdin = f
	except Exception:
		dprint('invalid input file')
if outId > 0:
	dprint('use output', outId)
	try:
		f = open('stdout' + str(outId) + '.txt', 'w')
		sys.stdout = f
	except Exception:
		dprint('invalid output file')
	atexit.register(lambda : sys.stdout.close())
(N,) = getIntList()
za = getIntList()
t = max(za)
l = 0
r = 0
for x in za:
	if x == t:
		l += 1
	else:
		l = 0
	r = max(r, l)
print(r)


n = int(input())
a = list(map(int, input().split()))

class Kek:

	def __init__(self, x):
		self.c = x
		self.kol = 1

	def __lt__(self, other):
		return self.c > other.c or (self.c == other.c and self.kol > other.kol)
l = [Kek(a[0])]
for i in range(1, n):
	if a[i] == a[i - 1]:
		l[len(l) - 1].kol += 1
	else:
		l.append(Kek(a[i]))
l.sort()
print(l[0].kol)


n = int(input())
a = list(map(int, input().split()))
bs = 0
sm = 0
ii = 0
(l, r) = (0, 0)
for i in range(n):
	if a[i] > (sm + a[i]) // (i - ii + 1):
		ii = i
		sm = a[i]
	else:
		sm += a[i]
	if bs == sm // (i - ii + 1) and r - l < i - ii:
		(l, r) = (ii, i)
	elif bs < sm // (i - ii + 1):
		bs = sm // (i - ii + 1)
		(l, r) = (ii, i)
print(r - l + 1)


n = int(input())
cl = list(map(int, input().split()))
mx = max(cl)
size = 0
count = 0
ind = cl.index(mx)
for i in range(ind, n):
	if cl[i] == mx:
		count += 1
	else:
		if count > size:
			size = count
		count = 0
if count != 0:
	if count > size:
		size = count
print(size)


n = int(input())
a = list(map(int, input().split()))
x = max(a)
c = 0
temp = []
for i in range(n):
	if a[i] == x and i != n - 1:
		c += 1
	elif i == n - 1 and a[i] == x:
		c += 1
		temp.append(c)
	else:
		temp.append(c)
		c = 0
print(max(temp))


n = int(input())
A = list(map(int, input().split()))
M = max(A)
ANS = 0
count = 0
for a in A:
	if a == M:
		count += 1
		if ANS < count:
			ANS = count
	else:
		count = 0
print(ANS)


def best_subsegent2(n, a):
	maxx = 0
	v = max(a)
	x = 1
	if n == 1:
		return 1
	for i in range(1, n):
		if a[i - 1] == v and a[i] == v:
			x += 1
		elif a[i] == v:
			x = 1
		maxx = max(x, maxx)
	return maxx
n = input()
a = input().strip().split()
a = list(map(int, a))
print(best_subsegent2(int(n), a))


n = int(input())
arr = [int(x) for x in input().split()]
max_val = max(arr)
max_len = 0
cur_len = 0
for a in arr:
	if a == max_val:
		cur_len += 1
		max_len = max(cur_len, max_len)
	else:
		cur_len = 0
print(max_len)


n = int(input())
a = list(map(int, input().split()))
p = max(a)
c = 0
maxi = 0
for i in range(n - 1):
	if a[i] == p and a[i] == a[i + 1]:
		c += 1
		if c > maxi:
			maxi = c
	else:
		c = 0
print(maxi + 1)


n = int(input())
l1 = list(map(int, input().split()))
a = max(l1)
t = 0
x = 0
for i in range(n):
	if l1[i] == a:
		x = x + 1
		t = max(t, x)
	else:
		x = 0
print(t)


n = int(input())
arr = list(map(int, input().split()))
max_ele = max(arr)
index = 0
result = -1
while index < n:
	count = 0
	while index < n and arr[index] == max_ele:
		count += 1
		index += 1
	else:
		index += 1
	result = max(result, count)
print(result)


n = int(input())
numbers = list(map(int, input().split()))
maximum = max(numbers)
(c, r) = (0, 0)
for i in numbers:
	if i == maximum:
		c += 1
	else:
		c = 0
	r = max(c, r)
print(r)


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n,) = I()
l = I()
m = max(l)
i = 0
ans = 1
while i < n:
	if l[i] == m:
		j = i
		i += 1
		while i < n and l[i] == m:
			i += 1
		ans = max(ans, i - j)
	else:
		i += 1
print(ans)


def read_input():
	n = int(input())
	s2 = input()
	a = [int(i) for i in s2.split()]
	return (n, a)

def problem_a(n, a):
	largest = max(a)
	i = 0
	max_streak = 0
	while i < n:
		if a[i] == largest:
			count = 0
			while i < n and a[i] == largest:
				count += 1
				i += 1
			if count > max_streak:
				max_streak = count
			i -= 1
		i += 1
	print(max_streak)
(n, a) = read_input()
problem_a(n, a)


n = int(input())
a = [int(i) for i in input().split()]
m = max(a)
b = [1]
f = 0
for i in range(n):
	if m == a[i]:
		f += 1
	else:
		b.append(f)
		f = 0
b.append(f)
print(max(b))


n = int(input())
ls = list(map(int, input().split()))
mx = max(ls)
ans = 1
i = 0
while i < n:
	if ls[i] == mx:
		count = 0
		j = i
		while j < n:
			if ls[j] == mx:
				count += 1
			else:
				break
			j += 1
		if ans < count:
			ans = count
		i = j
	else:
		i += 1
print(ans)


n = int(input())
arr = input().split()
big = -1
count = 0
current = -1
freq = 1
for x in range(n):
	arr[x] = int(arr[x])
	if arr[x] == current:
		freq += 1
	else:
		if current > big:
			big = current
			count = freq
		elif current == big and freq > count:
			count = freq
		current = arr[x]
		freq = 1
if current > big:
	big = current
	count = freq
elif current == big and freq > count:
	count = freq
	current = arr[x]
	freq = 1
print(count)


def main():
	n = int(input())
	ar = list(map(int, input().split(' ')))
	maximum = max(ar)
	maxCount = 1
	continous = 0
	count = 0
	for i in range(len(ar)):
		if ar[i] == maximum and continous == 0:
			count += 1
			continous = 1
		elif ar[i] == maximum and continous == 1:
			count += 1
			if count > maxCount:
				maxCount = count
		else:
			count = 0
			continous = 0
	print(maxCount)
main()


n = int(input())
a = input().split()
a = [int(i) for i in a]
m = max(a)
ans = 1
t = 1
for i in range(1, n):
	if a[i] == a[i - 1] == m:
		t += 1
	else:
		ans = max(ans, t)
		t = 1
ans = max(ans, t)
print(ans)


input()
a = [*map(int, input().split())]
m = max(a)
l = len(max(''.join(['.' if x == m else ' ' for x in a]).split(), key=len))
print(l)


n = int(input())
array = list(map(int, input().split()))
max_list = max(array)
(c, ans) = (0, 0)
for i in array:
	if i == max_list:
		c += 1
	else:
		c = 0
	ans = max(c, ans)
print(ans)


import sys
import math
import bisect

def main():
	n = int(input())
	A = list(map(int, input().split()))
	max_val = max(A)
	cnt = 0
	max_cnt = 0
	for i in range(n):
		if A[i] == max_val:
			cnt += 1
		else:
			cnt = 0
		max_cnt = max(max_cnt, cnt)
	print(max_cnt)
main()


n = input()
nums = list(map(int, input().split()))
sorted_nums = sorted(nums, reverse=True)
max_num = sorted_nums[0]
(max_len, current_max_len) = (0, 0)
for i in nums:
	if i == max_num:
		current_max_len += 1
		if current_max_len >= max_len:
			max_len = current_max_len
	else:
		current_max_len = 0
print(max_len)


input()
ar = [int(x) for x in input().split()]
maxnum = max(ar)
l = 0
maxl = 0
for n in ar:
	if n == maxnum:
		l += 1
		if l > maxl:
			maxl = l
	else:
		l = 0
print(maxl)


n = int(input())
al = [i for i in map(int, input().split())]
m = max(al)
a = b = 0
for i in al:
	if i < m:
		a = 0
	else:
		a += 1
		b = max(a, b)
print(b)


n = int(input())
a = [int(i) for i in input().split()]
c = max(a)
e = 0
l = []
for i in range(0, len(a)):
	if a[i] == c:
		e = e + 1
	else:
		l.append(e)
		e = 0
l.append(e)
print(max(l))


n = int(input())
a = list(map(int, input().split()))
q = max(a)
tmp = 0
num = 0
for i in range(n):
	if a[i] == q:
		tmp += 1
	else:
		num = max(num, tmp)
		tmp = 0
num = max(num, tmp)
print(num)


from collections import defaultdict as dd
import math

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))
n = nn()
l = lm()
m = 0
for i in l:
	m = max(i, m)
ml = 0
cl = 0
for i in l:
	if i == m:
		cl += 1
		ml = max(ml, cl)
	else:
		cl = 0
print(ml)


n = int(input())
l = input().split()
li = [int(i) for i in l]
a = max(li)
count = 0
maxa = 0
for i in range(n):
	if li[i] == a:
		count += 1
	else:
		if count > maxa:
			maxa = count
		count = 0
print(max(maxa, count))


def inpl():
	return list(map(int, input().split()))
N = int(input())
A = inpl() + [-1]
x = max(A)
ctr = 0
ans = 0
for a in A:
	if a == x:
		ctr += 1
	else:
		ans = max(ans, ctr)
		ctr = 0
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
m = max(a)
temp = 0
count = 0
for item in a:
	if item == m:
		temp += 1
	elif temp > count:
		count = temp
		temp = 0
	else:
		temp = 0
if temp > count:
	count = temp
print(count)


n = int(input())
lis = [int(a) for a in input().split()]
m = max(lis)
rang = 0
maxRange = 0
for i in range(n):
	if lis[i] == m:
		rang += 1
	else:
		rang = 0
	if maxRange < rang:
		maxRange = rang
print(maxRange)


ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
n = ii()
a = li()
m = max(a)
i = 0
ans = 1
while i < n:
	j = i + 1
	while j < n and a[i] == a[j]:
		j += 1
	if a[i] == m:
		ans = max(ans, j - i)
	i = j
print(ans)


n = int(input())
a = list(map(int, input().split()))
kmax = 1
k = 1
maxvalue = a[0]
for i in range(1, n):
	if a[i] > maxvalue:
		kmax = 1
		k = 1
		maxvalue = a[i]
	elif a[i] == a[i - 1] and a[i] == maxvalue:
		k += 1
	else:
		kmax = max(k, kmax)
		k = 1
kmax = max(k, kmax)
print(kmax)


n = int(input())
a = list(map(int, input().split()))
max_a = max(a)
counter = 0
max_counter = 0
for a_i in a:
	if a_i == max_a:
		counter += 1
	else:
		counter = 0
	if max_counter < counter:
		max_counter = counter
print(max_counter)


import sys
lines = []
for line in sys.stdin:
	lines.append(line)
income = lines[1]
income = [int(i) for i in income.split()]
max_value = -1
max_length = 0
current_length = 0
for i in income:
	if i > max_value:
		max_value = i
		current_length = 1
		max_length = current_length
	elif i == max_value:
		current_length = current_length + 1
		if max_length < current_length:
			max_length = current_length
	else:
		current_length = 0
print(max_length)


n = int(input())
a = [int(i) for i in input().split()]
v = max(a)
c = 0
max1 = 0
for i in range(n):
	if a[i] == v:
		c = c + 1
		max1 = max(max1, c)
	else:
		c = 0
print(max1)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
a.append(-1)
i = 0
mm = 0
while i < n:
	if a[i] == m:
		j = i
		while a[i] == m:
			i += 1
		if i - j > mm:
			mm = i - j
	i += 1
print(mm)


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
x = max(a)
cnt = 0
ans = 1
for i in range(n):
	if a[i] == x:
		cnt += 1
	else:
		ans = max(ans, cnt)
		cnt = 0
ans = max(ans, cnt)
print(ans)


n = int(input())
tab = []
x = map(int, input().split())
tab.extend(x)
mx = 0
for x in tab:
	if x >= mx:
		mx = x
res = 0
cnt = 0
for x in tab:
	if x == mx:
		cnt += 1
	else:
		res = max(res, cnt)
		cnt = 0
print(max(res, cnt))


n = int(input())
a = list(map(int, input().split()))
ans = 0
ln = 1
for i in range(len(a)):
	ans = max(ans, a[i])
(lo, hi) = (0, 0)
while hi < n:
	if a[hi] == ans:
		hi += 1
	else:
		ln = max(ln, hi - lo)
		hi += 1
		lo = hi
ln = max(ln, hi - lo)
print(ln)


n = int(input())
a = list(map(int, input().split()))
mx = max(a)
cnt = -1
mx_count = 0
for i in range(n):
	if cnt == -1 and a[i] == mx:
		cnt = 1
	elif cnt != -1 and a[i] == mx:
		cnt += 1
	elif cnt != -1 and a[i] != mx:
		if cnt > mx_count:
			mx_count = cnt
		cnt = -1
if cnt > mx_count:
	mx_count = cnt
print(mx_count)


n = int(input())
a = [int(s) for s in input().split()]
c = 1
k = 0
z = max(a)
for i in range(a.index(z), n - 1):
	if a[i] == a[i + 1] == z:
		c += 1
	if a[i] != a[i + 1]:
		if c > k:
			k = c
		c = 1
print(max(c, k))


n = int(input())
an = [int(a) for a in input().split()]
max = 0
out = 0
prnt = 0
for i in range(n):
	if max < an[i]:
		max = an[i]
for u in an:
	if u == max:
		out += 1
		if out > prnt:
			prnt = out
	else:
		out = 0
print(prnt)


import sys
from math import gcd

def unique(lst):
	return dict(((o, o) for o in lst)).values()

class Main:

	def __init__(self):
		self.buff = None
		self.index = 0

	def next(self):
		if self.buff is None or self.index == len(self.buff):
			self.buff = self.next_line()
			self.index = 0
		val = self.buff[self.index]
		self.index += 1
		return val

	def next_line(self, _map=str):
		return list(map(_map, sys.stdin.readline().split()))

	def next_int(self):
		return int(self.next())

	def solve(self):
		n = self.next_int()
		x = [self.next_int() for _ in range(0, n)]
		m = max(x)
		ans = 1
		i = 0
		while i < n:
			j = i
			while j < n and x[j] == x[i]:
				j += 1
			if x[i] == m:
				ans = max(ans, j - i)
			i = j
		print(ans)
Main().solve()


list_int_input = lambda inp: list(map(int, inp.split()))
int_input = lambda inp: int(inp)
string_to_list_input = lambda inp: list(inp)
n = int(input())
a = list_int_input(input())
maxx = max(a)
lenn = 1
i = 0
while i < n:
	while i < n and a[i] != maxx:
		i += 1
	j = i + 1
	while i < n and j < n and (a[i] == a[j]):
		j += 1
	lenn = max(lenn, j - i)
	i = j
print(lenn)


_ = input()
arr = list(map(int, input().strip().split()))
ma = max(arr)
s = 0
m = 0
for elem in arr:
	if elem == ma:
		s += 1
	else:
		m = max(s, m)
		s = 0
m = max(s, m)
print(m)


n = int(input())
a = [int(i) for i in input().split()]
m = max(a)
(leng, maxl) = (0, -1)
for i in range(len(a)):
	if a[i] == m:
		leng += 1
	else:
		if maxl < leng:
			maxl = leng
			ind = i
		leng = 0
print(max(maxl, leng))


n = int(input())
a = input().split()
maxn = -1
len = 0
for i in range(n):
	a[i] = int(a[i])
	maxn = max(a[i], maxn)
now = 0
for i in range(n):
	if a[i] == maxn:
		now += 1
	else:
		len = max(now, len)
		now = 0
len = max(now, len)
print(len)


n = int(input())
a = list(map(int, input().split()))
max_n = max(a)
prev = False
max_d = 1
d = 0
for i in range(n):
	if a[i] == max_n:
		d += 1
	else:
		prev = False
		if d > max_d:
			max_d = d
		d = 0
if d > max_d:
	max_d = d
print(max_d)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
ls = 0
mx = 0
for (i, e) in enumerate(a):
	if a[ls] != e:
		ls = i
	if e == m:
		mx = max(mx, i - ls + 1)
print(mx)


(n, m, c, v) = (int(input()), -1, 0, 0)
for ai in map(int, input().split()):
	if ai > m:
		(m, c, v) = (ai, 1, 1)
	elif ai == m:
		c += 1
		if c > v:
			v = c
	else:
		c = 0
print(v)


n = int(input())
A = list(map(int, input().split()))
z = max(A)
cnt = 0
hop = 0
for i in A:
	hop = max(hop, cnt)
	if i == z:
		cnt += 1
	else:
		cnt = 0
hop = max(hop, cnt)
print(hop)


m = int(input())
a = [0] * m
a = list(map(int, input().split()))
max = a[0]
for i in range(m):
	if max < a[i]:
		max = a[i]
l = 0
f = 0
smax = 0
for i in range(m):
	if max == a[i]:
		l += 1
		f = 1
	else:
		l = 0
	if l > smax:
		smax = l
print(smax)


input()
a = [int(x) for x in input().split()]
m = max(a)
globmaxrange = 0
locmax = 0
for i in a:
	if i == m:
		locmax += 1
	else:
		locmax = 0
	globmaxrange = max(globmaxrange, locmax)
print(globmaxrange)


def volume(word):
	return sum((str.isupper(c) for c in word))
n = input()
arr = list(map(int, input().split()))
mm = max(arr)
ss = 0
max_ss = 1
is_m = False
for i in arr:
	if not is_m:
		if i == mm:
			is_m = True
			ss = 1
		else:
			ss = 0
	elif i == mm:
		ss += 1
		if ss > max_ss:
			max_ss = ss
	else:
		is_m = False
		ss = 0
print(max_ss)


n = int(input())
vls = list(map(int, input().split()))
(cnt, best, m) = (0, 1, max(vls))
for i in vls:
	if i == m:
		cnt += 1
	elif i < m:
		cnt = 0
	best = max(best, cnt)
print(best)


n = int(input())
l = list(map(int, input().split()))
m = max(l)
count = 0
mcount = 0
i = 0
while i < n:
	while i < n and m == l[i]:
		count = count + 1
		i += 1
	mcount = max(mcount, count)
	count = 0
	i += 1
print(mcount)


n = int(input())
a = list(map(int, input().split()))
f = 1
fmax = 0
max = -1
for i in a:
	if i == max:
		f += 1
	elif i > max:
		fmax = 1
		f = 1
		max = i
	else:
		if f > fmax:
			fmax = f
		f = 0
if fmax < f:
	fmax = f
print(fmax)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
i = 0
ans = 0
while True:
	j = 0
	while a[i] == m:
		i += 1
		j += 1
		if i == n:
			break
	ans = max(j, ans)
	i += 1
	if i >= n:
		break
print(ans)


n = int(input())
a = list(map(int, input().split()))
k = max(a)
c = 1
i = 0
while i < n:
	if a[i] == k:
		p = 0
		while True:
			if i < n:
				if a[i] == k:
					p += 1
				else:
					break
				i += 1
			else:
				break
		if c < p:
			c = p
		i += 1
	else:
		i += 1
print(c)


n = int(input())
a = list(map(int, input().split()))
x = max(a)
count = 0
m = 0
for i in range(n):
	if a[i] == x:
		count += 1
	elif count > m:
		m = count
		count = 0
	else:
		count = 0
if count > m:
	m = count
print(m)


def getIntList(lst):
	assert type(lst) is list
	rep = []
	for i in lst:
		rep.append(int(i))
	return rep
n = int(input())
lst = getIntList(input().split(' '))
long = 0
maxans = max(lst)
ans = 1
for i in lst:
	if i == maxans:
		long += 1
		ans = max(long, ans)
	else:
		long = 0
print(ans)


n = int(input())
a = list(map(int, input().split()))
x = max(a)
ans = 1
k = 0
for c in a:
	if c == x:
		k += 1
	else:
		if k > ans:
			ans = k
		k = 0
if k > ans:
	ans = k
print(ans)


def main():
	n = int(input())
	nums = list(map(int, input().split()))
	m = max(nums)
	indices = []
	for i in range(n):
		if nums[i] == m:
			indices.append(i)
	count = 1
	max_count = 1
	for i in range(len(indices) - 1):
		if indices[i + 1] - indices[i] == 1:
			count += 1
		else:
			if count > max_count:
				max_count = count
			count = 1
	if count > max_count:
		max_count = count
	print(max_count)
main()


n = int(input())
a = list(map(int, input().split()))
m = a[0]
for i in a:
	if i > m:
		m = i
q = 0
t = 0
a += [-1]
for w in a:
	if w == m:
		q += 1
	else:
		if q > t:
			t = q
		q = 0
print(t)


n = int(input())
arr = list(map(int, input().split()))
x = max(arr)
now = 0
ans = 1
for i in range(n):
	if arr[i] == x:
		now += 1
	else:
		now = 0
	if now > ans:
		ans = now
print(ans)