Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###


from collections import deque
def resolve():
    drc4 = [(-1, 0), (0, 1), (1, 0), (0, -1)]
    warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if (i, j) not in [(0, 0)] + drc4]

    def bfs(start, goal):
        sy, sx = start
        gy, gx = goal
        q = deque()
        q.append(start)
        ans[sy][sx] = 0

        while q:
            sy, sx = q.popleft()
            # if sy == gy and sx == gx:
            #     return print(ans[gy][gx])
            for dy, dx in drc4:
                ny, nx = dy + sy, dx + sx
                # if G[ny][nx] == "@" or ans[ny][nx] != INF:
                #     if G[ny][nx] != "#":
                #         continue
                if G[ny][nx] == "." and ans[ny][nx] > ans[sy][sx]:
                    ans[ny][nx] = ans[sy][sx]
                    q.append((ny, nx))

            for dy8, dx8 in warp:
                ny8, nx8 = dy8 + sy, dx8 + sx
                if 1 <= ny8 <= H + 1 and 1 <= nx8 <= W + 1:
                    # if G[ny8][nx8] == "#":
                    #     continue
                    # if G[ny8][nx8] == "@" or ans[ny8][nx8] != INF:
                    #     continue
                    if G[ny8][nx8] == "." and ans[ny8][nx8] > ans[sy][sx] + 1:
                        ans[ny8][nx8] = ans[sy][sx] + 1
                        q.append((ny8, nx8))
        # return print(-1)

    H, W = map(int, input().split())
    sy, sx = map(int, input().split())
    gy, gx = map(int, input().split())
    G = []
    G.append(["@"] * (W + 2))
    G += [["@"] + list(input()) + ["@"] for _ in range(H)]
    G.append(["@"] * (W + 2))

    INF = 10 ** 7
    ans = [[INF] * (W + 2) for _ in range(H + 2)]

    bfs((sy, sx), (gy, gx))

    print(ans[gy][gx] if ans[gy][gx] < INF else '-1')


if __name__ == "__main__":
    resolve()

### FIXED CODE ###


from collections import deque
def resolve():
    H, W = map(int, input().split())
    Ch, Cw = map(lambda x: int(x) - 1, input().split())
    Dh, Dw = map(lambda x: int(x) - 1, input().split())
    maze = [input() for _ in range(H)]

    INF = 10 ** 12
    path = [[INF] * W for _ in range(H)]

    q = deque()
    path[Ch][Cw] = 0
    q.append((Ch, Cw, 0))

    walk = [(0, 1), (0, -1), (-1, 0), (1, 0)]
    warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if (i, j) not in [(0, 0)] + walk]

    while q:
        x, y, s = q.popleft()
        for dx, dy in walk:
            nx = x + dx
            ny = y + dy
            if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s:
                path[nx][ny] = s
                q.appendleft((nx, ny, s))
        for dx, dy in warp:
            nx = x + dx
            ny = y + dy
            if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s + 1:
                path[nx][ny] = s + 1
                q.append((nx, ny, s + 1))

    ans = path[Dh][Dw] if path[Dh][Dw] < INF else -1
    print(ans)


if __name__ == "__main__":
    resolve()
### BUGGY CODE ###

# -*- coding: utf-8 -*-
from sys import stdin
# import numpy as np
# import sys
# sys.setrecursionlimit(10**4)

def _li(): return list(map(int, stdin.readline().split()))
def _li_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def _lf(): return list(map(float, stdin.readline().split()))
def _ls(): return stdin.readline().split()
def _i(): return int(stdin.readline())
def _f(): return float(stdin.readline())
def _s(): return stdin.readline()[:-1]


MOD = 10**9 + 7
L = _s()
ans = 3**(len(L) - 1)
# for i in range(1, len(L)):
#     ans = (ans + 2**(2*i-1)) % MOD

sumL = L.count('1')
ans = (ans + 2**(sumL)) % MOD
count = 0
for i, j in enumerate(L[::-1][:-1]):
    if j == '1':
        count += 1
        ans = (ans + 2 * (2**(sumL-count-1)) % MOD * (3**i) % MOD) % MOD

print(int(ans))


### FIXED CODE ###

# -*- coding: utf-8 -*-
from sys import stdin
# import numpy as np
# import sys
# sys.setrecursionlimit(10**4)

