TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
n, k = map(int, input().split())
l = list(map(int, input().split()))
m = max(a)
def hcf(x, y): 
    while(y): 
        x, y = y, x % y 
    return x 
num1=l[0] 
num2=l[1] 
gcd=hcf(num1,num2) 
for i in range(2,len(l)): 
    gcd=hcf(gcd,l[i])
if k%gcd == 0 and k<=m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

import math
from functools import reduce
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
def hcf(l):
    return reduce(math.gcd, l)
gcd = hcf(A)
m = max(A)
if k%gcd == 0 and k<=m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
n,k=map(int,input().split())
A=list(map(int,input().split()))
yes="POSSIBLE" ; no="IMPOSSIBLE"
import numpy as np
q= np.gcd.reduce(A)
if k%q==0 and max(A)-min(A)>=k:
    print(yes)
else:
    print(no)

n,k=map(int,input().split())
A=list(map(int,input().split()))
yes="POSSIBLE" ; no="IMPOSSIBLE"
import numpy as np
q= np.gcd.reduce(A)
if k%q==0 and max(A)>=k:
    print(yes)
else:
    print(no)

Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):

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

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

A.sort()

if A[-1] < K:
    print("IMPOSSIBLE")
    exit()

if K in A or 1 in A:
    print("POSSIBLE")
    exit()

def gcd(a,b):
    x = max([a,b])
    y = min([a,b])
    while y:
        x, y = y, x % y
    return x

g = A[0]
for i in range(1,N):
    g = gcd(A[i], g)
    

print("POSSIBLE" ig K % g == 9 else "IMPOSSIBLE")

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

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

A.sort()

if A[-1] < K:
    print("IMPOSSIBLE")
    exit()

if K in A or 1 in A:
    print("POSSIBLE")
    exit()

def gcd(a,b):
    x = max([a,b])
    y = min([a,b])
    while y:
        x, y = y, x % y
    return x

g = A[0]
for n in A[1:]:
    g = gcd(n, g)
    

print("POSSIBLE" if K % g == 0 else "IMPOSSIBLE")

Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd, ceil, atan, pi
def input(): return sys.stdin.readline()[:-1] # warning not \n


import string

from bisect import bisect_left, bisect_right
from functools import lru_cache, reduce
MOD = int(1e9)+7
INF = float('inf')


def solve():
    # n = int(input())
    n, k = [int(x) for x in input().split()]
    a = [int(x) for x in input().split()]
    g = reduce(gcd, a)
    print(g)
    m = max(a)
    if k <= m and k % g == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""
1
4
-1 1 1 -1

"""


# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd, ceil, atan, pi
def input(): return sys.stdin.readline()[:-1] # warning not \n


import string

from bisect import bisect_left, bisect_right
from functools import lru_cache, reduce
MOD = int(1e9)+7
INF = float('inf')


def solve():
    # n = int(input())
    n, k = [int(x) for x in input().split()]
    a = [int(x) for x in input().split()]
    g = reduce(gcd, a)

    m = max(a)
    if k <= m and k % g == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""
1
4
-1 1 1 -1

"""


Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
N,K = (int(i) for i in input().split())
A = [int(i) for i in input().split()]

makable = False
if max(A) < K:
    makable = False
elif K in A:
    makable = True

if makable:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
    

def euclid(x,y):
    a = max(x,y)
    b = min(x,y)
    
    r =  a % b
    while r != 0:
        a = b
        b = r
        r = a % b

    return b


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

if N == 1:
    if K == A[0]:
        ans = 'POSSIBLE'
    else:
        ans = 'IMPOSSIBLE'
else:
    
    M = max(A)
    G = euclid(A[0],A[1])
    for i in range(1,N):
        G = euclid(A[i],G)
    
    if K % G == 0 and K <= M:
        ans = 'POSSIBLE'
    else:
        ans = 'IMPOSSIBLE'
    
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
n,k=map(int,input().split())
a=list(map(int,input().split()))
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
ans=a[0]
for i in range(1,n):
    ans=gcd(ans,a[i])
if ans%k==0:
    if k<max(a):
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")



n,k=map(int,input().split())
t=list(map(int,input().split()))
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
ans=t[0]
for i in range(n):
    ans=gcd(ans,t[i])
