Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

import numpy as np

N = int(input())
S = np.array([ord(x) for x in input().rstrip()],dtype=np.int64)

MOD = 10**9 + 7
base = 1234

def cumprod(arr):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr,Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        arr[:,n] *= arr[:,n-1]; arr[:,n] %= MOD
    for n in range(1,Lsq):
        arr[n] *= arr[n-1,-1]; arr[n] %= MOD
    return arr.ravel()[:L]

x = np.full(N,base,np.int64); x[0] = 1
power = cumprod(x)
x = np.full(N,pow(base,MOD-2,MOD),np.int64); x[0] = 1
power_inv = cumprod(x)

# rolling hash
H = S * power % MOD
Hcum = H.cumsum() % MOD

def test(n):
    # 長さnの文字列で2回現れるものが存在する
    x = (Hcum[n-1:] - Hcum[:N-n+1] + H[:N-n+1]) % MOD
    x *= power_inv[:N-n+1]
    x %= MOD
    # 距離n以上離れたところで連番が存在しないといけない
    ind = x.argsort(kind='stable')
    x = x[ind]
    is_left_end = np.zeros(N-n+1,np.bool)
    is_left_end[1:] = (x[1:] != x[:-1])
    is_left_end[0] = True
    is_right_end = np.zeros(N-n+1,np.bool)
    is_right_end[:-1] = (x[:-1] != x[1:])
    is_right_end[-1] = True
    gap = ind[is_right_end] - ind[is_left_end]
    return gap.max() >= n

left = 0 # 存在
right = N+1 # 非存在
while left + 1 < right:
    mid = (left + right)//2
    if test(mid):
        left = mid
    else:
        right = mid

answer = left
print(answer)


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

import numpy as np

N = int(input())
S = np.array([ord(x) for x in input().rstrip()],dtype=np.int64)

MOD = 10**9 + 7
base = 1234

def cumprod(arr):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr,Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        arr[:,n] *= arr[:,n-1]; arr[:,n] %= MOD
    for n in range(1,Lsq):
        arr[n] *= arr[n-1,-1]; arr[n] %= MOD
    return arr.ravel()[:L]

x = np.full(N,base,np.int64); x[0] = 1
power = cumprod(x)
x = np.full(N,pow(base,MOD-2,MOD),np.int64); x[0] = 1
power_inv = cumprod(x)

# rolling hash
H = S * power % MOD
Hcum = H.cumsum() % MOD

def test(n):
    # 長さnの文字列で2回現れるものが存在する
    x = (Hcum[n-1:N] - Hcum[:N-n+1] + H[:N-n+1]) % MOD
    x *= power_inv[:N-n+1]
    x %= MOD
    for i,a in np.ndenumerate(x):
        if (x[i[0]+n:] == a).any():
            return True
    return False

left = 0 # 存在
right = N+1 # 非存在
while left + 1 < right:
    mid = (left + right)//2
    if test(mid):
        left = mid
    else:
        right = mid

answer = left
print(answer)
​
while True:
  x,y=map(int, input().split())
​
  if x+y==0:
    break
  if x>=y:
    tmp = x
    x=y
    y=tmp
​
  print(x,y)


### FIXED CODE ###

while True:
  x,y=map(int, input().split())

  if x==0 and y==0:
    break
  if x>=y:
    x,y = y,x
  print(x,y)
import sys
input = sys.stdin.readline

h, w = [int(x) for x in input().split()]

if h % 3 == 0 or 2 % 3 == 0:
    print(0)
    exit()

if h % 3 == 1:
    d = h // 3 
else:
    d = h // 3 + 1
