N, T = list(map(int, input().split()))

A = list(map(int, input().split()))



mi = 10**18

miCnt = 1

S = []

for i, a in enumerate(A):

    S.append((a - mi, i, miCnt))

    if a == mi:

        miCnt += 1

    mi = min(mi, a)



S.sort(reverse=True)

S = [c for v, i, c in S if v == S[0][0]]

ans = min(len(S), sum(S))

print(ans)

N, T = list(map(int, input().split()))

A = list(map(int, input().split()))



mx = [0] * (N + 1)

for i, a in enumerate(A[::-1], start=1):

    mx[-i] = max(mx[-i + 1], a)



mxD = 0

ans = 0

for i, a in enumerate(A):

    d = mx[i + 1] - a

    if mxD < d:

        mxD = d

        ans = 0

    if mxD == d:

        ans += 1



print(ans)

N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
mi = 10**18
miCnt = 1
S = []
for i, a in enumerate(A):
    S.append((a - mi, i, miCnt))
    if a == mi:
        miCnt += 1
    mi = min(mi, a)
S.sort(reverse=True)
S = [c for v, i, c in S if v == S[0][0]]
ans = min(len(S), sum(S))
print(ans)

N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
mx = [0] * (N + 1)
for i, a in enumerate(A[::-1], start=1):
    mx[-i] = max(mx[-i + 1], a)
mxD = 0
ans = 0
for i, a in enumerate(A):
    d = mx[i + 1] - a
    if mxD < d:
        mxD = d
        ans = 0
    if mxD == d:
        ans += 1
print(ans)

-mi = 10**18 -miCnt = 1 -S = [] +mx = [0] * (N + 1) +for i, a in enumerate(A[::-1], start=1): +    mx[-i] = max(mx[-i + 1], a) +mxD = 0 +ans = 0 -    S.append((a - mi, i, miCnt)) -    if a == mi: -        miCnt += 1 -    mi = min(mi, a) -S.sort(reverse=True) -S = [c for v, i, c in S if v == S[0][0]] -ans = min(len(S), sum(S)) +    d = mx[i + 1] - a +    if mxD < d: +        mxD = d +        ans = 0 +    if mxD == d: +        ans += 1