if k%ans==0:
    if k<=max(t):
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")


Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
def gcd(a,b):
    if b == 0:
        return abs(a)
    else:
        return gcd(b, a%b)

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

Im = 'IMPOSSIBLE'
Po = 'POSSIBLE'

if A[-1] < K:
    print(Im)
else:
    for i in range(N):
        if i == 0:
            gcd = gcd(A[i], A[i])
        else:
            gcd = gcd(A[i],gcd)
    if K%gcd == 0:
        print('Po')
    else:
        print('Im')


def gcd(a,b):
    if b == 0:
        return abs(a)
    else:
        return gcd(b, a%b)

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

Im = 'IMPOSSIBLE'
Po = 'POSSIBLE'

if max(A) < K:
    print(Im)
else:
    for i in range(N):
        if i == 0:
            tmp = gcd(A[i], 0)
        else:
            tmp = gcd(A[i],tmp)
        if tmp == 1:
            break
    if K%tmp == 0:
        print(Po)
    else:
        print(Im)


Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
from functools import reduce, gcd

def main():
  n, k = map(int, input().split())
  la = list(map(int, input().split()))
  if max(la) > k and (max(la) - k) % (reduce(gcd, la)) == 0:
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')
  
if __name__=='__main__':
  main()

#!/usr/bin/python3
# -*- coding:utf-8 -*-

from functools import reduce

def calc_gcd(a, b):
  if a > b:
    a, b = b, a
  while b % a:
    a, b = b % a, a
  return a

def main():
  n, k = map(int, input().split())
  la = list(map(int, input().split()))
  if max(la) >= k and k % (reduce(calc_gcd, la)) == 0:
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')
  
if __name__=='__main__':
  main()



Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(1,n):
    a[0]=gcd(a[0],a[i])
if k%a[0]==0 and k-a[0]<=max(a):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

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

n,k=map(int,input().split())
a=list(map(int,input().split()))
x=max(a)
for i in range(1,n):
    a[0]=gcd(a[0],a[i])
if k%a[0]==0 and k<=x:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
N, K = map(int, input().split())
A = list(map(int, input().split()))

def gcd(x, y):
    if x > y:
        x, y = y, x
    if y % x == 0:
        return x
    y = y % x
    return gcd(x, y)

n = A[0]
for i in A:
    n = gcd(n, i)

flag = False
for i in A:
    if i > K and (i - K) % n == 0:
        flag = True
        break
    else:
        pass

if flag:
    print ('POSSUBLE')
else:
    print ('IMPOSSIBLE') 

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

def gcd(x, y):
    if x > y:
        x, y = y, x
    if y % x == 0:
        return x
    y = y % x
    return gcd(x, y)

n = A[0]
for i in A:
    n = gcd(n, i)

flag = False
for i in A:
    if i >= K and (i - K) % n == 0:
        flag = True
        break
    else:
        pass

if flag:
    print ('POSSIBLE')
else:
    print ('IMPOSSIBLE') 

Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()

    def gcd(x,y):
    r = x%y
    if r==0:
        return y
    return gcd(y, r)

    n, k =map(int, input().split())
    a = list(map(int, input().split()))
    a.sort(reverse=True)
    c = a[0]
    for i in range(n):
        c = gcd(a[i], c)
    if k%c == 0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')
    

    
if __name__ == '__main__':
    main()

def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()

    def gcd(x,y):
        r = x%y
        if r==0:
            return y
        return gcd(y, r)

    n, k =map(int, input().split())
    a = list(map(int, input().split()))
    a.sort(reverse=True)
    c = a[0]
    for i in range(n):
        c = gcd(a[i], c)
    if k%c == 0 and k <= a[0]:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')
    

    
if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
n, k = map(int, input().split())
a = list(map(int, input().split())) 
a.sort()
a.reverse() 
x = a[0]   
for i in range (1, N):
  while a[i] != 0:
    x , a[i] = a[i] , x % a[i]
if K > a[0]:
  print('IMPOSSIBLE')
else:
  print('POSSIBLE' if K%x == 0 else 'IMPOSSIBLE')

N,K = map(int, input().split())
A = list(map(int, input().split())) 
A.sort()
A.reverse() 
x = A[0]   
for i in range (1, N):
  while A[i] != 0:
    x , A[i] = A[i] , x % A[i]