block = [w * d, (h-d) * (w // 2), (h-d) * (w - w // 2)]
for b in block:
    if b == int(b**0.5) ** 2:
        break
else:
    res1 = max(block) - min(block)

if w % 3 == 1:
    d = w // 3 
else:
    d = w // 3 + 1
block = [h * d, (w-d) * (h // 2), (w-d) * (h - h // 2)]
for b in block:
    if b == int(b**0.5) ** 2:
        break
else:
    res2 = max(block) - min(block)

print(min(res1, res2))

### FIXED CODE ###

import sys
input = sys.stdin.readline

h, w = [int(x) for x in input().split()]

if h % 3 == 0 or 2 % 3 == 0:
    print(0)
    exit()

if h % 3 == 1:
    d = h // 3 
else:
    d = h // 3 + 1
block = [w * d, (h-d) * (w // 2), (h-d) * (w - w // 2)]
res1 = max(block) - min(block)
block = [w * d, w * d, w * (h - d * 2)]
res2 = max(block) - min(block)

if w % 3 == 1:
    d = w // 3 
else:
    d = w // 3 + 1
block = [h * d, (w-d) * (h // 2), (w-d) * (h - h // 2)]
res3 = max(block) - min(block)
block = [h * d, h * d, h * (w - d * 2)]
res4 = max(block) - min(block)

print(min(res1, res2, res3, res4))
import itertools as itl
n, m=map(int, input().split())
#ここでリストを作成する
hen=[]
check=0
for _ in range(m):
  hen.append(list(map(int, input().split())))
#print(hen)
l=list(range(2, n+1))
for v in itl.permutations(l):
  #print(v)
  for i in range(n-2):
    if not(sorted(v[i:i+2]) in hen) or not(list([1, v[0]]) in hen):
      break
  else:
    if i==n-3:
      check+=1
    continue
    break 
print(check)
  
  
      
    

### FIXED CODE ###

import itertools as itl
n, m=map(int, input().split())
#ここでリストを作成する
hen=[]
check=0

for _ in range(m):
  hen.append(list(map(int, input().split())))
#print(hen)
l=list(range(2, n+1))
for v in itl.permutations(l):
  #print(v)
  for i in range(n-2):
    if not(sorted(v[i:i+2]) in hen) or not(list([1, v[0]]) in hen):
      break
  else:
    if n==2:
      check+=1
    elif i==n-3:
      check+=1
    continue
print(check)
S,T=input().split
print(T+S)

### FIXED CODE ###

S,T=input().split()
print(T+S)
n = input()
d = list(map(int, input().split()))
sum = 0
for i in range(n-1):
  for j in range(i+1, n):
    sum += d[i] * d[j]
print(sum)


### FIXED CODE ###

n = int(input())
d = list(map(int, input().split()))
sum = 0
for i in range(n-1):
  for j in range(i+1, n):
    sum += d[i] * d[j]
print(sum)
n = input()
print("No" if ((n//10) % 111 and (n%1000) % 111) else "Yes")

### FIXED CODE ###

n = int(input())
print("No" if ((n//10) % 111 and (n%1000) % 111) else "Yes")
A,B=input().split()

for x in (A,B):
  if float(x)==int(float(x)):
    x = int(x)
  else:
    x = float(x)

def dicimal2int(d):
  d = str(d)
  if '.' not in d:
    return int(d),0
  if d[:2]=="0.":
    for i in range(2,len(d)):
      if d[i] != '0':
        break
    n_move = len(d)-2
    return int(d[i:]),n_move
  idx = d.index('.')
  n_move = len(d)-idx-1
  return int(d[:idx]+d[idx+1:]),n_move

C1,n1 = dicimal2int(A)
C2,n2 = dicimal2int(B)

D = C1*C2
n = n1+n2

if n==0:
  print(D)
  exit()
  
def int2dicimal(N,n_move):
  if n_move==0:
    return N
  N = str(N)
  for i in range(len(N)):
    if N[-i-1] != '0':
      break
  n_zero = i
  if n_zero>n_move:
    return int(N[:-n_move])
  N = N[:-n_zero]
  n_move -= n_zero
  if len(N)-1>=n_move:
    return float(N[:-n_move]+'.'+N[-n_move:])
  return float("0."+'0'*(n_move-len(N))+N)

print(int(int2dicimal(D,n)))

### FIXED CODE ###

A,B=input().split()
A = int(A)
B = int(float(B)*100+.5)
print(A*B//100)
import numpy
N=int(input())
A=list(map(int,input().split()))
s=numpy.argsort(A)
print(' '.join(s))


### FIXED CODE ###

import numpy as np
N=int(input())
A=list(map(int,input().split()))
s=list(np.argsort(A))
print(' '.join(repr(e+1) for e in s))
n = int(input())
a = map(int, input().split())

for i in range(1, n):
    print(str(n[-i]) + " ", end="")
print(n[0])

### FIXED CODE ###

n = int(input())
a = input().split()

for i in range(1, n):
    print(str(a[-i]) + " ", end = "")
print(a[0])
a,b=map(int, input().split())
print(a//b, a%b, "{0:5f}"/format(a/b))

### FIXED CODE ###

a,b=map(int, input().split())
print(a//b, a%b, "{0:.5f}".format(a/b))
import sys

N = input()

N = N.splitlines()

AC_num = 0
WA_num = 0
TLE_num = 0
RE_num = 0

N_num = int(N[0])

if N_num < 1 or N_num > 100000:
    print('error')
    sys.exit()


for i in range(N_num):
    #print(i+1)
    
    if 'AC' == N[i+1]:
        AC_num += 1
        #print(AC_num)
    
    elif 'WA' == N[i+1]:
        WA_num += 1
        #print(WA_num)

    elif 'TLE' == N[i+1]:
        TLE_num += 1
        #print(TLE_num)
    
    elif 'RE' == N[i+1]:
        RE_num += 1
        #print(RE_num)
        
    else:
        print('nun')

print('AC x',AC_num)
print('WA x',WA_num)
print('TLE x',TLE_num)
print('RE x',RE_num)

### FIXED CODE ###

N_num = int(input())

N = []

for i in range(N_num):
    N.append(input())
    

AC_num = 0
WA_num = 0
TLE_num = 0
RE_num = 0

for i in range(N_num):
    #print(i+1)
    
    if 'AC' == N[i]:
        AC_num += 1
        #print(AC_num)
    
    elif 'WA' == N[i]:
        WA_num += 1
        #print(WA_num)

    elif 'TLE' == N[i]:
        TLE_num += 1
        #print(TLE_num)
    
    elif 'RE' == N[i]:
        RE_num += 1
        #print(RE_num)


print('AC x {}'.format(AC_num))
print('WA x {}'.format(WA_num))
print('TLE x {}'.format(TLE_num))
print('RE x {}'.format(RE_num))
b = int(input())
ans = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
print(ans[b])

### FIXED CODE ###

b = input()
ans = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
print(ans[b])
# coding:utf-8
import functools
import math


def main():
    N = int(input())
    num = list(map(int, input().split()))
    # num.sort()
    # print(num)
    # print(num[0:0])
    gcd = 0
    for i in range(len(num)):
        temp_list = num[0:i]+num[i+1:]
        temp_gcd = functools.reduce(math.gcd, temp_list)
        if temp_gcd > gcd:
            gcd = temp_gcd
    print(gcd)
    # ans = 0
    # print()


if __name__ == "__main__":
    main()


### FIXED CODE ###

# coding:utf-8
import fractions


def main():
    N = int(input())
    # N = 10 ** 5
    num = list(map(int, input().split()))
    # num = list(range(1, 10**5 + 1))
    # num.sort()
    gcd = 0
    gcd_list_front = []
    gcd_list_back = []
    gcd_list_front.append(num[0])
    gcd_list_back.append(num[-1])

    for i in range(1, N-1):
        gcd_list_front.append(fractions.gcd(gcd_list_front[i-1], num[i]))
        gcd_list_back.append(fractions.gcd(gcd_list_back[i-1], num[-i-1]))

    gcd_list_back.reverse()
    # print(gcd_list_front)
    # print(gcd_list_back)

    gcd = max(gcd_list_back[0], gcd_list_front[-1])

    for i in range(0, N-2):
        # print(gcd_list_front[i], gcd_list_back[i+1])
        temp_gcd = fractions.gcd(gcd_list_front[i], gcd_list_back[i+1])
        if temp_gcd > gcd:
            gcd = temp_gcd

    print(gcd)
    # ans = 0
    # print()


if __name__ == "__main__":
    main()
class Tree:
    WHITE = 0
    GRAY = 1
    BLACK = 2

    def __init__(self, adj):
        n = len(adj)
        self.adj = adj
        self.colors = [self.WHITE] * n
        self.depths = [-1] * n
        self.depth = 0

    def dfs(self, u):
        if self.colors[u] == self.BLACK:
            return

        self.colors[u] = self.GRAY
        self.depths[u] = self.depth

        for v, w in self.adj[u]:
            if self.colors[v] == self.WHITE:
                self.depth += w
                self.dfs(v)
                self.depth -= w

        self.colors[u] = self.BLACK


if __name__ == "__main__":
    n = int(input())
    uvw = [list(map(int, input().split())) for _ in range(n - 1)]

    g = [[] for _ in range(n)]

    for u, v, w in uvw:
        u -= 1
        v -= 1
        g[u].append((v, w))
        g[v].append((u, w))

    tree = Tree(g)
    tree.dfs(0)
    ans = [x % 2 for x in tree.depths]
    print(*ans, sep="\n")


### FIXED CODE ###

n = int(input())
uvw = [list(map(int, input().split())) for _ in range(n-1)]

g = [[] for _ in range(n)]

for u, v, w in uvw:
    u -= 1
    v -= 1
    g[u].append([v, w])
    g[v].append([u, w])


WHITE = 0
GRAY = 1
BLACK = 2

ds = [0] * n
colors = [WHITE] * n
ps = [-1] * n


def dfs(s):
    global ds, colors, ps

    stack = []

    ds[s] = 0
    colors[s] = BLACK
    ps[s] = -1
    stack.append(ds[s])

    while stack:
        u = stack[-1]
        colors[u] = GRAY

        for v, w in g[u]:
            if colors[v] == WHITE:
                stack.append(v)
                ds[v] = ds[u] + w
                ps[v] = u
                g[u].remove([v, w])
                g[v].remove([u, w])
                break

        else:
            stack.pop()
            colors[u] = BLACK

    return ds, ps


dfs(0)

for d in ds:
    print(d % 2)
n,m = (int(x) for x in input().split())
friendlist = [0]*(n+1)
classes = 0
for i in range(m):
    a,b = (int(x)-1 for x in input().split())
    if friendlist[a]!=0:
        friendlist[b] = friendlist[a]
    elif friendlist[b]!=0:
        friendlist[a] = friendlist[b]
    else:
        classes += 1
        friendlist[a] = classes
        friendlist[b] = classes

count = [0]*(classes+1)
for i in range(n):
    count[friendlist[i]] += 1
print(max(count[1:]))


### FIXED CODE ###

import os

n,m = (int(x) for x in input().split())

#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)

    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]

#初期化
#根なら-size,子なら親の頂点
par = [-1]*n

for i in range(m):
    a,b = (int(x)-1 for x in input().split())
    unite(a,b)

ans = 0
for i in range(0,n):
    ans = max([ans,size(i)])

print(ans)
import numpy as np

h, n = map(int, input().split())
ab = list(tuple(map(int, input().split())) for _ in range(n))

sa, sb = 0, 0
for _, a, b in sorted((a/b, a, b) for a, b in ab, reversed=True):
    sa += a
    sb += b
    if sa >= h:
        print(sb)
        break


### FIXED CODE ###

import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = np.min(dp[np.maximum(i-a, 0)] + b)

print(dp[h])
from sympy import nextprime

x = int(input())
print(nextprime(x-1))

### FIXED CODE ###

import math
def get_primenumber(number):
    prime_list = []
    search_list = list(range(2,10**6+1))
    while True:
      if search_list[0] > math.sqrt(number):
        prime_list.extend(search_list)
        break
      else:
        head_num = search_list[0]
        prime_list.append(head_num)
        search_list.pop(0)
        search_list = [num for num in search_list if num % head_num != 0]
    return prime_list

x = int(input())
h = get_primenumber(x)
for i in h:
    if i >= x:
        print(i)
        exit()
a = int(input())
b = int(input())

print("%d %d"%(a*b)%(2*a+2*b))

### FIXED CODE ###

a,b = map(int, raw_input().split())
c = a*b
d = 2*(a+b)
print'%d %d'%(c,d)
A, B, C = map(int, input().split())

Z = N/X-N%X
time = Z*T

print(time)

### FIXED CODE ###

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

if A%B == 0:
	Z = A//B
else :
    Z = A//B + 1
time = Z*C

print(time)
import numba
import numpy as np
N = int(input())
P = np.array([int(c)-1 for c in input().split()])

#from random import shuffle
#N = 500
#P = list(range(N*N))
#shuffle(P)
#P = np.array(P)

@numba.njit("i8(i8,i8[:])")
def proc(N, P):
    ans = 0
    Removed = np.zeros((500, 500), dtype=np.int8)
    Mat = np.zeros((500, 500), dtype=np.int16)
    Dy, Dx = [1,0,-1,0], [0,1,0,-1]

    for y in range(N):
        for x in range(N):
            Mat[y, x] = min(y, N-1-y, x, N-1-x)
    #print(Mat)
    Buf = [(0, 0) for _ in range(1<<16)]
    Buf_idx = 0
    for i in range(N*N):
        p = P[i]
        y, x = divmod(p, N)
        ans += Mat[y,x]
        Removed[y,x] = 1
        Buf[Buf_idx] = (y, x)
        Buf_idx += 1
        while Buf_idx:
            Buf_idx -= 1
            vy, vx = Buf[Buf_idx]
            vr = Removed[vy,vx]
            val = Mat[vy,vx]
            #for dy, dx in zip(Dy, Dx):
            for j in range(4):
                uy, ux = vy + Dy[j], vx + Dx[j]
                if not (0<=uy<N and 0<=ux<N):
                    continue
                ur = Removed[uy,ux]
                if vr:
                    if Mat[uy,ux] >= val+1:
                        Mat[uy,ux] = val
                        Buf[Buf_idx] = (uy, ux)
                        Buf_idx += 1
                else:
                    if Mat[uy,ux] >= val+2:
                        Mat[uy,ux] = val+1
                        Buf[Buf_idx] = (uy, ux)
                        Buf_idx += 1
    # for m in Mat:
    #     print(m)
    return ans
print(proc(N, P))



### FIXED CODE ###

import numba
import numpy as np
N = int(input())
P = np.array([int(c)-1 for c in input().split()])

#from random import shuffle
#N = 500
#P = list(range(N*N))
#shuffle(P)
#P = np.array(P)

@numba.njit("void(i8,i8[:])")
def proc(N, P):
    ans = 0
    Removed = np.zeros((500, 500), dtype=np.int8)
    Mat = np.zeros((500, 500), dtype=np.int16)
    Dy, Dx = [1,0,-1,0], [0,1,0,-1]

    for y in range(N):
        for x in range(N):
            Mat[y, x] = min(y, N-1-y, x, N-1-x)
    #print(Mat)
    for i in range(N*N):
        p = P[i]
        y, x = divmod(p, N)
        ans += Mat[y,x]
        Removed[y,x] = 1
        st = [(y, x)]
        while st:
            vy, vx = st.pop()
            vr = Removed[vy,vx]
            val = Mat[vy,vx]
            #for dy, dx in zip(Dy, Dx):
            for j in range(4):
                dy = Dy[j]
                dx = Dx[j]
                uy = vy + dy
                ux = vx + dx
                if not (0<=uy<N and 0<=ux<N):
                    continue
                ur = Removed[uy,ux]
                if vr:
                    if Mat[uy,ux] >= val+1:
                        Mat[uy,ux] = val
                        st.append((uy, ux))
                else:
                    if Mat[uy,ux] >= val+2:
                        Mat[uy,ux] = val+1
                        st.append((uy, ux))
    # for m in Mat:
    #     print(m)
    print(ans)
proc(N, P)
s=input()
K=int(input())
 
ans=[]
ans.append(s)
 
 
for i in range(len(s)):
 for j in range(len(s)-i):
  cut_s=s[i:i+j+1]
  if cut_s not in ans:
   ans.append(cut_s)
   ans.sort()
   if len(ans)>K:
    if cut_s==s[K]:
      ans.pop()
      break;
    ans.pop()
 
answer=ans[K-1]
print(answer)

### FIXED CODE ###

s=input()
K=int(input())
 
ans=[]
ans.append(s)
 
 
for i in range(len(s)):
 for j in range(len(s)-i):
  cut_s=s[i:i+j+1]
  ans.append(cut_s)
  ans=sorted(set(ans))
  if len(ans)>K:
   if cut_s==ans[K]:
     ans.pop()
     break;
   ans.pop()
 
answer=ans[K-1]
print(answer)
def examA():
    N = I()
    S = SI(); T = SI()
    ans = 2*N
    for l in range(N-1,-1,-1):
        flag = True
        for i in range(l+1):
            if S[N-1-i] != T[l-i]:
                flag = False
                break
        if flag:
            ans -=(l+1)
            break
    print(ans)
    return

def examB():
    N, x = LI()
    d = defaultdict(bool)
    if x==1 or x==2*N-1:
        print("No")
        return
    if N>=3 and (x==2 or x==2*N-2):
        print("No")
        return
    print("Yes")
    ans = [0]*(2*N-1)
    ans[N-1] = x
    d[x] = True
    for i in range(2):
        ans[N+i] = x+1+i
        ans[N-2-i] = x-1-i
        d[x+1+i] = True
        d[x-1-i] = True
    print(d); print(ans)
    cur = 0
    for j in range(N-3):
        while(d[cur]):
            cur +=1
        ans[j] = cur
        cur +=1
    for j in range(N+2,2*N-1):
        while(d[cur]):
            cur +=1
        ans[j] = cur
        cur +=1
    for v in ans:
        print(v)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()


### FIXED CODE ###

def examA():
    N = I()
    S = SI(); T = SI()
    ans = 2*N
    for l in range(N-1,-1,-1):
        flag = True
        for i in range(l+1):
            if S[N-1-i] != T[l-i]:
                flag = False
                break
        if flag:
            ans -=(l+1)
            break
    print(ans)
    return

def examB():
    N, x = LI()
    d = defaultdict(bool)
    if x==1 or x==2*N-1:
        print("No")
        return
    print("Yes")
    ans = [0]*(2*N-1)
    ans[N-1] = x
    d[x] = True

    ans[N] = x+1
    ans[N-2] = x-1
    d[x+1] = True
    d[x-1] = True
#    print(d); print(ans)
    cur = 1
    for j in range(N-2):
        while(d[cur]):
            cur +=1
        ans[j] = cur
        cur +=1
    for j in range(N+1,2*N-1):
        while(d[cur]):
            cur +=1
        ans[j] = cur
        cur +=1
    for v in ans:
        print(v)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()
#AGC018 A
import math

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

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

if K in A:
    print("POSSIBLE")
elif K<=MAX:
    GCD = A[0]
    for a in A[1:]: GCD = math.gcd(GCD,a)
    if K%GCD==0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

#AGC018 A
import fractions

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

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

if K in A:
    print("POSSIBLE")
elif K<=MAX:
    GCD = A[0]
    for a in A[1:]: GCD = fractions.gcd(GCD,a)
    if K%GCD==0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
else:
    print("IMPOSSIBLE")
s1,s2,s3,s4,s5,s6=input()
#print(S)
if(s3==s4):
  if(s5==s6):
    ans='Yes'
else:
  ans='No'
print(ans)


### FIXED CODE ###

s1,s2,s3,s4,s5,s6=input()
#print(S)
ans='No'
if(s3==s4):
  if(s5==s6):
    ans='Yes'
else:
  ans='No'
print(ans)
import sys
a = map(int, input().split())
k = range(1,a)
for s in k:
 res = a/k
 if isinstance(res, int):
  if len(k) == 1:
   if len(res) == 1:
    #print(res,k)
    print("Yes")
    sys.exit()
print("No")

### FIXED CODE ###

import sys
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()
a = input()
a = int(a)
if  a == 1:
 print("Yes")
 sys.exit()
k = range(1,a)
for s in k:
 res = a/s
 #print("s",s)
 #print("res",res)
 try:
  res = int(res)
 except:
  break
 if is_integer(s):
  if is_integer(res):
   if len(str(s)) == 1:
    if len(str(res)) == 1:
     #print(res,s)
     if res * s == a:
      print("Yes")
      sys.exit() 
print("No")
lis=list(map(int,input().split()))
mod=(10**9)+7
import math
for i in range(1,lis[1]+1):
    ans=int(math.factorial(lis[0]-lis[1]+1)/(math.factorial(i)*math.factorial(lis[0]-lis[1]-i+1)))%mod
    ans*=int(math.factorial(lis[1]-1)/(math.factorial(i-1)*math.factorial(lis[1]-i)))%mod
    print(ans)


### FIXED CODE ###

lis=list(map(int,input().split()))
mod=(10**9)+7
pascal=[]
#print(lis[0]-lis[1]+1,lis[1]-1)
rank=max(lis[0]-lis[1]+1,lis[1]+1)
for i in range(rank):
    pascal.append([])
    for j in range(i+2):
        if j==0 or j==i+1:
            pascal[i].append(1)
        else:
            pascal[i].append(pascal[i-1][j-1]+pascal[i-1][j])
#print(len(pascal[-1]))
for i in range(1,1+lis[1]):
    if i<=lis[0]-lis[1]+1:
        ans=pascal[lis[0]-lis[1]][i]*pascal[lis[1]-2][i-1]%mod
    else:
        ans=0
    print(ans)