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

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



cummax = [A[-1]]

for a in reversed(A[:-1]):

    cummax.append(max(cummax[-1], a))

cummax.reverse()



maxgain = n = 0

for buy,sell in zip(A,cummax):

    gain = sell - buy

    if gain > maxgain:

        maxgain = gain

        n = 1

    elif gain == maxgain:

        n += 1

print(n)

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

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



cnt = max_profit = 0

INF = float('inf')

min_cost = INF

for a in A:

    profit = a - min_cost

    if profit == max_profit:

        cnt += 1

    elif profit > max_profit:

        cnt = 1

        max_profit = profit

    min_cost = min(min_cost, a)



print(cnt)
N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
cummax = [A[-1]]
for a in reversed(A[:-1]):
    cummax.append(max(cummax[-1], a))
cummax.reverse()
maxgain = n = 0
for buy, sell in zip(A, cummax):
    gain = sell - buy
    if gain > maxgain:
        maxgain = gain
        n = 1
    elif gain == maxgain:
        n += 1
print(n)

N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
cnt = max_profit = 0
INF = float("inf")
min_cost = INF
for a in A:
    profit = a - min_cost
    if profit == max_profit:
        cnt += 1
    elif profit > max_profit:
        cnt = 1
        max_profit = profit
    min_cost = min(min_cost, a)
print(cnt)

-cummax = [A[-1]] -for a in reversed(A[:-1]): -    cummax.append(max(cummax[-1], a)) -cummax.reverse() -maxgain = n = 0 -for buy, sell in zip(A, cummax): -    gain = sell - buy -    if gain > maxgain: -        maxgain = gain -        n = 1 -    elif gain == maxgain: -        n += 1 -print(n) +cnt = max_profit = 0 +INF = float("inf") +min_cost = INF +for a in A: +    profit = a - min_cost +    if profit == max_profit: +        cnt += 1 +    elif profit > max_profit: +        cnt = 1 +        max_profit = profit +    min_cost = min(min_cost, a) +print(cnt)