if K > A[0]:
  print('IMPOSSIBLE')
else:
  print('POSSIBLE' if K%x == 0 else 'IMPOSSIBLE')

Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
def main():
    import math
    n,k=map(int,input().split(" "))
    a=map(int,input().split(" "))
    g=a[0]
    m=max(a)
    for i in range(n):
        g=math.gcd(g,a[i])
    if k % g==0 and k<=m:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

main()

def gcd(a,b):
    if a==0: return b
    else: return gcd(b%a,a)

def main():
    n,k=map(int,input().split(" "))
    a=list(map(int,input().split(" ")))
    g=a[0]
    m=a[0]
    for e in a:
        g=gcd(g,e)
        if m<e: m=e
    if k % g==0 and k<=m:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

main()

Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
def factor(N):
    ret = []
    i = 2
    while N > 1:
        if N % i == 0:
            ret.append(i)
            N //= i
        else:
            i += 1
    return ret

from collections import Counter


def solve(N, K, As):
    if K > max(As):
        return "IMPOSSIBLE"
    factors = [Counter(factor(a)) for a in As]

if __name__ == "__main__":
    N, K = tuple(map(int, input().split(" ")))
    As = list(map(int, input().split(" ")))
    print(solve(N, K, As))


def factor(N):
    ret = []
    i = 2
    while N > 1:
        if N % i == 0:
            ret.append(i)
            N //= i
        else:
            i += 1
    return ret


assert (factor(4) == [2, 2])
assert (factor(2) == [2])
assert (factor(3) == [3])
assert (factor(10) == [2, 5])

from collections import Counter


def solve(N, K, As):
    if K > max(As):
        return "IMPOSSIBLE"
    iter = Counter(factor(min(As)))
    for a in As:
        for k, v in iter.items():
            if a % k != 0:
                iter[k] = 0
            else:
                count = 0
                kk = k
                while a % kk == 0:
                    kk *= k
                    count += 1
                iter[k] = min(v, count)

    if all([v == 0 for v in iter.values()]):
        return "POSSIBLE"
    else:
        d = 1
        for k, v in iter.items():
            if v != 0:
                d *= k ** v
        if K % d == 0:
            return "POSSIBLE"
    return "IMPOSSIBLE"


if __name__ == "__main__":
    N, K = tuple(map(int, input().split(" ")))
    As = list(map(int, input().split(" ")))
    print(solve(N, K, As))


Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
n,k = map(int,input().split())
l = sorted(list(map(int,input().split())))
if l[-1] > k:
    print("IMPOSSIBLE")
    exit()
x = l[0]
for i in range(1,n):
    if l[i]%x:
        print("POSSIBLE")
        exit()

if k in l:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

import math
n,k = map(int,input().split())
l = list(map(int,input().split()))
if max(l) < k:
    print("IMPOSSIBLE")
    exit()

x = l[0]
for i in l:
    x = math.gcd(x,i)

if k%x:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")



Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))


if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
if k in seta:
    print('POSSIBLE')
    sys.exit(0)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % sorteda[0])
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.sort()
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')

n, k = map(int, input().split())
a = list(map(int, input().split()))
def f(l, s):
    return s if l % s == 0 else f(s, l % s)

z = f(max(a), min(a))
for i in a:
    z = f(i, z)
if max(a) >= k and k % z == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):









n, k = map(int, input().split())
arr = sorted(list(set(list(map(int, input().split())))))
n = len(arr)
if arr[0] == 1:
    print("POSSIBLE")
    exit()
if n < 2 or arr[-1] < k:
    print("IMPOSSIBLE")
    exit()


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


tmp = gcd(arr[0], arr[1])
flag = True
for i in range(2, n):
    g = gcd(tmp, arr[i])
    if g != tmp:
        flag = False
if flag:
    print("IMPOSSIBLE")
    exit()
odds, evens = False, False
for a in arr:
    if a % 2 == 0:
        evens = True
    else:
        odds = True
if evens and odds:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")












n, k = map(int, input().split())
arr = sorted(list(set(list(map(int, input().split())))))
n = len(arr)
if arr[0] == 1 or k in arr:
    print("POSSIBLE")
    exit()
if n < 2 or arr[-1] < k:
    print("IMPOSSIBLE")
    exit()


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


