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, _ = list(map(int, input().split()))

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



mi = 10**18

mx = -10**18

ans = 0

for a in A:

    if mx < a - mi:

        ans = 0

        mx = a - mi

    if mx == a - mi:

        ans += 1

    mi = min(mi, a)



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, _ = list(map(int, input().split()))
A = list(map(int, input().split()))
mi = 10**18
mx = -(10**18)
ans = 0
for a in A:
    if mx < a - mi:
        ans = 0
        mx = a - mi
    if mx == a - mi:
        ans += 1
    mi = min(mi, a)
print(ans)

-N, T = list(map(int, input().split())) +N, _ = 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 +mi = 10**18 +mx = -(10**18) -for i, a in enumerate(A): -    d = mx[i + 1] - a -    if mxD < d: -        mxD = d +for a in A: +    if mx < a - mi: -    if mxD == d: +        mx = a - mi +    if mx == a - mi: +    mi = min(mi, a)