Harryxun/stf_run huggingface dataset:
from collections import defaultdict
dic = defaultdict(list)
inf = 10**6
N = int(input())
l = []
z = []
xma, xmi, yma, ymi = 0, inf, 0, inf
for _ in range(N):
    x, y = map(int, input().split())
    xma = max(xma, x)
    yma = max(yma, y)
    xmi = min(xmi, x)
    ymi = min(ymi, y)
    l.append([x, y])
    z.append(x+y)
z.sort()
ans = z[-1]-z[0]

for t in l:
    a = t[0]+t[1]
    dic[a].append(t)
for u in dic:
    dic[u].sort()
    b = dic[u][-1][0]-dic[u][0][0]
    ans = max(2*b,ans)
    
l1, l2, l3, l4 = [], [], [], []
for k in l:
    if k[0]==xma:
        l1.append([k[1], k[0]])
    elif k[0]==yma:
        l2.append([k[0], k[1]])
    elif k[1]==xmi:
        l3.append([k[1], k[0]])
    elif k[1]==ymi:
        l4.append([k[0], k[1]])
l1.sort()
l2.sort()
l3.sort()
l4.sort()
       
ans = max(ans, abs(l1[0][1]-l3[-1][1])+abs(l1[0][0]-l3[-1][0]))
ans = max(ans, abs(l1[-1][1]-l3[0][1])+abs(l1[-1][0]-l3[0][0]))
ans = max(ans, abs(l2[0][1]-l4[-1][1])+abs(l2[0][0]-l4[-1][0]))
ans = max(ans, abs(l2[-1][1]-l4[0][1])+abs(l2[-1][0]-l4[0][0]))

print(ans)

### FIXED CODE ###

N = int(input())
z = []
zz = []
for _ in range(N):
    x, y = map(int, input().split())
    zz.append(x-y)
    z.append(x+y)
z.sort()
zz.sort()
ans = z[-1]-z[0]
ans = max(ans, zz[-1]-zz[0])

print(ans)
li = input("lkdfkgkfg").split()
t = 0
s = int(li.pop(5))
for i in li:
    for k in li:
        if int(k) - int(i) >= s:
            t = 1

if t == 0:
    print("Yay!")
else:
    print(":(")

while True:
    s += 1

### FIXED CODE ###

li = []
for l in range(6):
    li.append(input())

t = 0
s = li.pop()
for i in li:
    for k in li:
        if int(k) - int(i) > int(s):
            t = 1
        elif int(i) - int(k) > int(s):
            t = 1

if t == 0:
    print("Yay!")
else:
    print(":(")
#abc176b
N=input()
s=0
for i in range(len(N)):
 s+=int(N[i])
if s%9==0:
 print('Yes')
else:
 print('No')


### FIXED CODE ###

#abc176a
import math
n,x,t=map(int,input().split())
print(math.ceil(float(n)/x)*t)
W, H, x, y = map(int, input().split())

if (x == 0 or x == W) or (y == 0 and y == H) or x * H == W * y or x * H + W * y = W * H:
    print(W*H/2, 0)
else:
    S = W*min(y,H-y)
    T = min(x,W-x)*H
    counter = 0
    if S == T:
        counter += 1
    print(max(S,T), counter)

### FIXED CODE ###

W, H, x, y = map(int, input().split())

if x==W/2 and y==H/2:
    print(H*W/2, 1)
else:
    print(H*W/2, 0)
import sys
w = input()
print(sys.stdin.read().lower().split().cout(w))


### FIXED CODE ###

w = input().lower()
r = []
s = input()
while (s != "END_OF_TEXT"):
    r += s.lower().split()
    s = input()
print(len([x for x in r if x == w]))
n = int(input())
h_list = map(int, input().split())
h = 0
result = 'Yes'
for i in range(n):
  if h <= h_list[i]:
    h = h_list[i]
  elif h == h_list[i]-1:
    h = h_list[i]-1
  else:
    result = 'No'
print(result)

### FIXED CODE ###

n = int(input())
h_list = list(map(int, input().split()))
h = 0
result = 'Yes'
for i in range(n):
  if h <= h_list[i]-1:
    h = h_list[i]-1
  elif h == h_list[i]:
    h = h_list[i]
  else:
    result = 'No'
print(result)
n,k,q = map(int, input().split())

-----
nさんがc問正解したとき、勝ち抜けるには
q - c > k

-----

a = [0] * n

for i in range(q):
  A = int(input())
  a[A-1] += 1