tmp = gcd(arr[0], arr[1])

if tmp == 1:
    print("POSSIBLE")
    exit()
flag = True
for i in range(2, n):
    g = gcd(tmp, arr[i])
    if g != tmp or g == 1:
        flag = False
        break

if flag and k % tmp != 0:
    print("IMPOSSIBLE")
    exit()

even_flag, odd_flag = False, False
for a in arr:
    if a % 2 == 1:
        odd_flag = True
    else:
        even_flag = True


if odd_flag:
    if k % 2 == 0 and not even_flag:
        print("IMPOSSIBLE")
    else:
        print("POSSIBLE")
    exit()


if k % 2 == 1:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")


Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), returned=True))

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

if K>max(A):
	print("IMPOSSIBLE")
	exit(0)

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")

N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

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

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")

Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
n,k=map(int,input().split())
l=list(map(int,input().split()))
def gcd(n,m):
  a=max(n,m)
  b=min(n,m)
  while b!=0:
    a,b=b,a%b
  return a
g=l[0]
max=l[0]
for i in range(1,1+n-1):
  g=gcd(g,l[i])
  if max<l[i]:
    max=l[i]
if max<k:
  print("POSSIBLE")
elif max==k:
  print("POSSIBLE")
else:
  if k%g==0:
    print("POSSIBLE")
  else:
    print("IMPOSSIBLE")

n,k=map(int,input().split())
l=list(map(int,input().split()))
def gcd(n,m):
  if n>m:
    a=n
    b=m
  else:
    a=m
    b=n
  while b!=0:
    a,b=b,a%b
  return a
g=l[0]
max=l[0]
for i in range(1,1+n-1):
  g=gcd(g,l[i])
  if max<l[i]:
    max=l[i]
if max<k:
  print("IMPOSSIBLE")
elif max==k:
  print("POSSIBLE")
else:
  if k%g==0:
    print("POSSIBLE")
  else:
    print("IMPOSSIBLE")


Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):

# Created: Mon Mar 23 15:10:04 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

import numpy as np

n, k = na()
a = np.array(na())

g = np.gcd.reduce(a)
m = np.amax(a)
if g == 1 and k <= m:
    print("Yes")
elif k % g == 0 and k <= m:
    print("Yes")
else:
    print("No")


# Created: Sun Mar 22 17:06:57 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

n, k = na()
a = na()

def gcd(m, n):
    if n == 0:
        return m
    else:
        return gcd(n, m % n)

g = a[0]
for i in range(n):
    g = gcd(g, a[i])

m = max(a)
if g == 1 and k <= m:
    print("POSSIBLE")
elif k % g == 0 and k <= m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
# -*- coding: utf-8 -*-
N, A = map(int, input().split())
tmp = input()
ary = [int(a) for a in tmp.split()]

maximum = max(ary)


def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


g = None
for a in ary:
    if g is None:
        g = a
        continue
    g = gcd(g, a)
    print(g)

if A % g == 0 and A <= maximum:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


# -*- coding: utf-8 -*-
N, M = map(int, input().split())
arys = []
for i in range(N):
    tmp = input()
    ary = [int(a) - 1 for a in tmp.split()]
    arys.append(ary)


s = set([i for i in range(M)])
min_num = None
while len(s) > 0:
    dic = {}
    for ary in arys:
        del_i = None
        for i, a in enumerate(ary):
            if a in s:
                if a not in dic:
                    dic[a] = 1
                else:
                    dic[a] += 1
                break
            del_i = i
        if del_i is not None:
            ary = ary[del_i + 1:]
    max_v = None
    max_k = None
    for k, v in dic.items():
        if max_v is None or max_v < v:
            max_v = v
            max_k = k
    if min_num is None or min_num > max_v:
        min_num = max_v
    s.remove(max_k)
print(min_num)


# -*- coding: utf-8 -*-
N, A = map(int, input().split())
tmp = input()
ary = [int(a) for a in tmp.split()]

maximum = max(ary)


def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


g = None
for a in ary:
    if g is None:
        g = a
        continue
    g = gcd(g, a)

if A % g == 0 and A <= maximum:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
# import math
import fractions
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a = sorted(a)
div = fractions.gcd(a[0], a[1])
for i in range(2, n):
    div = fractions.gcd(a[i], a[i-1])
