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

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



remain_max = [a[-1]]*n

for i in range(1, n):

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



diffs1 = [0]*n

for i in range(n):

    diffs1[i] = remain_max[i] - a[i]



max_diff1 = 0

ans1 = 0

for i in range(n):

    if diffs1[i] > max_diff1:

        max_diff1 = diffs1[i]

        ans1 = 1

    elif diffs1[i] == max_diff1:

        ans1 += 1

# print(diffs1, ans1)



remain_min = [a[0]]*n

for i in range(1, n):

    remain_min[i] = min(a[i-1], remain_min[i-1])



diffs2 = [0]*n

for i in range(n):

    diffs2[i] = a[i] - remain_min[i]



max_diff2 = 0

ans2 = 0

for i in range(n):

    if diffs2[i] > max_diff2:

        max_diff2 = diffs2[i]

        ans2 = 1

    elif diffs2[i] == max_diff2:

        ans2 += 1

# print(diffs2, ans2)



print((min(ans1, ans2)))

        

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

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



remain_max = [a[-1]]*n

for i in range(1, n):

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



diffs = [0]*n

for i in range(n):

    diffs[i] = remain_max[i] - a[i]



max_diff = 0

ans = 0

for i in range(n):

    if diffs[i] > max_diff:

        max_diff = diffs[i]

        ans = 1

    elif diffs[i] == max_diff:

        ans += 1



print(ans)
n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
remain_max = [a[-1]] * n
for i in range(1, n):
    remain_max[-(i + 1)] = max(a[-i], remain_max[-i])
diffs1 = [0] * n
for i in range(n):
    diffs1[i] = remain_max[i] - a[i]
max_diff1 = 0
ans1 = 0
for i in range(n):
    if diffs1[i] > max_diff1:
        max_diff1 = diffs1[i]
        ans1 = 1
    elif diffs1[i] == max_diff1:
        ans1 += 1
# print(diffs1, ans1)
remain_min = [a[0]] * n
for i in range(1, n):
    remain_min[i] = min(a[i - 1], remain_min[i - 1])
diffs2 = [0] * n
for i in range(n):
    diffs2[i] = a[i] - remain_min[i]
max_diff2 = 0
ans2 = 0
for i in range(n):
    if diffs2[i] > max_diff2:
        max_diff2 = diffs2[i]
        ans2 = 1
    elif diffs2[i] == max_diff2:
        ans2 += 1
# print(diffs2, ans2)
print((min(ans1, ans2)))

n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
remain_max = [a[-1]] * n
for i in range(1, n):
    remain_max[-(i + 1)] = max(a[-i], remain_max[-i])
diffs = [0] * n
for i in range(n):
    diffs[i] = remain_max[i] - a[i]
max_diff = 0
ans = 0
for i in range(n):
    if diffs[i] > max_diff:
        max_diff = diffs[i]
        ans = 1
    elif diffs[i] == max_diff:
        ans += 1
print(ans)

-diffs1 = [0] * n +diffs = [0] * n -    diffs1[i] = remain_max[i] - a[i] -max_diff1 = 0 -ans1 = 0 +    diffs[i] = remain_max[i] - a[i] +max_diff = 0 +ans = 0 -    if diffs1[i] > max_diff1: -        max_diff1 = diffs1[i] -        ans1 = 1 -    elif diffs1[i] == max_diff1: -        ans1 += 1 -# print(diffs1, ans1) -remain_min = [a[0]] * n -for i in range(1, n): -    remain_min[i] = min(a[i - 1], remain_min[i - 1]) -diffs2 = [0] * n -for i in range(n): -    diffs2[i] = a[i] - remain_min[i] -max_diff2 = 0 -ans2 = 0 -for i in range(n): -    if diffs2[i] > max_diff2: -        max_diff2 = diffs2[i] -        ans2 = 1 -    elif diffs2[i] == max_diff2: -        ans2 += 1 -# print(diffs2, ans2) -print((min(ans1, ans2))) +    if diffs[i] > max_diff: +        max_diff = diffs[i] +        ans = 1 +    elif diffs[i] == max_diff: +        ans += 1 +print(ans)