def _li(): return list(map(int, stdin.readline().split()))
def _li_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def _lf(): return list(map(float, stdin.readline().split()))
def _ls(): return stdin.readline().split()
def _i(): return int(stdin.readline())
def _f(): return float(stdin.readline())
def _s(): return stdin.readline()[:-1]


MOD = 10**9 + 7
L = _s()

ans = 3**(len(L) - 1) % MOD
# for i in range(1, len(L)):
#     ans = (ans + 2**(2*i-1)) % MOD

sumL = L.count('1')
ans = (ans + 2**(sumL) % MOD) % MOD

count = 0
for i in range(len(L)-1):
    if L[-1-i] == '1':
        count += 1
        ans = (ans + 2 * pow(2, sumL-count-1, MOD) * pow(3, i, MOD)) % MOD

print(int(ans))
### BUGGY CODE ###

n = int(input())
a = [int(input()) for i in range(n)]

x = 1
y = []

while x not in y and x != 2:
    y.append(x)
    x = a[x-1]

if x == 2:
    print(len(y))
else:
    print(-1)


### FIXED CODE ###

n = int(input())
a = [int(input()) for i in range(n)]

x = 1
i = 0

while i < 100000 and x != 2:
    x = a[x-1]
    i += 1

if x == 2:
    print(i)
else:
    print(-1)
### BUGGY CODE ###

import numpy as np
import sys
import math

S = input()
SS = int(S)
mod = 1000000000 + 7

mm = [0] * (2019)
mm[0] = 1
T = 0
ten = 1
for i in range(len(S)):
    if i > 0:
        ten = ten * 10
    s = SS % 10
    SS = SS // 10
    T = T + ( s * (ten) )
    mm[T % 2019 ] += 1

ans = 0

for m in mm:
    ans += int( (m * (m-1) ) / 2 )

print(ans)

### FIXED CODE ###

import numpy as np
import sys
import math

S = input()

mm = [0] * (2019)
mm[0] = 1
a = [0] * (len(S) + 1 ) 
T = 0
ten = 1
ll = len(S)
for i in range(ll):
    if i > 0:
        ten = ( ten * 10 ) % 2019
    a[i+1] =  ( a[i] + (int(S[ll-1-i])*ten ) ) % 2019
    mm[ a[i+1] ] += 1
    #print(s)

ans = 0

for m in mm:
    ans += int( (m * (m-1) ) / 2 )

print(ans)
### BUGGY CODE ###

n = int(input())
a = [int(item) for item in input().split()]
a_sorted = sorted(a)

def can_be_midofmid(b):
    high_low_cum = [0] * (n + 1)
    for i, item in enumerate(a):
        if item >= b:
            high_low_cum[i+1] = 1
        else:
            high_low_cum[i+1] = -1
    for i in range(n):
        high_low_cum[i+1] += high_low_cum[i]
    bit_n = 1 << n.bit_length()
    bit = [0] * (bit_n+1)

    def bit_add(x, w):
        while x <= bit_n:
            bit[x] += w
            x += x & -x

    def bit_sum(x):
        ret = 0
        while x > 0:
            ret += bit[x]
            x -= x & -x
        return ret

    val = 0
    dic = dict(zip(sorted(high_low_cum), [item for item in range(len(high_low_cum))]))
    for i, item in enumerate(high_low_cum):
        val += bit_sum(dic[item] + 1)
        bit_add(dic[item] + 1, 1)
    return val  >= ((n+1) * n + 2)// 4  

l = -1; r = n
while r - l > 1:
    mid = (r + l) // 2
    if can_be_midofmid(a_sorted[mid]):
        l = mid
    else:
        r = mid
print(a_sorted[r-1])

### FIXED CODE ###

n = int(input())
a = [int(item) for item in input().split()]
a_sorted = sorted(a)

def can_be_midofmid(b):
    high_low_cum = [0] * (n + 1)
    for i, item in enumerate(a):
        if item >= b:
            high_low_cum[i+1] = 1
        else:
            high_low_cum[i+1] = -1
    for i in range(n):
        high_low_cum[i+1] += high_low_cum[i]
    bit_n = 1 << n.bit_length()
    bit = [0] * (bit_n+1)

    def bit_add(x, w):
        while x <= bit_n:
            bit[x] += w
            x += x & -x

    def bit_sum(x):
        ret = 0
        while x > 0:
            ret += bit[x]
            x -= x & -x
        return ret

    val = 0
    dic = dict(zip(sorted(high_low_cum), [item for item in range(len(high_low_cum))]))
    for i, item in enumerate(high_low_cum):
        val += bit_sum(dic[item] + 1)
        bit_add(dic[item] + 1, 1)
    return val  >= ((n+1) * n + 2)// 4  