if k % div == 0 and k <= a[-1]:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


# import math
import fractions
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a = sorted(a)
if n == 1:
    if a[0] == k:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
div = fractions.gcd(a[0], a[1])
for i in range(n):
    if a[i] == k:
        print("POSSIBLE")
        exit()
    elif i >= 2:
        div = fractions.gcd(a[i], a[i-1])
if k % div == 0 and k <= a[-1]:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


# import math
import fractions
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a = sorted(a)

if n == 1:
    if a[0] == k:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
div = a[0]
for i in range(1, n):
    div = fractions.gcd(div, a[i])

if k % div == 0 and k <= a[-1]:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


# import math
# import fractions
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a = sorted(a)

div = a[0]
for i in range(1, n):
    div = gcd(div, a[i])

if k % div == 0 and k <= a[-1]:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
N,K=map(int,input().split())

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

def gcd(a,b):
    x=max(a,b)
    y=min(a,b)
    while x%y!=0:
        x,y=y,x%y
    return y
    
Num=A[0]

for i in range(N):
    Num=gcd(Num,A[i])
    
if K%Num==0:
    if K>Num:
        print("IMPOSSIBLE")
    else:
        print("POSSIBLE")
else:
    print("IMPOSSIBLE")

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

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

def gcd(a,b):
    x=max(a,b)
    y=min(a,b)
    while x%y!=0:
        x,y=y,x%y
    return y
    
Num=A[0]

for i in range(N):
    Num=gcd(Num,A[i])
    
if K%Num==0:
    if K>max(A):
        print("IMPOSSIBLE")
    else:
        print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
Traceback (most recent call last):
  File "C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py", line 13, in <module>
    print(gcd_list(a))
  File "C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py", line 9, in gcd_list
    for i in range(len(n)):
NameError: name 'n' is not defined
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
None

======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
6

======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
6

======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
3

======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
3 7
9 3 4
Traceback (most recent call last):
  File "C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py", line 19, in <module>
    if A[-1] > k and (A[-1] - k) % gcd_lst(A) == 0:
NameError: name 'gcd_lst' is not defined
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
3 7
9 3 4
POSSIBLE
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
3 5
6 9 3
IMPOSSIBLE
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
4 11
11 3 7 15
POSSIBLE
>>> 
======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py =======
5 12
10 2 8 6 4
IMPOSSIBLE
>>> 

def gcd(a, b):
    if  b == 0:
        return a
    else:
        return gcd(b, a % b)

def gcd_list(a):
    x = a[0]
    for i in range(len(a)):
        x = gcd(a[i], x)
    return x
        

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

ans = 'IMPOSSIBLE'
A.sort()
if A[-1] >= k and (A[-1] - k) % gcd_list(A) == 0:
    ans = 'POSSIBLE'

print(ans)


Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
# -*- coding: utf-8 -*-
#AGC014A
import sys
#import collections

#n= int(input())

tmp = input().split()
n,k = list(map(lambda a: int(a), tmp))

tmp = input().split()
a = list(map(lambda a: int(a), tmp))

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

maxa=a[0]
tmp=a[0]
for i in range(1,n):
	maxa=max(maxa,a[i])
	tmp=gcd(tmp, a[i])

if(k<=m)and(k%tmp ==0):
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")

#print(maxa)
#print(tmp)




# -*- coding: utf-8 -*-
#AGC014A
import sys
#import collections

#n= int(input())

tmp = input().split()
n,k = list(map(lambda a: int(a), tmp))

tmp = input().split()
a = list(map(lambda a: int(a), tmp))

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

maxa=a[0]
tmp=a[0]
for i in range(1,n):
	maxa=max(maxa,a[i])
	tmp=gcd(tmp, a[i])

if(k<=maxa)and(k%tmp ==0):
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")

#print(maxa)
#print(tmp)




Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
def gcd(a,b):
    while b > 0:
        a, b = b, a%b
    return a

def gcd_list(lst):
    a = gcd(lst[0],lst[1])
    i=2
    while a > 0 and i<len(lst):
        a = gcd(a, lst[i])
        if a == 1:
            return 1
            break
        i+=1
    return a
    
n, k = (int(i) for i in input().split())
print(n,k)
a = list(int(i) for i in input().split())  
print(a)
maxA=max(a)

