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

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

minv = src[0]

maxp = ans = 0

for i in range(1,N):

    profit = src[i] - minv

    if profit == maxp:

        ans += 1

    elif profit > maxp:

        maxp = profit

        ans = 1

    minv = min(minv, src[i])



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

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



mincost = src[0]

maxgain = 0

sell = 0

buy = 1

for a in src[1:]:

    if a < mincost:

        mincost = a

        buy = 1

    elif a == mincost:

        buy += 1

    elif a > mincost + maxgain:

        maxgain = a - mincost

        sell = 1

    elif a == mincost + maxgain:

        sell += 1



print((max(sell,buy)))

N, T = list(map(int, input().split()))
src = list(map(int, input().split()))
minv = src[0]
maxp = ans = 0
for i in range(1, N):
    profit = src[i] - minv
    if profit == maxp:
        ans += 1
    elif profit > maxp:
        maxp = profit
        ans = 1
    minv = min(minv, src[i])
print(ans)

N, T = list(map(int, input().split()))
src = list(map(int, input().split()))
mincost = src[0]
maxgain = 0
sell = 0
buy = 1
for a in src[1:]:
    if a < mincost:
        mincost = a
        buy = 1
    elif a == mincost:
        buy += 1
    elif a > mincost + maxgain:
        maxgain = a - mincost
        sell = 1
    elif a == mincost + maxgain:
        sell += 1
print((max(sell, buy)))

-minv = src[0] -maxp = ans = 0 -for i in range(1, N): -    profit = src[i] - minv -    if profit == maxp: -        ans += 1 -    elif profit > maxp: -        maxp = profit -        ans = 1 -    minv = min(minv, src[i]) -print(ans) +mincost = src[0] +maxgain = 0 +sell = 0 +buy = 1 +for a in src[1:]: +    if a < mincost: +        mincost = a +        buy = 1 +    elif a == mincost: +        buy += 1 +    elif a > mincost + maxgain: +        maxgain = a - mincost +        sell = 1 +    elif a == mincost + maxgain: +        sell += 1 +print((max(sell, buy)))