l = -1; r = n
while r - l > 1:
    mid = (r + l) // 2
    if can_be_midofmid(a_sorted[mid]):
        l = mid
    else:
        r = mid
print(a_sorted[r-1])
### BUGGY CODE ###

n, k = map(int, input().split())

a = []
while True:
    n = abs(n - k)
    a.append(n)
    if n <= k // 2:
        break
    
print(min(a))


### FIXED CODE ###

n, k = map(int, input().split())
s = n % k
s2 = k - s
print(min(s, s2))
### BUGGY CODE ###

import itertools

def count_num(array):
    array = array.replace('r',' ')
    lst = array.split()
    return len(lst)

n,k = map(int,input().split()) 

ans_lst = []
text = 'r'*(n-k)+'b'*k
seq = list(text)
al = list(set(itertools.permutations(seq)))
for x in al:
    array = ''.join(x)
    num = count_num(array)
    ans_lst.append(num)

for i in range(1,k+1):
    print((ans_lst.count(i))%(10**9+7))

### FIXED CODE ###

from math import factorial

n,k = map(int,input().split())
mod = 10**9+7

def cmb(n,r):
    return factorial(n) // (factorial(r) * factorial(n-r))

for i in range(1,k+1):
    if n-k+1 < i or k-1 < i-1:
        print(0)
    else:
        x = cmb(k-1,i-1) % mod
        y = cmb(n-k+1,i) % mod
        ans = (x*y) % mod
        print(int(ans))
### BUGGY CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
H,W=map(int,input().split())
cx,cy=map(lambda x: int(x)+1,input().split())
dx,dy=map(lambda x: int(x)+1,input().split())
S=["#"*(W+4)]*2+["##"+input()+"##" for i in range(H)]+["#"*(W+4)]*2
l=[[-2]*(W+4) for i in range(H+4)]
for i in range(2,H+2):
    for j in range(2,W+2):
        if S[i][j]==".":
            l[i][j]=-1
l[cx][cy]=0
b=[(cx,cy)]
bb=[(cx,cy)]
t=0
while bb:
    while b:
        a=[]
        for i in b:
            if l[i[0]+1][i[1]]==-1:
                l[i[0]+1][i[1]]=t
                a.append((i[0]+1,i[1]))
            if l[i[0]-1][i[1]]==-1:
                l[i[0]-1][i[1]]=t
                a.append((i[0]-1,i[1]))
            if l[i[0]][i[1]+1]==-1:
                l[i[0]][i[1]+1]=t
                a.append((i[0],i[1]+1))
            if l[i[0]][i[1]-1]==-1:
                l[i[0]][i[1]-1]=t
                a.append((i[0],i[1]-1))
        bb+=a
        b=a
    aa=[]
    t+=1
    b=[]
    for i in bb:
        for j in range(-2,3):
            for k in range(-2,3):
                if l[i[0]+j][i[1]+k]==-1:
                    l[i[0]+j][i[1]+k]=t
                    aa.append((i[0]+j,i[1]+k))
                    b.append((i[0]+j,i[1]+k))
    if l[dx][dy]>=0:
        break
    bb=aa
print(l[dx][dy])

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
H,W=map(int,input().split())
cx,cy=map(lambda x: int(x)+1,input().split())
dx,dy=map(lambda x: int(x)+1,input().split())
S=["#"*(W+4)]*2+["##"+input()+"##" for i in range(H)]+["#"*(W+4)]*2
l=[[-2]*(W+4) for i in range(H+4)]
for i in range(2,H+2):
    for j in range(2,W+2):
        if S[i][j]==".":
            l[i][j]=-1