if maxA >= k and gcd_list(a)%k == 0:
    print("POSSIBLE")
elif k in a:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
    

# coding: utf-8
# Here your code !
def gcd(a,b):
    while b > 0:
        a, b = b, a%b
    return a

def gcd_list(lst):
    a = gcd(lst[0],lst[1])
    i=2
    while a > 0 and i<len(lst):
        a = gcd(a, lst[i])
        if a == 1:
            return 1
            break
        i+=1
    return a
    
n, k = (int(i) for i in input().split())
a = list(int(i) for i in input().split())  
maxA=max(a)

if maxA >= k and gcd_list(a)%k == 0:
    print("POSSIBLE")
elif k in a:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
    

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

def gcd_list(lst):
    g = lst[0]
    for i in range(1,len(lst)):
        g = gcd(g,lst[i])
    return g
    
n, k = (int(i) for i in input().split())
a = list(int(i) for i in input().split())  

maxA=max(a)

if (k <= maxA and k%gcd_list(a) == 0) or (k in a):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
    

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
a,b=map(int, input().split())
x = list(map(int, input().split()))
x.sort()
p=0
q=0
y=0
for i in x:
    if p == 1 and q == 1:break
    if i == b:
        y=1
    if i%2==0:
        p=1
    else:
        q=1
if b<=x[-1]:
    if((b%2==0 and(p*q ==0))or(p==1 and q==1)):
        m="POSSIBLE"
if y==1:m="POSSIBLE"
else:m="IMPOSSIBLE" 
print(m)

N,K= map(int, input().split())
x = list(map(int, input().split()))
x = list(set(x))
x.sort()
t = max(x)
y = x[0]
s = [1000000000000]
o=0
if x[0] == K:o=1
for i in range(1,len(x)):
    s.append(x[i]-x[i-1])
    if x[i] == K:o = 1
s.sort()
m = min(y,s[0])
if (t>= K and K%m==0) or o==1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")



Verdicts: Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
a,b = map(int,input().split())
nn = list(map(int,input().split()))
nnn = nn.copy()

if b in nn:
    print('POSSIBLE')
    exit()
if b > max(nn):
    print("IMPOSSIBLE")
    exit()
len_nn = [0]
while 1:
    lnn = len(nn)
    for x in range(len(nn)):
        for y in range(len(nn) - x -len_nn):
            y = len(nn)-y-1
            #print(x,y)
            num = abs(x-nn[y])
            if num == b or num == 1:
                print('POSSIBLE')
                exit()
            elif num not in nn and num != 0:
                nn.append(num)
    len_nn += lnn
    if nn == nnn:
        print('IMPOSSIBLE')
        exit()


a,b = map(int,input().split())
nn = list(map(int,input().split()))
nnn = nn.copy()
if b in nn:
    print('POSSIBLE')
    exit()
if b > max(nn):
    print("IMPOSSIBLE")
    exit()

while 1:
    for x in range(len(nn)):
        for y in range(len(nn) - x):
            y = len(nn)-y-1
            #print(x,y)
            num = abs(x-nn[y])
            if num == b:
                print('POSSIBLE')
                exit()
            elif num not in nn:
                nn.append(num)
    if nn == nnn:
        print('IMPOSSIBLE')
        exit()


def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(a): return "".join(list(map(str, a)))

n,k = rli()
A = rli()

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

b = 0
for a in A:
    b  = gcd(a, b)

if k%b or k > max(A):
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
import collections
N, K = map(int, input().split())
A = list(map(int, input().split()))
if K in A:
    print("POSSIBLE")
else:
    diff = collections.defaultdict(int)
    A.sort()
    idx = N - 1
    if K > A[-1]:
        print("IMPOSSIBLE")
    else:
        for i in range(N-1):
            if A[i] > K and idx == N - 1:
                idx = i
            diff[A[i+1] - A[i]] += 1

        diff_list = list(diff.keys())
        if 1 in diff_list:
            print("POSSIBLE")
            print("hoge")
            exit(0)
        diff_list.sort()

        for i in range(idx, N):
            for j in range(len(diff_list)):
                if (K - A[i]) % diff_list[j] == 0:
                    print("POSSIBLE")
                    exit(0)
        print("IMPOSSIBLE")