for i in a:
  if q - i > k:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

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


a = [0] * n

for i in range(q):
  A = int(input())
  a[A-1] += 1

for i in a:
  if i > q - k:
    print('Yes')
  else:
    print('No')
import itertools

N = int(input())
balls = []

for i in range(N):
    x, y = map(int, input().split(' '))
    balls.append([x,y])

ans_list = []
for pat in list(itertools.permutations(balls)):
    dic = {}
    l = list(pat)
    px = l[0][0]
    py = l[0][1]
    for i in range(1,len(l)):
        dx = l[i][0] - px
        dy = l[i][1] - py
        px = l[i][0]
        py = l[i][1]
        if (dx,dy) not in dic.keys():
            dic[(dx,dy)] = 1
        else:
            dic[(dx,dy)] += 1
    d_max = max(dic.values())
    ans_list.append(N - d_max)

print(min(ans_list))


### FIXED CODE ###

N = int(input())
balls = []
for i in range(N):
    x, y = map(int, input().split(' '))
    balls.append((x,y))

if N == 1:
    print("1")
    exit()

dic = {}
for i in range(N):
    for j in range(i+1,N):
        dx = balls[j][0] - balls[i][0]
        dy = balls[j][1] - balls[i][1]
        if (dx,dy) not in dic.keys():
            dic[(dx,dy)] = 1
        else:
            dic[(dx,dy)] += 1
        dx *= -1
        dy *= -1
        if (dx,dy) not in dic.keys():
            dic[(dx,dy)] = 1
        else:
            dic[(dx,dy)] += 1

d_max = max(dic.values())
print(N - d_max)
n, m = tuple(map(int, raw_input().split()))
x = sorted(list(map(int, raw_input().split())))
y = [tuple(map(int, raw_input().split())) for i in range(m)]
y = sorted(key = lambda x: x[1], reverse=True)
for b,c in y:
  while x[b-1] > c and b > 0:
    b -= 1
  x[0:b] = [c]*b
  x.sort()
print(sum(x))


### FIXED CODE ###

n, m = tuple(map(int, raw_input().split()))
x = sorted(list(map(int, raw_input().split())))
y = [list(map(int, raw_input().split())) for i in range(m)]
y.sort(key = lambda x: x[1], reverse=True)
y_pos = 0
for index, value in enumerate(x):
  b = y[y_pos][0]
  c = y[y_pos][1]
  if value < c:
	  x[index] = c
	  y[y_pos][0] = b-1
	  if b == 1:
		  y_pos += 1
		  if y_pos == len(y):
			  break
  else:
	  break

print(sum(x))
x,y = input().split()
a,b = ord(x), ord(y)
 
if a < b:
    print('<')
elif a > b:
    print('>')
else if a==b:
    print('=')

### FIXED CODE ###

a,b=input().split()
x,y=ord(a),ord(b)

if x > y:
    print(">")
elif x==y:
  print("=")
else:
  print("<")
n, m = map(int, input().split())
l = [1] * (n + 1)
l[0] = 0 
h = list(map(int, input().strip().split())) 
b_a = b_b  = 0
for i in range(m):
  a, b = map(int, input().split())
  if b_a == a and b_b == b :
    l[a] = l[b] = 0
  else if h[a-1] < h[b-1]:
    l[a] = 0
  else if h[a-1] > h[b-1] :
    l[b] = 0
  b_a = a
  b_b = b

print(sum(l))

### FIXED CODE ###

n, m = map(int, input().split())
l = [1] * (n + 1)
l[0] = 0 
h = list(map(int, input().strip().split()))
h.insert(0, 0)
 
for i in range(m):
  a, b = map(int, input().split())
  if h[a] == h[b] :
    l[a] = l[b] = 0
  elif h[a] < h[b]:
    l[a] = 0
  else :
    l[b] = 0
  
 
print(sum(l))
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
 
 
 
while True:
    N,X = map(int,input().split())
    if N == 0 and X == 0:
        break
    ans = 0
    for a in range(1,N+1):
        for b in range(1,N+1):
            if b <= a:
                continue
            c = X-(a+b)
            if c > b and c <= N:
                ans += 1
    print("%d"%(ans))

Compile Error Logs:

Status
Judge: 4/4 	Python3 	CPU: 00:07 sec 	Memory: 5608 KB 	Length: 369 B 	2019-05-27 14:40
Results for testcases
Case # 	Verdict 	CPU Time 	Memory 	In 	Out 	Case Name
Case #1	: Accepted	00:02	5604	8	2	testcase_00
Case #2	: Accepted	00:03	5604	28	10	testcase_01
Case #3	: Accepted	00:02	5608	85	36	testcase_02
Case #4	: Accepted	00:07	5600	297	163	testcase_03
< prev | 		/ 		| next > 	  		
 
Judge Input #  ( | ) 		Judge Output #  ( | )

		




### FIXED CODE ###

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
 
 
 
while True:
    N,X = map(int,input().split())
    if N == 0 and X == 0:
        break
    ans = 0
    for a in range(1,N+1):
        for b in range(1,N+1):
            if b <= a:
                continue
            c = X-(a+b)
            if c > b and c <= N:
                ans += 1
    print("%d"%(ans))
x = int(input())
y = int(input())
print(str(x*y) + " " + str(2*x + 2*y))

### FIXED CODE ###

x = input().split(" ")
print(int(x[0])*int(x[1]), 2*(int(x[0])+int(x[1])))
n = int(input())
s = [str(i) for _ in range(n)]
for i in ("AC","WA","TLE","RE"):
	print("{0} x {1}".format(i,s.count(i))

### FIXED CODE ###

def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
s = [s() for _ in range(n)]

ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
	if s[i] == "AC":
		ac += 1
	elif s[i] == "WA":
		wa += 1
	elif s[i] == "TLE":
		tle += 1
	else:
		re += 1
print("AC x ",ac)
print("WA x ",wa)
print("TLE x ",tle)
print("RE x ",re)
a,b = map(int,input().split())
print(max(a - 2*b), 0)

### FIXED CODE ###

a,b = map(int,input().split())
print(max(a - 2*b, 0))
#ABC147
a = [map(int,input().split())]
print("bust" if sum(a)>=22 else "win")

### FIXED CODE ###

#ABC147
a = list(map(int,input().split()))
print("bust" if sum(a)>=22 else "win")
_,k = map(int, input().split())
print(sum(1 for h in map(int, input().split() if h >= k)))

### FIXED CODE ###

_,k = map(int, input().split())
print(sum(1 for h in map(int, input().split()) if h >= k))
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, k = MAP()
a = LIST()
mygcd = gcd(a[0],a[1])

for x in a:
    mygcd = gcd(mygcd,x)
for x in a:
    if x - k == 0 or ( x - k > 0 and ( x - k ) % mygcd == 0 ):
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

### FIXED CODE ###

from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, k = MAP()
a = LIST()

if n == 1:
    if a[0] == k:
        print("POSSIBLE")
        exit()
else:
    m = gcd(a[0], a[1])
    for x in a:
        m = gcd(m, x)
    for x in a:
        if x - k >= 0 and ( x - k ) % m == 0:
            print("POSSIBLE")
            exit()
print("IMPOSSIBLE")
s=input()

if s=='A':
	print 'T'
elif s=='T':
  	print 'A'
elif s=='G':
 	print 'C'
elif s=='C':
	print 'G'

### FIXED CODE ###

s=input()

if s=='A':
	print('T')
elif s=='T':
  	print('A')
elif s=='G':
 	print('C')
elif s=='C':
	print('G')
import math
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

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

left=[0]*(n+1)
right=[0]*(n+1)

left[1]=a[0]
right[n-1]=a[n-1]

for i in range(1,n):
    left[i+1]=math.gcd(left[i],a[i])
    right[n-1-i]=math.gcd(right[n-i],a[n-i-1])

# print(left)
# print(right)
last=[0]*n
last[0]=right[1]

for i in range(1,n-1):
    last.append(math.gcd(left[i],right[n-i]))

last[n-1]=left[n-1]

print(max(last))

### FIXED CODE ###

from fractions import gcd
# from functools import reduce
# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

n=int(input())

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

left=[0]*(n+1)
right=[0]*(n+1)

for i in range(n):
    left[i+1]=gcd(left[i],a[i])
    right[n-i-1]=gcd(right[n-i],a[n-i-1])

# print(left)
# print(right)
last=[0]*n

for i in range(n):
    last[i]=(gcd(left[i],right[i+1]))


print(max(last))
w, h, x, y = map(int, input().split())
s = 0
if w / x ==  h / y == 2:
  s = 1
print('{:.6f}'.format(w * h / 2), s)

### FIXED CODE ###

w, h, x, y = map(int, input().split())
s = 0
if w / 2 == x and h / 2 == y:
  s = 1
print('{:.6f}'.format(w * h / 2), s)
import numpy as np

#%%
N, M, X = [int(i) for i in input().split()]
CA = [[] for i in range(N)]
for i in range(M):
    k = list(map(int, input().split()))
    CA[i] = k[:]
CA = np.array(CA)
#%%
cnt = (10 ** 5) * N + 1

for i in range(2 ** N):
    score = np.zeros(N + 1)
    for j in range(N):
        if (i >> j) & 1:
            score += CA[j]
    for k in range(1, N + 1):
        if score[k] < X:
            break
    else:
        if score[0] < cnt:
            cnt = score[0]
            
if cnt != (10 ** 5) * N + 1:
    print(int(cnt))
else:
    print(-1)


### FIXED CODE ###

import numpy as np

#%%
N, M, X = [int(i) for i in input().split()]
CA = [[] for i in range(N)]
for i in range(N):
    k = list(map(int, input().split()))
    CA[i] = k[:]
CA = np.array(CA)
#%%
cnt = (10 ** 5) * N + 1

for i in range(2 ** N):
    score = np.zeros(M + 1)
    for j in range(N):
        if (i >> j) & 1:
            score += CA[j]
    for k in range(1, M + 1):
        if score[k] < X:
            break
    else:
        if score[0] < cnt:
            cnt = score[0]
            
if cnt != (10 ** 5) * N + 1:
    print(int(cnt))
else:
    print(-1)
import math
n=int(input())
count=0
while cakes*4+donuts*7<n:
    for a in range(math.floor(n/4)+1):
        if (n-a*4)%7==0:
            count+=1
print(count)


### FIXED CODE ###

import math
n=int(input())
for a in range(math.floor(n/4)+1):
    if (n-a*4)%7==0:
        print("Yes")
        quit()
print("No")
while 1:
    a,op,b = map(int,input().split())
    if op == "+":
        print(int(a) + int(b))
    elif op == "-":
        print(int(a) - int(b))
    elif op == "*":
        print(int(a) * int(b))
    elif op == "/":
        print(int(a) // int(b))
    else:
        break

### FIXED CODE ###

while 1:
    data = input()
    if "?" in data:
        break
    print(eval(data.replace("/","//")))
li = str(input).split(" ")
NT = list(map(int,li))
N = NT[0]
T = NT[1]
i = 1
mi = 9999
while i <= 3:
    a = list(map(int,input.split()))
    c = a[0]
    t = a[1]
    if t <= T and c < mi:
        mi = c
    i += 1

if mi == 9999:
    print("TLE")
else:
    print()


### FIXED CODE ###

Input = input()
li = Input.split(" ")
NT = list(map(int,li))
N = NT[0]
T = NT[1]
i = 1
mi = 9999

while i <= N:
    Input = input()
    li = Input.split(" ")
    a = list(map(int,li))
    c = a[0]
    t = a[1]
    if t <= T and c < mi:
        mi = c
    i += 1

if mi == 9999:
    print("TLE")
else:
    print(mi)
import heapq
n,k=map(int,input().split())
kind=[0]*n
s=set()
dt=[]
ans=0
for _ in range(n):
    t,d=map(int,input().split())
    ans+=d
    t-=1
    dt.append((d,t))
    s.add(t)
    kind[t]+=1
x=len(s)
ans+=x**2
sing,comp=[],[]
for d,t in dt:
    if kind[t]==1:
        heapq.heappush(sing,(d,t))
    elif kind[t]>=2:
        heapq.heappush(comp,(d,t))
for _ in range(n-k):
    ds,ts=heapq.heappop(sing)
    dc,tc=heapq.heappop(comp)
    if ds+x**2-(x-1)**2>dc:
        ans-=dc
        kind[tc]-=1
        if kind[tc]>=2:
            heapq.heappush(comp,(dc,tc))
        else:
            heapq.heappush(sing,(dc,tc))
        heapq.heappush(sing,(ds,ts))
    else:
        ans-=ds+x**2-(x-1)**2
        x-=1
        kind[ts]-=1
        heapq.heappush(comp,(dc,tc))
print(ans)

### FIXED CODE ###

from operator import itemgetter
n,k=map(int,input().split())
td=[list(map(int,input().split())) for _ in range(n)]
td.sort(key=itemgetter(1),reverse=True)
ans=0
kind=0
flg=[False]*n
sing,comp=[],[]
for i in range(n):
    t,d=td[i]
    t-=1
    if i<k:
        ans+=d
        if flg[t]:
            comp.append(d)
        else:
            flg[t]=True
            kind+=1
    else:
        if not flg[t]:
            sing.append(d)
            flg[t]=True
comp=comp[::-1]
cnt=ans
ans+=kind**2
#print(comp)
#print(sing)
if len(comp)>len(sing):
    for i in range(len(sing)):
        dc,ds=comp[i],sing[i]
        cnt+=ds-dc
        kind+=1
        ans=max(ans,cnt+kind**2)
else:
    for i in range(len(comp)):
        dc,ds=comp[i],sing[i]
        cnt+=ds-dc
        kind+=1
        ans=max(ans,cnt+kind**2)
print(ans)
t=input():
print("Bad") if (t[0]==t[1])or(t[1]==t[2])or(t[2]==t[3]) else print("Good")

### FIXED CODE ###

t=input()
print("Bad") if (t[0]==t[1])or(t[1]==t[2])or(t[2]==t[3]) else print("Good")
S=input()
T=input()
ans=0
for i in range(3):
if s[i]==s[i]:
ans+=1
print(ans)

### FIXED CODE ###

S=input()
T=input()
ans=0
for i in range(3):
 if S[i]==T[i]:
     ans+=1
print(ans)
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a =input()
    b=input()
    c=input()
    now = "A"
    for i in range(300):
        if now =="A":
            if len(a) >0:
                now = a.pop().upper()
            else:
                print("A")
                break
        if now =="B":
            if len(b) >0:
                now = b.pop().upper()
            else:
                print("B")
                break
        if now =="C":
            if len(c) >0:
                now = c.pop().upper()
            else:
                print("C")
                break

### FIXED CODE ###

import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a =input()
    b=input()
    c=input()
    now = "A"
    for i in range(300):
        if now =="A":
            if len(a) >0:
                now = a[0].upper()
                a=a[1:]
            else:
                print("A")
                break
        if now =="B":
            if len(b) >0:
                now = b[0].upper()
                b=b[1:]
            else:
                print("B")
                break
        if now =="C":
            if len(c) >0:
                now = c[0].upper()
                c=c[1:]
            else:
                print("C")
                break
s = input()[::-1]
while True:
    end_flg = False
    if s[:5] == "maerd":
        s = s.replace("maerd", "", 1)
        end_flg = True
        print(s)
    elif s[:5] == "esare":
        s = s.replace("esare", "", 1)
        end_flg = True
    elif s[:7] == "remaerd":
        s = s.replace("remaerd", "", 1)
        end_flg = True
    elif s[:6] == "resare":
        s = s.replace("resare", "", 1)
        end_flg = True    

    if end_flg == False:
        break
        
if s == "":
    print("YES")
else:
    print("NO")

### FIXED CODE ###

s = input()[::-1]
while True:
    end_flg = False
    if s[:5] == "maerd":
        s = s.replace("maerd", "", 1)
        end_flg = True
    elif s[:5] == "esare":
        s = s.replace("esare", "", 1)
        end_flg = True
    elif s[:7] == "remaerd":
        s = s.replace("remaerd", "", 1)
        end_flg = True
    elif s[:6] == "resare":
        s = s.replace("resare", "", 1)
        end_flg = True    

    if end_flg == False:
        break
        
if s == "":
    print("YES")
else:
    print("NO")
L, R = map(int, input().split())

num_list = list(range(L, R + 1))

num_list = [i % 2019 for i in num_list]
num_list.sort()

if 3 in set(num_list) and 673 in set(num_list):
    print(0)
else:
    print(num_list[0] * num_list[1])


### FIXED CODE ###

L, R = map(int, input().split())
if (L <= 673 <= R and R - L >= 3) or (R - L >= 673):
    print(0)
else:
    mods = []
    mods_append = mods.append
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            m = (i * j) % 2019
            mods_append(m)
            if m == 2:
                break

    print(min(mods))
def main():
    MOD = 10**9 + 7
    N = int(input())
    C = [int(input()) for _ in range(N)]
    if N == 1:
        print(1)
        return
    # |---|
    # 1-2-1-2-2
    #   |---|
    latest_indices = [-1] * N
    next_indices = [-1] * N
    for cur_index, c in enumerate(C):
        latest_index = latest_indices[c]
        if latest_index >= 0:
            next_indices[latest_index] = cur_index
        latest_indices[c] = cur_index
    dp = [0] * N
    dp[0] = 1
    for cur_index in range(N - 1):
        next_index = next_indices[cur_index]
        if next_index >= 0 and next_index > cur_index + 1:
            dp[next_index] += dp[cur_index]
            dp[next_index] %= MOD
        dp[cur_index + 1] += dp[cur_index]
        dp[cur_index + 1] %= MOD
    print(dp[N - 1])


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    MOD = 10**9 + 7
    N = int(input())
    C = [int(input()) - 1 for _ in range(N)]
    if N == 1:
        print(1)
        return
    # |---|
    # 1-2-1-2-2
    #   |---|
    latest_indices = [-1] * (2 * (10**5))
    next_indices = [-1] * N
    for cur_index, c in enumerate(C):
        latest_index = latest_indices[c]
        if latest_index >= 0:
            next_indices[latest_index] = cur_index
        latest_indices[c] = cur_index
    dp = [0] * N
    dp[0] = 1
    for cur_index in range(N - 1):
        next_index = next_indices[cur_index]
        if next_index > cur_index + 1:
            dp[next_index] += dp[cur_index]
            dp[next_index] %= MOD
        dp[cur_index + 1] += dp[cur_index]
        dp[cur_index + 1] %= MOD
    print(dp[N - 1])


if __name__ == '__main__':
    main()
N,M = map(int,input().split())
lsab = []
for i in range(N):
    a,b = map(int,input().split())
    lsab.append([a,b])
lscd = []
for j in range(M):
    c,d= map(int,input().split())
    lscd.append([c,d])

lsans = []
for i in range(N):
    max1 = 10**8
    for j in range(M):
        dis = abs(lsab[i][0]-lscd[j][0])+abs(lsab[i][1]-lscd[j][1])
        if dis < max1:
            ans = j+1
            max1 = dis
    lsans.append(ans)

for i in range(N):
    print(lsans[i])

### FIXED CODE ###

N,M = map(int,input().split())
lsab = []
for i in range(N):
    a,b = map(int,input().split())
    lsab.append([a,b])
lscd = []
for j in range(M):
    c,d= map(int,input().split())
    lscd.append([c,d])

lsans = []
for i in range(N):
    max1 = 4*10**8+100
    ans = 0
    for j in range(M):
        dis = abs(lsab[i][0]-lscd[j][0])+abs(lsab[i][1]-lscd[j][1])
        if dis < max1:
            ans = j+1
            max1 = dis
    lsans.append(ans)

for i in range(N):
    print(lsans[i])
import math
import numpy as np
N, D = map(int, input().split())
times = int(input())  
n = [list(map(int, input().split())) for i in range(times)]
n = np.array(n)
ans = 0
for j in range(n.shape[0]):
  for i in range(n.shape[0]):
    length = np.linalg.norm(n[i]-n[j])
    aaa = math.modf(length)[0]
    if aaa < 0.00001:
      ans +=1
ans = ans - n.shape[0]
ans = int(ans/2)
print(ans)

### FIXED CODE ###

n,a,b = map(int, input().split())

if n*a >= b:
  ans = b
else:
  ans = n*a
print(ans)
n=int(input())
patterns = ["a"]
for _ in range(n-1):
    last_patterns = patterns.copy()
    patterns = []
    for string in last_patterns:
        useful_str = alpha[:len(set(string))+1]
        for str_ in useful_str:
            patterns.append(string + str_)

for pat in patterns:
    print(pat)

### FIXED CODE ###

alpha = "abcdefghij"
n=int(input())
patterns = ["a"]
for _ in range(n-1):
    last_patterns = patterns.copy()
    patterns = []
    for string in last_patterns:
        useful_str = alpha[:len(set(string))+1]
        for str_ in useful_str:
            patterns.append(string + str_)

for pat in patterns:
    print(pat)
def resolve():
    N, A = list(map(int, input().split()))
    X = sorted(list(map(int, input().split())))
    cnt = 0
    for bits in range(1, 1<<N):
        flags = list(bin(bits)[2:].zfill(N))
        _X = [x for i, x in enumerate(X) if flags[i]=="1"]
        cnt += 1 if sum(_X)/len(_X) == A 
    print(cnt)
    


if '__main__' == __name__:
    resolve()



### FIXED CODE ###

def resolve():
    N, A = list(map(int, input().split()))
    X = [int(i) - A for i in input().split()]
    d = {0: 1}
    for x in X:
        for _sum, count in list(d.items()):
            d[_sum+x] = d.get(_sum+x, 0) + count

    print(d[0]-1)
    


if '__main__' == __name__:
    resolve()