Harryxun/stf_run huggingface dataset:
import sys

import numpy as np


class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


n, k = map(int, input().split())
aaa = np.fromiter(sys.stdin, dtype=np.int64)
aaa = np.insert(aaa, 0, 0)
acc = np.add.accumulate(aaa) - np.arange(0, k * n + 1, k)
dct = {v: i for i, v in enumerate(np.unique(acc), start=1)}
bit = Bit(n)
ans = 0
for d in acc:
    i = dct[d]
    ans += bit.sum(i)
    bit.add(i, 1)
print(ans)


### FIXED CODE ###

import sys

import numpy as np


class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


n, k = map(int, input().split())
aaa = np.fromiter(sys.stdin, dtype=np.int64)
aaa = np.insert(aaa, 0, 0)
acc = np.add.accumulate(aaa) - np.arange(0, k * n + 1, k)
dct = {v: i for i, v in enumerate(np.unique(acc), start=1)}
bit = Bit(len(dct))
ans = 0
for d in acc:
    i = dct[d]
    ans += bit.sum(i)
    bit.add(i, 1)
print(ans)
#!/usr/bin/env python3

n = int(input())

def j(b):
    print(b)
    i = input()[0]
    if i == "V": exit()
    return b, i

def q(l, r, t):
    m, rm = j((l + r + 1) // 2)
    if (m - b)%2 == (rm != t):
        q(m, r, rm)
    else:
        q(l, m-1, t)

_, s = j(0)
q(0, n-1, s)


### FIXED CODE ###

x, y = map(int,input().split())
print([x, -1][x%y==0])
n = int(input())
x = list(map(int, input().split()))
d = [x[i+1] - x[i] for i in range(n - 1)]

def fact(m):
  return m * fact(m-1) % 1000000007 if m != 1 else 1
 
fact_n_1 = fact(n-1)

e = [None] * (n-1)
for i in range(n-1):
  if i == 0:
    e[i] = fact_n_1
  else:
    e[i] = (e[i - 1] + fact_n_1 // (i + 1)) % 1000000007

print(sum(e_i * d_i % 1000000007
          for i, (d_i, e_i) 
          in enumerate(zip(d, e))) % 1000000007 ) 

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n = int(input())
x = list(map(int, input().split()))
d = [x[i+1] - x[i] for i in range(n - 1)]

def pow(x, y):
    if y == 0:
        return 1
    ans = 1
    while y > 1:
        if y % 2 != 0:
            ans *= x
            ans %= 1000000007
        x *= x
        x %= 1000000007
        y //= 2
    return ans * x % 1000000007

def fact(m):
  return m * fact(m-1) % 1000000007 if m != 1 else 1
 
fact_n_1 = fact(n-1)

e = [None] * (n-1)
for i in range(n-1):
  if i == 0:
    e[i] = fact_n_1
  else:
    e[i] = (e[i - 1] + fact_n_1 * pow(i + 1, 1000000005)) % 1000000007

print(sum(e_i * d_i % 1000000007
          for i, (d_i, e_i) 
          in enumerate(zip(d, e))) % 1000000007 )
n=int(input())
a=list(map(int,input().split()))
q=int(input())
num=[0]*(10**5+1)
ans=sum(a)
for i in a:
    num[i]+=1
for i in range(q):
    b,c=map(int,input().split())
    ans=ans+(c-b)*num[b-1][0]
    num[c-1][0]+=num[b-1][0]
    num[b-1][0]=0
    print(ans)
    

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
q=int(input())
num=[0]*(10**5+1)
ans=sum(a)
for i in a:
    num[i]+=1
for i in range(q):
    b,c=map(int,input().split())
    ans=ans+(c-b)*num[b]
    num[c]+=num[b]
    num[b]=0
    print(ans)
n,k = map(int,input().split())
p = list(map(int,input().split()))
ans = 0
for i in range(n):
  a = p[i:i+k]
  ans (max(ans,sum(a))
  if i+k == n:
       break
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    N, K = map(int, input().split())
    P = list(map(int, input().split()))

    tmp_max = sum(P[:K])
    tmp = sum(P[:K])
    for i in range(N-K):
        tmp += P[i+K]
        tmp -= P[i]

        if tmp > tmp_max:
            tmp_max = tmp

    print((tmp_max + K) / 2)

main()
a = input()
a[3]="8"
print(a)

### FIXED CODE ###

a = input().split("/")
a[0]="2018"
print(a[0]+"/"+a[1]+"/"+a[2])
d, g = [int(i) for i in input().split()]
p = []
c = []
for i in range(d):
    x, y = [int(_) for _ in input().split()]
    p.append(x)
    c.append(y)

ans = 1
key = d-1
score_max = 0
cnt = 1
pat = [0 for i in range(d)]
while True:
    while pat[key] >= p[key]:
        key -= 1    
    score_max += (key+1) * 100
    pat[key] += 1

    if cnt in p:
        i = p.index(cnt)
        score = 100*(i+1)*p[i]+c[i]
        if score > score_max:
            score_max = score
            pat = [0 for i in range(d)]
            pat[i] = p[i]
            key = d -1
    if score_max >= g:
        break
    cnt += 1
print(cnt)
    


### FIXED CODE ###

import math
# N = int(input())
D, G = [int(i) for i in input().split()]
problems = []
for i in range(D):
    p, c = [int(_) for _ in input().split()]
    bit = 0
    problems.append([p, c])

ans = 1001
for i in range(2**D):
    score = 0
    p_num = 0
    for j, p in enumerate(problems):
        if i >> j & 1:
            score += p[0] * 100 * (j + 1) + p[1]
            p_num += p[0]
    if score < G:
        rest = G - score
        for j in range(D-1, -1, -1):
            if i >> j & 1:
                continue
            n = math.ceil(rest / (100 * (j + 1)))
            if n <= problems[j][0] - 1:
                rest -= n * 100 * (j + 1)
                p_num += n
                break
            rest -= problems[j][0] * 100 * (j + 1)
            p_num += problems[j][0]
        if rest <= 0:
            ans = min(ans, p_num)
    else:
        ans = min(ans, p_num)
print(ans)
a, op, b = input().split()
if(op == "+"):
    print(int(a)+int(b))
else:
    print(int(a)-int(b))　

### FIXED CODE ###

a, op, b = input().split()
if(op == "+"):
    print(int(a)+int(b))
else:
    print(int(a)-int(b))
import math as m

def isltK(K,X):
    ccut=0
    for Ai in As:
        ccut += m.ceil(Ai/X)-1
    if ccut <=K:
        return True
    else:
        return False


N,K=map(int,input().split())
As=list(map(int,input().split()))

l=0
h=max(As)
while l < h:
    mid = (l+h)//2
    if isltK(K,mid):
        h=mid
    else:
        l=mid+1
print(l)

### FIXED CODE ###

import math as m

def isltK(K,X):
    ccut=0
    for Ai in As:
        ccut += m.ceil(Ai/X)-1
    if ccut <=K:
        return True
    else:
        return False


N,K=map(int,input().split())
As=list(map(int,input().split()))

l=1
h=max(As)
while l < h:
    mid = (l+h)//2
    if isltK(K,mid):
        h=mid
    else:
        l=mid+1
print(l)
N, M = map(int, input().split())
temp = N * 2 + M
print(temp　//　4)

### FIXED CODE ###

N, M = map(int, input().split())

count = min(M // 2, N)
if M - 2 * N >= 0:
    M -= 2 * N
    count += M // 4

print(count)
s = input()
t = input()
lent = len(t)
tcount = 0
snow = 0
count = 0
flag = True
while True:
    if t[tcount] not in s:
        flag = False
        break
    snow = s.index(t[tcount])
    tcount += 1
    if tcount == lent:
        break
    if t[tcount] in s[snow+1:]:
        snow = s[snow+1:].index(t[tcount])
    else:
        snow = s.index(t[tcount])
        count += 1
if flag:
    print(count*len(s) + s.index(t[-1])+1)
else:
    print(-1)

### FIXED CODE ###

s = input()
t = input()
lent = len(t)
tcount = 0
snow = 0
count = 0
flag = True
if t[0] not in s:
    print(-1)
else:
    snow = s.index(t[0])
    while True:
        tcount += 1
        if tcount == lent:
            break
        if t[tcount] in s[snow+1:]:
            snow = s[snow+1:].index(t[tcount])+snow+1
        elif t[tcount] in s:
            snow = s.index(t[tcount])
            count += 1
        else:
            flag = False
            break
    if flag:
        print(count*len(s) + snow+1)
    else:
        print(-1)
import numpy as np
from heapq import *

X, Y, Z, K = map(int, input().split())
A = np.array(list(map(int, input().split())))
B = np.array(list(map(int, input().split())))
C = np.array(list(map(int, input().split())))

# 二分探索でK個の選び方を探す
up = 10 ** 10 + 1 # 不可能
low = 0 # 可能
A_max = A.max()
B_max = B.max()
C_max = C.max()
while up > low + 1:
    mid = (up+low)// 2
    if (A >= A_max - mid).sum() * (B >= B_max - mid).sum() * (C >= C_max - mid).sum() >= K:
        low = mid
    else:
        up = mid
A_line = A_max - low
B_line = B_max - low
C_line = C_max - low
A = [x for x in A if x >= A_line]
B = [x for x in B if x >= B_line]
C = [x for x in C if x >= C_line]
L = []
heapify(L)
for a in A:
    for b in B:
        for c in C:
            heappush(L, -(a+b+c))
for i in range(K):
    n = heappop(L)
    print(-n)

        


### FIXED CODE ###

import numpy as np
from heapq import *

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

h = []
heappush(h, (-A[0]-B[0]-C[0], 0, 0, 0))
used = set()
result = []

for _ in range(K):
    sum, i, j, k = heappop(h)
    result.append(-sum)
    if i < X-1 and (i+1, j, k) not in used:
        heappush(h, (-A[i+1]-B[j]-C[k], i+1, j, k))
        used.add((i+1, j, k))
    if j < Y-1 and (i, j+1, k) not in used:
        heappush(h, (-A[i]-B[j+1]-C[k], i, j+1, k))
        used.add((i, j+1, k))
    if k < Z-1 and (i, j, k+1) not in used:
        heappush(h, (-A[i]-B[j]-C[k+1], i, j, k+1))
        used.add((i, j, k+1))

for v in result:
    print(v)
N=int(input())
A=[i for i in map(int,input().split())]

from math import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

ans=[]
for i in range(N):
    B=A.copy()
    del B[i]
    ans.append(gcd_list(B))
    
print(max(ans))    

### FIXED CODE ###

from fractions import gcd
from functools import reduce

N=int(input())
A=[i for i in map(int,input().split())]

ans=[]
L={}
L[0]=0
R={}
R[N+1]=0
R[N+2]=0

def gcd2(x,a):
    if x==0:
        return a
    else:
        return gcd(x,a)

for i in  range(N):
    L[i+1]=gcd2(L[i],A[i])
    R[N-i]=gcd2(R[N-i+1],A[-(i+1)])

for i in range(N):
    ans.append(gcd2(L[i],R[i+2]))
print(max(ans))
n=int(input())
dic={}
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]+=1
  else:
    dic[r]=1

n=int(input())
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]-=1
  else:
    dic[r]=-1

print(max(dic.values(),0))

### FIXED CODE ###

a,b=map(int,input().split())
s=input().split("-")
s.append("-")

if len(s[0])==a and len(s[1])==b and s[1].isalnum() and s[0].isalnum():
  print("Yes")
else:
  print("No")
N = int(input())
a = list(map(int, input().split()))
cnt=0
for i in range(len(a)):
    if i < len(a):
        if a[i] == i+1:
            inter=a[i]
            a[i]=a[i+1]
            a[i+1]=inter
            cnt +=1
        continue
print(cnt)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
cnt=0
for i in range(N):
    if a[i] == i+1:
        if i+1 == N:
            inter=a[i]
            a[i]=a[i-1]
            a[i-1]=inter
        else:
            inter=a[i]
            a[i]=a[i+1]
            a[i+1]=inter
        cnt +=1
print(cnt)
a,b = [int(i) for i in input().split()]
if a=='H':
  if b=='H':
    print('H')
  else:
    print('D')
else:
  if b=='H':
    print('D')
  else:
    print('H')

### FIXED CODE ###

a,b = [i for i in input().strip().split()]
if a=='H':
  if b=='H':
    print('H')
  else:
    print('D')
else:
  if b=='H':
    print('D')
  else:
    print('H')
a = int(input())
b = sum(list(map(int,list(str(a)))))
ans = a/b
print("Yes" if ans == o else"No")

### FIXED CODE ###

a = int(input())
b = sum(list(map(int,list(str(a)))))
ans = a%b
print("Yes" if ans == 0 else"No")
n = int(input())
odds = (n // 2)  + 1
ans = odds / n
return ans

### FIXED CODE ###

n = int(input())
if n % 2 == 0:
    odds = n // 2
else:
    odds = (n // 2)  + 1
ans = odds / n
print(ans)
n, m = map(int, input().split())
s = [[int(x) for x in input().split()][1:] for y in range(m)]
p = [int(z) for z in input().split()]
ans = 0

for i in range(2**n):
    b = array([(i>>j)&1 for j in range(n)])
    if [sum(b[array(k) - 1]) % 2 for k in s] == p:
        ans += 1
print(ans)

### FIXED CODE ###

from numpy import *
n,m = map(int, input().split())

s = [[int(j) for j in input().split()][1:] for i in range(m)]
p = [int(i) for i in input().split()]

ans = 0

for i in range(2**n):
    b = array([(i>>j)&1 for j in range(n)])
    if [sum(b[array(k)-1]) % 2 for k in s] == p:
        ans += 1
print(ans)
x,n = list(map(int,input().split()))


if n <= 0:
    print(x)
else:
    p = list(map(int,input().split()))
    p2 = [x for x in range(1,100+1)]

    p_p2_diff = set(p)^set(p2)
    p_p2_diff_list = list(p_p2_diff)

    min_list = []
    for i in range(len(p_p2_diff_list)):
        val = abs(x - p_p2_diff_list[i])
        min_list.append(val)

    print(p_p2_diff_list[min_list.index(min(min_list))])


### FIXED CODE ###


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


if n <= 0:
    print(x)
else:
    p = list(map(int,input().split()))
    p.sort()
    p2 = [x for x in range(-200,200)]

    p_p2_diff = set(p)^set(p2)
    p_p2_diff_list = list(p_p2_diff)

    min_list = []
    for i in p_p2_diff_list:
        val = abs(x - i)
        min_list.append(val)

    print(p_p2_diff_list[min_list.index(min(min_list))])
n=int(input())
x=input()
s=list(x)
list=[]

for i in range(n):
    a=0;
    for j in range(i):
        for k in range(n-i):
            if s[j]==s[k]:
                a+=1
    list.append(a)

f=max(list)
print(f)

### FIXED CODE ###

a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max([c, d, e])
 
print(f)
import math
N, D = map(int, input().split())
P = [list(map(int, input().split()) for _ in range(N))]

cnt = 0
for i in range(N):
    d = math.sqrt(P[0]**2 + P[1]**2)
    if d <= D:
        cnt += 1

### FIXED CODE ###

import math
N, D = map(int, input().split())
P = [list(map(int,input().split())) for i in range(N)]

cnt = 0
for i in range(N):
    d = math.sqrt(int(P[i][0])**2 + int(P[i][1])**2)
    if d <= D:
        cnt += 1

print(cnt)
n=int(input())
nl=[input() for i in range(n)]
m=int(input())
ml=[input() for i in range(n)]
nsl=list(set(nl))
mx=0
for x in range(len(nsl)):
	d=nl.count(nsl[x])-ml.count(nsl[x])
	if d>mx:mx=d
print(max(0,mx))

### FIXED CODE ###

n=int(input())
nl=[input() for i in range(n)]
m=int(input())
ml=[input() for i in range(m)]
nsl=list(set(nl))
mx=0
for x in range(len(nsl)):
	d=nl.count(nsl[x])-ml.count(nsl[x])
	if d>mx:mx=d
print(max(0,mx))
S = int(input())
s = S % 60
m = S // 60
h = S // 60 // 60
print(s':'m':'h)

### FIXED CODE ###

S = int(input())
s = str(S % 60)
m = str(S // 60 % 60)
h = str(S // 60 // 60)
print(h + ':' + m + ':' + s)
N, Q = [int(s) for s in input().split()]
S = input()

ac = []
for i in range(len(S)):
    if S[i] == 'A' and S[i+1] == 'C':
        ac.append((i + 1, i + 2))
    i += 1
# print(ac)

for i in range(Q):
    l, r = [int(s) for s in input().split()]
    ans = 0
    for a, b in ac:
        if l <= a and b <= r:
            ans += 1
    print(ans)

### FIXED CODE ###

N, Q = [int(s) for s in input().split()]
S = input()

t = [0 for i in range(N+1)]
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)
for i in range(Q):
    l, r = [int(s) for s in input().split()]
    print(t[r-1] - t[l-1])
d_list = set()

times = int(input())
for i in range(times):
    elm = input().split()
    code = elm[1].replace("A","1")
    code = code.replace("C","2")
    code = code.replace("G","3")
    code = code.replace("T","4")
    if elm[0] == "insert":
        d_list.add(code)
        d_list = sorted(d_list)

    elif elm[0] == "find":
        lower_bound = 0
        upper_bound = len(d_list)-1
        found = False

        while lower_bound <= upper_bound and not found:
            mid = (lower_bound + upper_bound)//2
            if d_list[mid] < code:
                lower_bound = mid + 1
            elif d_list[mid] > code:
                upper_bound = mid - 1
            else:
                found = True
        if found:
            print("yes")
        else:
            print("no")

### FIXED CODE ###

n = int(input())

d = set()
for i in range(n):
    com = input().split()
    if com[0] == 'insert':
        d.add(com[1])
    else:
        print('yes' if com[1] in d else 'no')
N,A,B = map(int,input().split())

print(min(N*A,B)

### FIXED CODE ###

N,A,B = map(int,input().split())

print(min(N*A,B))
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = I()
A = LI()


def gcd(a, b):
    while b:
        a, b = b, a%b
    return a


l = list(accumulate(A, lambda x, y: gcd(x, y)))
r = list(reversed(list(accumulate(reversed(A), lambda x, y: gcd(x, y)))))
ret = max(l[n-1], r[1])
for i in range(n-2):
    ret = max(ret, gcd(l[i], r[i+2]))


print(ret)

### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = I()
A = LI()


def gcd(a, b):
    while b:
        a, b = b, a%b
    return a


l = list(accumulate(A, lambda x, y: gcd(x, y)))
r = list(reversed(list(accumulate(reversed(A), lambda x, y: gcd(x, y)))))
ret = max(l[n-2], r[1])
for i in range(n-2):
    ret = max(ret, gcd(l[i], r[i+2]))


print(ret)
n = int(input())
lst = [[-1 for _ in range(n)] for _ in range(n)]
for _ in range(n):
    c = int(input())
    for c1 in range(c):
        x, y = map(int, input().split())
        x -= 1
        lst[_][x] = y
        
ans = 0
for bit in range(2**n):
    flg = True
    for a in range(n):
        if (bit >> a) & 1:
            for x in range(n):
                if lst[a][x] != -1 and ((bit >> x) & 1) != lst[a][x]:
                  flg = False
                  break
    if flg:
        ans = max(ans, bin(bit).count('1'))
print(ans)


### FIXED CODE ###

a, b, c = map(int, input().split())
if a+b+c >= 22:
    print('bust')
else:
    print('win')
a,b,c,d,e,k= map(int, input().split())

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if A-B and A-C and A-D and A-E and B-C and B-E and C-D and C-E and D-E > k :
    print(":(")
else:
    print("Yay!")

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())



if e-a > k:
    print(":(")
else:
    print("Yay!")
n, r = map(int, input().split())
if r - n >= 2019:
  print(0)
  sys.exit(0)
min = 2019
#nM = n % 2019
#rM = r % 2019
for i in range(n, r+1):
  for j in range(i+1, r+1):
    min = min((i*j)%2019, min)
print(min)

### FIXED CODE ###

import sys
n, r = map(int, input().split())
if r-n >= 2019:
  print(0)
  sys.exit(0)
mini = 2019
#nM = n % 2019
#rM = r % 2019
for i in range(n, r+1):
  for j in range(i+1, r+1):
    mini = min((i*j)%2019, mini)
print(mini)
n = int(input())
T,A = map(int, input().split())
H = map(int, input().split())
z = [abs(a - (t - h*0.006)) for h in H]
print( z.index(min(z)) +1 )

### FIXED CODE ###

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
z=[abs(t-x*0.006-a) for x in h]
print(z.index(min(z))+1)
N = int(input())
num_list = [int(x) for x in input().split()]
max_x = 0
max_list = []
for i in range(N-1):
  n = num_list[i]
  n_next = num_list[i+1]

  if n >= n_next:
    max_x += 1
    if i == N-2:
      max_list.append(max_x)
  else:
    max_list.append(max_x)
    max_x = 0

print(max(max_list))

### FIXED CODE ###

import sys
N = int(input())
num_list = [int(x) for x in input().split()]
max_x = 0
max_list = [0]
for i in range(N-1):
  n = num_list[i]
  n_next = num_list[i+1]

  if n >= n_next:
    max_x += 1
    if i == N-2:
      max_list.append(max_x)
  else:
    max_list.append(max_x)
    max_x = 0
print(max(max_list))
a , b = map(int , input().split)
c=str(a)+str(b)
c=int(c)
for i in range (100)
    if c== i*i
        print("Yes)


        

### FIXED CODE ###

a , b = map(int , input().split())
c=str(a)+str(b)
c=int(c)
for i in range (1000):
    if c== int(i*i):
        print("Yes")  
        break      
    elif i==1000-1:
        print("No")
        break
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,A=MI()
    x=LI()
    M=max(x)
    
    #dp[i][j][k]はi番目まで，j枚で，和がkにできるか
    dp=[[[0]*(N*M+1) for j in range(N+1)] for _ in range(N+1)]
    dp[0][0][0]=1
    
    for i in range(N):
        for j in range(i+1):
            for k in range(N*M+1-x[i]):
                if dp[i][j][k]:
                    dp[i+1][j][k]+=dp[i][j][k]
                    dp[i+1][j+1][k+x[i]]+=dp[i][j][k]
                    

        
    ans=0
    for j in range(1,N+1):        
        ans+=dp[-1][j][j*A]
        
    print(ans)
 

            

main()


### FIXED CODE ###

import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,A=MI()
    x=LI()
    M=max(x)
    
    #dp[i][j][k]はi番目まで，j枚で，和がkにできるか
    dp=[[[0]*(N*M+1) for j in range(N+1)] for _ in range(N+1)]
    dp[0][0][0]=1
    
    for i in range(N):
        for j in range(i+1):
            for k in range(N*M+1-x[i]):
                if dp[i][j][k]:
                    dp[i+1][j][k]+=dp[i][j][k]
                    dp[i+1][j+1][k+x[i]]+=dp[i][j][k]
                    

        
    ans=0
    for j in range(1,N+1):
        if j*A<=N*M:     
            ans+=dp[-1][j][j*A]
        
    print(ans)
 

                
    
        
            
            
    
            
        
        
            

main()
#C
X,N = map(int,input().split())
p = list(map(int,input().split()))
r = 100
for i in range(100,min(min(p)-2,-1),-1):
    if i in p:
        pass
    else:
        if abs(r-X) >= abs(i-X):
            r = i
        else:
            pass
print(r)

### FIXED CODE ###

#C
X,N = map(int,input().split())
p = list(map(int,input().split()))
r = 101
for i in range(101,-1,-1):
    if i in p:
        pass
    else:
        if abs(r-X) >= abs(i-X):
            r = i
print(r)