import collections
N, K = map(int, input().split())
A = list(map(int, input().split()))
if K in A:
    print("POSSIBLE")
    exit(0)
else:
    diff = collections.defaultdict(int)
    A.sort()
    idx = N - 1
    if K > A[-1]:
        print("IMPOSSIBLE")
        exit(0)
    else:
        for i in range(N-1):
            if A[i] > K and idx == N - 1:
                idx = i
            if A[i+1] - A[i] != 0:
                diff[A[i+1] - A[i]] += 1

        diff_list = list(diff.keys())
        if 1 in diff_list:
            print("POSSIBLE")
            exit(0)
        else:
            diff_list.sort()
            for i in range(idx, N):
                for j in range(len(diff_list)):
                    if (K - A[i]) % diff_list[j] == 0:
                        print("POSSIBLE")
                        exit(0)
            print("IMPOSSIBLE")
            exit(0)


Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
a, b = map(int, input().split())
array = list(map(int, input().split()))
impossible = "IMPOSSIBLE"
possible = "POSSIBLE"

if a == 1:
    if b == array[0]:
        print(possible)
    else:
        print(impossible)
    exit(0)

array.sort()
array = list(set(array))

btw = [v1 - v2 for v1, v2 in zip(array[1:], array[0:])]
n = sorted(btw)[0]

same = len(set(btw)) == 1 or all([v % n == 0 for v in btw])

if b in array:
    print(possible)
elif array[-1] < b:
    print(impossible)
elif same and (b - array[0]) % n == 0:
    print(possible)
else:
    print(impossible)


a, b = map(int, input().split())
array = list(map(int, input().split()))
impossible = "IMPOSSIBLE"
possible = "POSSIBLE"

array = list(set(array))

if len(array) == 1:
    if b == array[0]:
        print(possible)
    else:
        print(impossible)
    exit(0)

array.sort()

btw = [v1 - v2 for v1, v2 in zip(array[1:], array[0:])]
n = sorted(btw)[0]

same = len(set(btw)) == 1 or all([v % n == 0 for v in btw])

if b in array:
    print(possible)
elif array[-1] < b:
    print(impossible)
elif same and (b - array[0]) % n == 0:
    print(possible)
else:
    print(impossible)


Verdicts: Runtime Error

Accepted
Problem: There is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the following operation any number of times:    * Take out two balls from the box. Then, return them to the box along with a new ball, on which the absolute difference of the integers written on the two balls is written.  Determine whether it is possible for Snuke to reach the state where the box contains a ball on which the integer K is written.

Submission attempts (in order):
X, Y, Z = list(map(int, input().split(" ")))

import numpy as np

ABC = []

for i in range(X+Y+Z):
    ABC.append(list(map(int, input().split(" "))))

ABC = sorted(ABC, key=lambda row: row[0]-row[1])    

ans = 0

ABC_bk = ABC_np[:Y]
ABC_ak = ABC_np[Y:]

for k in range(Y, Y+Z):
    
    ABC_bk = ABC_bk + ABC_ak[0]
    ABC_ak = ABC_ak.pop(0)
    
    
    before_k = np.asarray(sorted(ABC_bk.tolist(), key=lambda row: row[1]-row[2]))
    after_k = np.asarray(sorted(ABC_ak.tolist(), key=lambda row: row[0]-row[2]) )      
    
    bk_sum = before_k[-Y:].sum(axis=0)[1] + before_k[:-Y].sum(axis=0)[2]
    ak_sum = after_k[-X:].sum(axis=0)[0] + after_k[:-X].sum(axis=0)[2]
    
    tmp = ak_sum + bk_sum
                          
    if ans < tmp:
        ans = tmp
    
print (ans)

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

A = list(map(int, input().split(" ")))

ans = False

A = sorted(A)

key = 99999999999999
    
if A[-1] < K:
    ans = False

else:
    for i in range(2, A[0]+1):
        key_flag = True
        for a in A:
            if a % i !=0:
                key_flag = False
                break
                
        if key_flag == True:
            key = i
            break

    if key_flag == False:
        ans = True
#         print(1)
    elif K % key == 0:
        ans = True
#         print(2)
    else:
#         print(3)
        ans = False           
    
if ans == True:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Accepted