Buggy python submission (verdict: Runtime Error):
def gcd(a,b) :
    while b :
        a,b = b, a % b
    return a

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

p = 10**9
for i in range(N-1) :
    q = gcd(L[i],L[i+1])
    if q < p :
        p = q

if (K % p ==  0) and (K <= max(L))
    ans = "POSSIBLE"
else :
    ans = "IMPOSSIBLE"
print(ans)


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

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

if len(L) == 1 :
    if L[0] == K :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"

else :
    for i in range(N-1) :
        q = gcd(L[i],L[i+1])
        if i == 0 :
            p = gcd(L[i],L[i+1])
        if q < p :
            p = q

    if (K % p ==  0) and (K <= max(L)) :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"
print(ans)

Buggy python submission (verdict: Runtime Error):

from math import gcd
    

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

p = 10**9
for i in range(N-1) :
    q = gcd(L[i],L[i+1])
    if q < p :
        p = q

if K % p ==  0 :
    ans = "POSSIBLE"
else :
    ans = "IMPOSSIBLE"
print(ans)


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

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

if len(L) == 1 :
    if L[0] == K :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"

else :
    for i in range(N-1) :
        q = gcd(L[i],L[i+1])
        if i == 0 :
            p = gcd(L[i],L[i+1])
        if q < p :
            p = q

    if (K % p ==  0) and (K <= max(L)) :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
L = list(map(int,input().split()))
L = sorted(L,reverse=False)

ans = "IMPOSSIBLE"
if L[-1] < K :
    ans = "IMPOSSIBLE"
elif (K in L) or (1 in L) : 
    ans = "POSSIBLE"
else :
    for i in range(1,N) :
        if L[i] % L[0] != 0 :
            ans = "POSSIBLE"
            break

for i in range(N) :
    if (K + L[i]) in L :
        ans = "POSSIBLE"

print(ans)


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

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

if len(L) == 1 :
    if L[0] == K :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"

else :
    for i in range(N-1) :
        q = gcd(L[i],L[i+1])
        if i == 0 :
            p = gcd(L[i],L[i+1])
        if q < p :
            p = q

    if (K % p ==  0) and (K <= max(L)) :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"
print(ans)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
L = list(map(int,input().split()))
L = list(set(L))
L = sorted(L,reverse=False)

ans = "IMPOSSIBLE"
if L[-1] < K :
    ans = "IMPOSSIBLE"
else :
    for i in range(1,N) :
        if L[i] % L[0] != 0 :
            ans = "POSSIBLE"
            break
print(ans)


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

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

if len(L) == 1 :
    if L[0] == K :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"

else :
    for i in range(N-1) :
        q = gcd(L[i],L[i+1])
        if i == 0 :
            p = gcd(L[i],L[i+1])
        if q < p :
            p = q

    if (K % p ==  0) and (K <= max(L)) :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"
print(ans)