l[cx][cy]=0
b=[(cx,cy)]
bb=[(cx,cy)]
t=0
while bb:
    while b:
        a=[]
        for i in b:
            if l[i[0]+1][i[1]]==-1:
                l[i[0]+1][i[1]]=t
                a.append((i[0]+1,i[1]))
            if l[i[0]-1][i[1]]==-1:
                l[i[0]-1][i[1]]=t
                a.append((i[0]-1,i[1]))
            if l[i[0]][i[1]+1]==-1:
                l[i[0]][i[1]+1]=t
                a.append((i[0],i[1]+1))
            if l[i[0]][i[1]-1]==-1:
                l[i[0]][i[1]-1]=t
                a.append((i[0],i[1]-1))
        bb+=a
        b=a
    aa=[]
    t+=1
    b=[]
    for i in bb:
        for j in range(-2,3):
            for k in range(-2,3):
                if l[i[0]+j][i[1]+k]==-1:
                    l[i[0]+j][i[1]+k]=t
                    aa.append((i[0]+j,i[1]+k))
                    b.append((i[0]+j,i[1]+k))
    if l[dx][dy]>=0:
        break
    bb=aa
print(l[dx][dy])
### BUGGY CODE ###

[N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
    i = int(i)
    x = int(x)
    if x in A : A[x] += [i]
    else : A[x] = [i]
for i in sorted(A) :
    for j in A[i] :
        for k in range(L) :
            if j + k in ANS :
                continue
            elif j + k < N :
                ANS[j+k] = i
                count += 1
    if count == N : break

for i in range(L-1,N-1) : print(ANS[i], end=" ")
print(ANS[N-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

N = int(input())

L = list(map(int, input().split()))
L.sort()

ans = 0

# for i in range(N):
#     L_count[L[i]] += 1

for i in range(N-1):
    for j in reversed(range(i + 2, N)):
        for k in range(i + 1, j):
            if L[j] - L[i] < L[k] and L[k] < L[j] + L[i]:
                ans += 1

print(ans)


### FIXED CODE ###

from bisect import bisect_left

N = int(input())

L = list(map(int, input().split()))
L.sort()

ans = 0


for i in range(N):
    for j in range(i + 1, N):
        c = L[i] + L[j]
        # a+bが入る場所を返す
        idx = bisect_left(L, c)
        ans += max(0, idx - (j + 1))

print(ans)
### BUGGY CODE ###

def LI():return list(map(int,input().split()))
def yes():return print("Yes")
def no():return print("No")
from collections import deque, defaultdict, Counter
from heapq import heappop, heappush
# import math
# pi=math.pi
# print(pi)
# yes()
# no()
n=int(input())

# s=input()
a=LI()
ans=1
for q in a:
    ans*=q
if ans>10**18:
    ans=-1
print(ans)



### FIXED CODE ###

def LI():return list(map(int,input().split()))
def yes():return print("Yes")
def no():return print("No")
from collections import deque, defaultdict, Counter
from heapq import heappop, heappush
# import math
# pi=math.pi
# print(pi)
# yes()
# no()
n=int(input())

# s=input()
a=LI()
a.sort()
if a[0]==0:
    print(0)
    exit()

ans=1
for q in a:
    ans*=q
    if ans>10**18:
        print(-1)
        exit()
print(ans)
### BUGGY CODE ###

n = int(input())
sum_digit = 0
while n > 0:
    sum_digit += n % 10
    n //= 10
if sum_digit % 9 == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n = input()
sum_digit = 0
l = len(n)
for i in range(l):
    sum_digit += int(n[i])
if sum_digit % 9 == 0:
    print("Yes")
else:
    print("No")
### BUGGY CODE ###

from collections import deque
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
UV = [[] for _ in range(n)]
for _ in range(m):
    u, v = list(map(lambda x: int(x)-1, input().split()))
    UV[u].append(v)
s, t = list(map(lambda x: int(x)-1, input().split()))

edges = [set()for _ in range(n)]

for v in range(n):
    for v2 in UV[v]:
        for v3 in UV[v2]:
            for v4 in UV[v3]:
                edges[v].add(v4)

INF = 10**18
dist = [INF]*n
dist[s] = 0
next_v = deque([s])
while next_v:
    v = next_v.popleft()
    for v2 in edges[v]:
        if dist[v2] <= dist[v]+1:
            continue
        dist[v2] = dist[v]+1
        next_v.append(v2)
print(dist[t]if dist[t] != INF else -1)


### FIXED CODE ###

from collections import deque
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
UV = [[]for _ in range(n)]
for _ in range(m):
    u, v = list(map(lambda x: int(x)-1, input().split()))
    UV[u].append(v)
s, t = list(map(lambda x: int(x)-1, input().split()))

NV = 3*n
edges = [[]for _ in range(NV)]


def to_v(i, j):
    return 3*i+j


for i in range(n):
    for i2 in UV[i]:
        for j in range(3):
            edges[to_v(i, j)].append(to_v(i2, (j+1) % 3))

init_v = to_v(s, 0)
INF = 10**18
dist = [INF]*NV
dist[init_v] = 0
next_v = deque([init_v])
while next_v:
    v = next_v.popleft()
    for v2 in edges[v]:
        if dist[v2] <= dist[v]+1:
            continue
        dist[v2] = dist[v]+1
        next_v.append(v2)

print(dist[to_v(t, 0)]//3 if dist[to_v(t, 0)] != INF else -1)
### BUGGY CODE ###

n, k = map(int, input().split())
r, s, p = map(int, input().split())
score_list = list(input())
#rグー、sチョキ、pパー
for i in range(k):
    score_list.insert(0, 0)


ans = 0
for i in range(k, n+k):
    if score_list[i] == "r":
        if score_list[i] != score_list[i-k]:
            ans += p
        else:
            score_list[i] = 0
    elif score_list[i] == "s":
        if score_list[i] != score_list[i-k]:
            ans += r
        else:
            score_list[i] = 0
    elif score_list[i] == "p":
        if score_list[i] != score_list[i-k]:
            ans += s
        else:
            score_list[i] = 0

print(ans)

### FIXED CODE ###

#入力
n, k = map(int, input().split())
rsp_score = list(map(int, input().split()))
rsp = input("")
rsp_order = list(rsp)
t_score = []
t_order = []
#
for i in range(n):
    if rsp_order[i] == "r":
        if i < k:
            t_score.append(rsp_score[2])
            t_order.append("p")

        elif i >= k:
            if rsp_order[i] != rsp_order[i - k] or t_order[i - k] == "c":
                t_score.append(rsp_score[2])
                t_order.append("p")

            else:
                t_score.append(0)
                t_order.append("c")

    elif rsp_order[i] == "s":
        if i < k:
            t_score.append(rsp_score[0])
            t_order.append("r")

        elif i >= k:
            if rsp_order[i] != rsp_order[i - k] or t_order[i - k] == "c":
                t_score.append(rsp_score[0])
                t_order.append("r")

            else:
                t_score.append(0)
                t_order.append("c")

    elif rsp_order[i] == "p":
        if i < k:
            t_score.append(rsp_score[1])
            t_order.append("s")

        elif i >= k:
            if rsp_order[i] != rsp_order[i - k] or t_order[i - k] == "c":
                t_score.append(rsp_score[1])
                t_order.append("s")

            else:
                t_score.append(0)
                t_order.append("c")

print(sum(t_score))
### BUGGY CODE ###

from itertools import product
from collections import defaultdict as dd

class UFT(object):
  def __init__(self,n):
    self.parent={i:i for i in range(1,n+1)}
    self.height={i:0 for i in range(1,n+1)}
  def find(self,a):
    if self.parent[a]!=a:
      self.parent[a]=self.find(self.parent[a])
    return self.parent[a]
  def unite(self,a,b):
    a=self.find(a)
    b=self.find(b)
    if self.height[a]>self.height[b]:
      self.parent[b]=a
    else:
      if self.height[a]==self.height[b]:
        self.height[b]+=1
      self.parent[a]=b
  def isunited(self,a,b):
    return self.find(a)==self.find(b)


n,k,l=map(int,input().split())
uk=UFT(n)
ul=UFT(n)
dc=dd(int)

for _ in range(k):
  a,b=map(int,input().split())
  uk.unite(a,b)

for _ in range(l):
  a,b=map(int,input().split())
  ul.unite(a,b)
  
for i in range(1,n+1):
  dc[(uk.find(i),ul.find(i))]+=1

print(" ".join(map(str,(dc[(uk.find(i),ul.find(i))] for i in range(1,n+1)))))

### FIXED CODE ###

from itertools import product
from collections import defaultdict as dd

class UFT(object):
  def __init__(self,n):
    self.parent={i:i for i in range(1,n+1)}
    self.height={i:0 for i in range(1,n+1)}
  def find(self,a):
    if self.parent[a]!=a:
      self.parent[a]=self.find(self.parent[a])
    return self.parent[a]
  def unite(self,a,b):
    a=self.find(a)
    b=self.find(b)
    if self.height[a]>self.height[b]:
      self.parent[b]=a
    else:
      if self.height[a]==self.height[b]:
        self.height[b]+=1
      self.parent[a]=b
  def isunited(self,a,b):
    return self.find(a)==self.find(b)


n,k,l=map(int,input().split())
uk=UFT(n)
ul=UFT(n)
dc=dd(int)
du={}

for _ in range(k):
  a,b=map(int,input().split())
  uk.unite(a,b)

for _ in range(l):
  a,b=map(int,input().split())
  ul.unite(a,b)
  
for i in range(1,n+1):
  du[i]=(uk.find(i),ul.find(i))
  dc[du[i]]+=1

print(*(dc[du[i]] for i in range(1,n+1)))
### BUGGY CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, T = MAP()
A = LIST()
B = [sorted(A[i+1:N])[-1]-A[i] for i in range(N-1)]
# print(B)
print(B.count(max(B)))

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, T = MAP()
A = LIST()
# B = [max(A[i+1:N])-A[i] for i in range(N-1)] # O(N^2)時間かかる
# print(B)
min_ = INF
B = []
for i in A:
	B.append(i-min_)
	# print(min_)
	if min_ > i:
		min_ = i
# print(B)
print(B.count(max(B)))
### BUGGY CODE ###

from math import ceil
n, a, b = map(int, input().split())
h = [int(input()) for i in range(n)]

def enough(t):
    count = 0
    for hp in h:
        count += ceil(max(0, hp - b*t) / (a-b))
    if(count <= t):
        return True
    else:
        return False


high = ceil(max(h)/b)
low = 0
mid = ceil((high + low) / 2)
while(enough(mid)==enough(mid-1)):
    mid = (high + low) // 2
    if(enough(mid)):
        high = mid
    else:
        low = mid
print(mid)


### FIXED CODE ###

from math import ceil
n, a, b = map(int, input().split())
h = [int(input()) for i in range(n)]

def enough(t):
    count = 0
    for hp in h:
        count += ceil(max(0, hp - b*t) / (a-b))
    if(count <= t):
        return True
    else:
        return False


high = ceil(max(h)/b)
low = 0
while(high - low > 0):
    mid = (high + low) // 2
    if(enough(mid)):
        high = mid
    else:
        low = mid + 1
print(low)
### BUGGY CODE ###

# multiple
line = input()
ln = [0]
counts=[0]*2019
for i in range(1,len(line) + 1):
    ti1 = (ln[-1] +(int(line[-1*i])*10**(i-1))%2019)%2019
    counts[ti1] += 1
    ln.append(ti1)
total = 0
counts[0] +=1
for i in range(len(counts)):
    total += counts[i]*(counts[i] - 1)/2
print(int(total))

### FIXED CODE ###

# multiple
line = input()
ln = 0
d = 1
counts=[0]*2019
for i in range(1,len(line) + 1):
    ti1 = (ln +(int(line[-1*i])*d))%2019
    counts[ti1] += 1
    ln = ti1
    d *= 10
    d %= 2019
total = 0
counts[0] +=1
for i in range(len(counts)):
    total += counts[i]*(counts[i] - 1)/2
print(int(total))
### BUGGY CODE ###

N=int(input())
S=input()
out=0
for i in range (0,N-3):
    for j in range (i+3,N):
        if S[i]!=S[j]:
            for k in range (i+1,j):
                if S[k]!=S[i] and S[k]!=S[j] and k!=(i+j)/2:
                    out=out+1
print(out)

### FIXED CODE ###

N=int(input())
S=input()
r = S.count("R")
g = S.count("G")
b = S.count("B")
out =r*g*b

for i in range(0,N):
    w = 1
    while i+w*2<N:
        if S[i]!=S[i+w] and S[i]!=S[i+2*w] and S[i+w]!=S[i+2*w]:
            out = out -1
        w = w+1
        
print(out)
### BUGGY CODE ###

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

ans = 1
for i in range(N):
    X = a[i]
    res = 1
    j = i+1
    while (j < N and a[j] - X <= 1):
        j += 1
        res += 1
    j = i-1
    while (j >= 0 and X - a[j] <= 1):
        j -= 1
        res += 1
    ans = max(res, ans)

print(ans)


### FIXED CODE ###

from bisect import bisect_left, bisect_right

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

ans = 1
for i in range(N):
    X = a[i]
    res = bisect_right(a, X+1) - bisect_left(a, X-1)
    ans = max(res, ans)

print(ans)