ZhenlongDai/ACPR huggingface dataset:
Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
ta_AT,ta_HP,ao_AT,ao_HP = map(int,input().split())

while True:
    ao_HP -= ta_AT
    if ao_HP < 0:
        print('Yes')
        break
    ta_HP -= ao_AT
    if ta_HP < 0:
        print('No')
        break

Failing test case input:
2 14 3 12

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
ta_HP,ta_AT,ao_HP,ao_AT = map(int,input().split())

while True:
    ao_HP -= ta_AT
    if ao_HP <= 0:
        print('Yes')
        break
    ta_HP -= ao_AT
    if ta_HP <= 0:
        print('No')
        break

Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math 
a,b,c,d=map(int,input().split())
print("Yes") if math.ceil(c/a)>=math.ceil(a/d) else print("No")

Failing test case input:
43 8 0 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math 
a,b,c,d=map(int,input().split())
print("Yes") if math.ceil(c/b)<=math.ceil(a/d) else print("No")

Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import ceil
A, B, C, D = map(int,input().split())
t = ceil(C / A)
a = ceil(A / D)
if t <= a:
    print('Yes')
else:
    print('No')

Failing test case input:
2 14 3 12

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
from math import ceil
A, B, C, D = map(int,input().split())
t = ceil(C / B)
a = ceil(A / D)
if t <= a:
    print('Yes')
else:
    print('No')

Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())
p = 0
while(c > 0):
    c = c - b
    if c == 0:
        break
    a = a - d
    if a == 0:
        p = 1
        break
if p == 1:
    print("No")
else:
    print("Yes")

Failing test case input:
34 4 40 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a, b, c, d = map(int, input().split())
p = 0


while(c > 0):
    c = c - b
    if c <= 0:
        break
    a = a - d
    if a <= 0:
        p = 1
        break
if p == 1:
    print("No")
else:
    print("Yes")

Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c, d = map(int, input().split())
print('Yes' if a/d+int(bool(a%d)) > c/b+int(bool(c%b)) else 'No')

Failing test case input:
10 9 3 10

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math
a, b, c, d = map(int, input().split())
print('Yes' if math.ceil(a/d) >= math.ceil(c/b) else 'No')

Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B,C,D=map(int,input().split())
t=0
while A>0 and C>0:
  if t%2==0:
    A-=D
  else:
    C-=B
if A<=0:
  print("No")
else:
  print("Yes")

Failing test case input:
7 7 1 22

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
A,B,C,D=map(int,input().split())
t=0
while A>0 and C>0:
  if t%2!=0:
    A-=D
  else:
    C-=B
  t+=1
if A<=0:
  print("No")
else:
  print("Yes")
Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B,C,D=map(int,input().split())


while(1):
    C=C-B
    print("C:",C)
    A=A-D
    print("A:",A)

    if C <= 0:
        print("Yes")
        break

    if A <= 0:
        print("No")
        break
    

Failing test case input:
366 8 4 17

Expected output:
Yes


Actual output:
C: -4
A: 349
Yes


Fixed submission (verdict: Accepted):
A,B,C,D=map(int,input().split())


while(1):
    C=C-B
    if C <= 0:
        print("Yes")
        break
    A=A-D
    if A <= 0:
        print("No")
        break

Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
in1=input()
in2=in1.split()
a=int(in2[0])
b=int(in2[1])
c=int(in2[2])
d=int(in2[3])
taka=a
ao=c
if taka<ao:
  print("No")
else:
  print("Yes")

Failing test case input:
10 9 10 10

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
import math
in1=input()
in2=in1.split()
a=int(in2[0])
b=int(in2[1])
c=int(in2[2])
d=int(in2[3])
taka=math.ceil(a/d)
ao=math.ceil(c/b)
if taka<ao:
  print("No")
else:
  print("Yes")

Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, C, D = map(int, input().split())



Thit = A
Tatk = B
Ahit = C
Aatk = D
win = False

while Thit <= 0 or Ahit <= 0:
    Ahit = Ahit - Tatk
    if Ahit <= 0:
        win = True
        break
    Thit = Thit - Aatk
    if Thit <= 0:
        win = False
        break

if win:
    print("Yes")
else:
    print("No")

Failing test case input:
139 8 2 17

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
A, B, C, D = map(int, input().split())

Thit = A
Tatk = B
Ahit = C
Aatk = D
win = False

while True:
    Ahit = Ahit - Tatk
    if Ahit <= 0:
        win = True
        break
    Thit = Thit - Aatk
    if Thit <= 0:
        win = False
        break

if win:
    print("Yes")
else:
    print("No")

Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, C, D = map(int, input().split())

t = C 
a = A 

if t >= a:
    print("Yes")
else:
    print("No")

Failing test case input:
289 14 0 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math
a, b, c, d = map(int, input().split())
t = math.ceil(a / d)
a = math.ceil(c / b)
if t >= a:
    print("Yes")
else:
    print("No")

Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

A,B,C,D = map(int,input().split())
for i in range(1000):
    if i%2 == 1:
        A = A - D
    else:
        C = C - B
    if C < 0:
        if A > C:
            print('No')
            break
        else:
            print('Yes')
            break


Failing test case input:
364 7 0 3

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):

A,B,C,D = map(int,input().split())
for i in range(10000):
    if i%2 == 1:
        A = A - D
    else:
        C = C - B
    if C <= 0 or A <= 0:
        if A > C:
            print('Yes')
            break
        else:
            print('No')
            break
Problem: p02700
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
THP,TAT,AHP,AAT = map(int,input().split())
while THP and AHP >= 0 :
    AHP -= TAT
    THP -= AAT
if THP <= 0 and AHP >= 0 :
    print("No")
elif AHP <= 0 and THP >= 0 :
    print("Yes")
else:
    print("Yes")

Failing test case input:
5 9 13 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
THP,TAT,AHP,AAT = map(int,input().split())
while THP > 0 and AHP > 0 :
    AHP -= TAT
    THP -= AAT
if THP <= 0 and AHP > 0 :
    print("No")
elif AHP <= 0 and THP > 0 :
    print("Yes")
else:
    print("Yes")
Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]

flag = True
for i in range(N-3):
	if abs(A[i]-A[i+1]) != abs(A[i+2]-A[i+1]):
		flag = False
		break

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

Failing test case input:
5 2
19 3 1 3 12

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
def gcd(a, b):
    if (b == 0):
        return a
    return gcd(b, a % b)

input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]

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

if K <= max(A) and K % temp == 0:
	print('POSSIBLE')
else:
	print('IMPOSSIBLE')

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
a=list(map(int,input().split()))
def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)

if n==1:
  x=a[0]
else:
  x=gcd(a[0],a[1])
  for i in range(2,n):
    x=gcd(x,a[i])

if max(a)<k:
  print('IMPOSSIBLE')
else:
  if (k%x==0):
    print('POSSIBLE')
  else:
    print('IMPOSIBLE')

Failing test case input:
3 5
6 16 8

Expected output:
IMPOSSIBLE


Actual output:
IMPOSIBLE


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
a=list(map(int,input().split()))
def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)

if n==1:
  x=a[0]
else:
  x=gcd(a[0],a[1])
  for i in range(2,n):
    x=gcd(x,a[i])

if max(a)>=k and k%x==0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

for i in range(1,N):
    if gcd(A[i], A[0]) == 1:
        print("POSSIBLE")
        exit()

print("IMPOSSIBLE")

Failing test case input:
2 0
6 16 6

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
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")
Problem: p03651
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from math import gcd

n,k = map(int, input().split())
al = list(map(int, input().split()))
a_gcd = al[0]
for a in al[1:]:
    a_gcd = gcd(a_gcd,a)

if k%a_gcd == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Failing test case input:
5 19
10 4 8 6 1

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
from math import gcd

n,k = map(int, input().split())
al = list(map(int, input().split()))
a_gcd = al[0]
for a in al[1:]:
    a_gcd = gcd(a_gcd,a)

if k%a_gcd == 0 and k <= max(al):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import sys




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((maxa-k)%tmp ==0):
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")







Failing test case input:
5 11
0 3 10 8 4

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):


import sys




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")

Problem: p03651
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
from functools import reduce
N, K = map(int, input().split())
A = list(map(int, input().split()))

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

gcd = gcd_list(A)
if (K%gcd==0) and (K<max(A)):
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')

Failing test case input:
3 11
11 3 1 10

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
import math
from functools import reduce
N, K = map(int, input().split())
A = list(map(int, input().split()))

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

gcd = gcd_list(A)
if (K%gcd==0) and (K<=max(A)):
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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()))
ans = 1
for i in range(n):
    ans = gcd(ans,a[i])
m = max(a)
if ans <= m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Failing test case input:
3 7
18 3 6

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
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()))
ans = a[0]
for i in range(n):
    ans = gcd(ans,a[i])
m = max(a)
if k%ans == 0 and k <= m:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]

flag = True
for i in range(N-3):
	if abs(A[i]-A[i+1]) != abs(A[i+2]-A[i+1]):
		flag = False
		break

if K in A:
	flag = True

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

Failing test case input:
3 5
6 16 8

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
def gcd(a, b):
    if (b == 0):
        return a
    return gcd(b, a % b)

input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]

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

if K <= max(A) and K % temp == 0:
	print('POSSIBLE')
else:
	print('IMPOSSIBLE')

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def gcd(x, y):
    while (y != 0):
        x, y = y, x%y
    return x

n, k = map(int, input().split())
A = list(map(int, input().split()))
g = A[0]
for a in A:
    g = gcd(g, a)
if k < max(A) and k%g == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Failing test case input:
3 11
11 3 7 10

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
def gcd(x, y):
    while (y != 0):
        x, y = y, x%y
    return x

n, k = map(int, input().split())
A = list(map(int, input().split()))
g = A[0]
for a in A:
    g = gcd(g, a)
if k <= max(A) and k%g == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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-a[0]:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Failing test case input:
4 11
11 5 7 9

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
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")
Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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


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


next = A_N[0]
for i in range(len(A_N)):
    next = gcd(A_N[i], next)

if K >= max(A_N):
    print('IMPOSSIBLE')
elif next == 1:
    print('POSSIBLE')
elif K % next ==0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Failing test case input:
1 11
11 3 7 10

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):

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


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


next = A_N[0]
for i in range(len(A_N)):
    next = gcd(A_N[i], next)

if K > max(A_N):
    print('IMPOSSIBLE')
elif next == 1:
    print('POSSIBLE')
elif K % next ==0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


Failing test case input:
3 11
11 3 1 10

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
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)

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from functools import reduce

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


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

g = reduce(gcd, A)
if K % g == 0:
    flag = True
else:
    flag = False

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


Failing test case input:
5 19
10 2 7 6 1

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
from functools import reduce

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


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

g = reduce(gcd, A)
if K % g == 0:
    flag = True
else:
    flag = False
if max(A) < K:
    flag = False    

print('POSSIBLE' if flag else 'IMPOSSIBLE')
Problem: p03651
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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()

Failing test case input:
5 19
10 2 7 6 1

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
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()

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
a = list(map(int,input().split()))
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
if max(a)<k:
    print('IMPOSIBLE')
else:
    g = a[0]
    for i in range(n):
        g = gcd(max(g,a[i]),min(g,a[i]))
    if k%g==0:
        print('POSSIBLE')
    else:
        print('IMPOSIBLE')

Failing test case input:
3 5
15 9 6

Expected output:
IMPOSSIBLE


Actual output:
IMPOSIBLE


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
a = list(map(int,input().split()))
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
if max(a)<k:
    print('IMPOSSIBLE')
else:
    g = a[0]
    for i in range(n):
        g = gcd(max(g,a[i]),min(g,a[i]))
    if k%g==0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
A = list(map(int, input().split()))



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


g = A[-1]
for i in A[:-1]:
    g = gcd(g, i)

a = max(A)
if (a - K) % g == 0 and a > K:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Failing test case input:
3 11
11 3 7 10

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
A = list(map(int, input().split()))



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


g = A[-1]
for i in A[:-1]:
    g = gcd(g, i)

a = max(A)
if (a - K) % g == 0 and a >= K:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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


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


next = A_N[0]
for i in range(len(A_N)):
    next = gcd(A_N[i], next)

if next == 1:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


Failing test case input:
3 22
11 3 1 10

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):

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


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


next = A_N[0]
for i in range(len(A_N)):
    next = gcd(A_N[i], next)

if K > max(A_N):
    print('IMPOSSIBLE')
elif next == 1:
    print('POSSIBLE')
elif K % next ==0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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-a[0]<=x:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Failing test case input:
5 11
0 3 10 8 2

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
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")

Problem: p03651
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import gcd
n,k = map(int,input().split())
A = list(map(int,input().split()))
g = A[0]
for x in A:
    g = gcd(g,x)
print("POSSIBLE" if k%g == 0 else "IMPOSSIBLE")

Failing test case input:
5 11
0 3 10 8 4

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
from math import gcd
n,k = map(int,input().split())
A = list(map(int,input().split()))
g = A[0]
m = max(A)
for x in A:
    g = gcd(g,x)
print("POSSIBLE" if k%g == 0 and m >= k else "IMPOSSIBLE")

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
a = [int(i) for i in input().split()]

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

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

if k <= max(a) or k%g == 0:
    ans = "POSSIBLE"
else:
    ans = "IMPOSSIBLE"

print(ans)

Failing test case input:
5 19
10 2 11 6 1

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
a = [int(i) for i in input().split()]

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

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

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

print(ans)
Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

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

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

    gcd_ = a[0]
    for i in range(1, N):
        gcd_ = gcd(gcd_, a[i])
    
    if K%gcd_ == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

Failing test case input:
5 11
10 4 7 6 1

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

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

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

    gcd_ = a[0]
    for i in range(1, N):
        gcd_ = gcd(gcd_, a[i])
    
    if K%gcd_ == 0 and K <= max(a):
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

Problem: p03651
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N, K =map(int, input().split())
A=list(map(int, input().split()))

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

g=0
max_a=0
for a in A:
	g=gcd(g, a)
	max_a=max(max_a, a)

if K%g==0 and K<max_a:
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")

Failing test case input:
4 11
11 3 7 10

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
N, K =map(int, input().split())
A=list(map(int, input().split()))

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

g=0
max_a=0
for a in A:
	g=gcd(g, a)
	max_a=max(max_a, a)

if K%g==0 and K<=max_a:
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")

Problem: p03651
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import gcd
from functools import reduce
n,k = map(int,input().split())
a = sorted(list(map(int,input().split())))

def mgcd(l):
  return reduce(gcd,l)
if k in a:
  print("POSSIBLE")
  exit()
if a[-1]<k:
  print("IMPOSSIBLE")
  exit()
s = mgcd(a)
if s==1:
  print('POSSIBLE')
else:
  if k==s:
    print("POSSIBLE")
  else:
    print("IMPOSSIBLE")

Failing test case input:
3 4
6 16 8

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
from math import gcd
from functools import reduce
n,k = map(int,input().split())
a = sorted(list(map(int,input().split())))

def mgcd(l):
  return reduce(gcd,l)
if k in a:
  print("POSSIBLE")
  exit()
if a[-1]<k:
  print("IMPOSSIBLE")
  exit()
s = mgcd(a)
if s==1:
  print('POSSIBLE')
else:
  if k%s==0:
    print("POSSIBLE")
  else:
    print("IMPOSSIBLE")
Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
l=sorted(map(int,input().split()))
def gcd(x,y):
  if y==0:return x
  return gcd(y,x%y)
ans=""
s=0
for i in l:
  s=gcd(i,s)
  if s==1:break
else:
  if k%s!=l[-1]%s:
    ans="IM"
print(ans+"POSSIBLE")


Failing test case input:
5 11
0 3 10 8 4

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
l=sorted(map(int,input().split()))
def gcd(x,y):
  if y==0:return x
  return gcd(y,x%y)
ans=""
s=0
for i in l:
  s=gcd(i,s)
  if s==1:break
else:
  if k%s!=l[-1]%s:
    ans="IM"
if l[-1]<k:ans="IM"
print(ans+"POSSIBLE")

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
5 11
18 5 7 8 2

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
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")

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]

if K in A:
	flag = True
elif K > max(A):
	flag = False
else:
	flag = True
	for i in range(N-3):
		if abs(A[i]-A[i+1]) != abs(A[i+2]-A[i+1]):
			flag = False
			break

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

Failing test case input:
5 11
18 3 7 4 2

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
def gcd(a, b):
    if (b == 0):
        return a
    return gcd(b, a % b)

input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]

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

if K <= max(A) and K % temp == 0:
	print('POSSIBLE')
else:
	print('IMPOSSIBLE')

Problem: p03651
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from math import gcd
n,k=map(int,input().split())
*a, =map(int,input().split())
a=sorted(a)
for i in range(len(a)):
  if i==0: tmp=a[0]
  else:
    tmp=gcd(tmp,a[i])
if k%tmp==0:
  print("POSSIBLE")
else: print("IMPOSSIBLE")


Failing test case input:
5 11
10 4 7 6 1

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
from math import gcd
n,k=map(int,input().split())
*a, =map(int,input().split())
a=sorted(a)
for i in range(len(a)):
  if i==0: tmp=a[0]
  else:
    tmp=gcd(tmp,a[i])
if k%tmp!=0 or max(a)<k:
  print("IMPOSSIBLE")
else: print("POSSIBLE")
Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]
A.sort()
if K in A:
	flag = True
elif K > max(A):
	flag = False
else:
	flag = True
	for i in range(N-3):
		if abs(A[i]-A[i+1]) != abs(A[i+2]-A[i+1]):
			flag = False
			break

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

Failing test case input:
5 2
19 3 1 8 12

Expected output:
POSSIBLE


Actual output:
IMPOSSIBLE


Fixed submission (verdict: Accepted):
def gcd(a, b):
    if (b == 0):
        return a
    return gcd(b, a % b)

input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]

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

if K <= max(A) and K % temp == 0:
	print('POSSIBLE')
else:
	print('IMPOSSIBLE')

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
A = list(map(int, input().split()))



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


while len(A) > 1:
    A.append(gcd(A.pop(), A.pop()))
if K % A[0] == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Failing test case input:
5 19
10 2 7 6 1

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
A = list(map(int, input().split()))
B = A.copy()



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


while len(A) > 1:
    A.append(gcd(A.pop(), A.pop()))
if K % A[0] == 0 and any(map(lambda x: x >= K, B)):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
a = list(map(int,input().split()))
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
if max(a)<k:
    print('IMPOSIBLE')
else:
    g = a[0]
    for i in range(n):
        g = gcd(max(g,a[i]),min(g,a[i]))
    if k%g==0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')

Failing test case input:
5 19
10 4 8 6 1

Expected output:
IMPOSSIBLE


Actual output:
IMPOSIBLE


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
a = list(map(int,input().split()))
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
if max(a)<k:
    print('IMPOSSIBLE')
else:
    g = a[0]
    for i in range(n):
        g = gcd(max(g,a[i]),min(g,a[i]))
    if k%g==0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')
Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
g=a[-1]
def gcd(a,b):
  while b:a,b=b,a%b
  return a
for i in a:g=gcd(g,i)
if a[-1]<k and k%g!=0:print("IMPOSSIBLE")
else:print("POSSIBLE")

Failing test case input:
5 19
10 2 8 3 4

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
g=a[-1]
def gcd(a,b):
  while b:a,b=b,a%b
  return a
for i in a:g=gcd(g,i)
if a[-1]<k or k%g!=0:print("IMPOSSIBLE")
else:print("POSSIBLE")

Problem: p03651
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
A = list(map(int, input().split()))



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


while len(A) > 1:
    A.append(gcd(A.pop(), A.pop()))
if A[0] == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Failing test case input:
5 11
10 3 7 6 1

Expected output:
IMPOSSIBLE


Actual output:
POSSIBLE


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
A = list(map(int, input().split()))
B = A.copy()



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


while len(A) > 1:
    A.append(gcd(A.pop(), A.pop()))
if K % A[0] == 0 and any(map(lambda x: x >= K, B)):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())

'error' if a + b >= 10 else a + b

Failing test case input:
-169 -2

Expected output:
-171


Actual output:

Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
 
print('error' if a + b >= 10 else a + b)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int, input().split())
print(a+b if a+b>=10 else "error")

Failing test case input:
1 -135

Expected output:
-134


Actual output:
error


Fixed submission (verdict: Accepted):
a,b = map(int, input().split())
print(a+b if a+b<10 else "error")

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
print("error") if A+B>=10 else A+B

Failing test case input:
-23 0

Expected output:
-23


Actual output:

Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
print("error") if A+B>=10 else print(A+B)

Problem: p03697
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b=map(int, input().split()) 
print("error" if a*b>=10 else a*b)

Failing test case input:
4 -95

Expected output:
-91


Actual output:
-380


Fixed submission (verdict: Accepted):
a,b=map(int, input().split()) 
print("error" if a+b>=10 else a+b)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int, input().split())
print(a+b if a+b >= 10 else 'error')

Failing test case input:
-4 -24

Expected output:
-28


Actual output:
error


Fixed submission (verdict: Accepted):
a,b = map(int, input().split())
print(a+b if a+b < 10 else 'error')

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
n = a + b
if n >= 10:
    print('error')
else:
    print('n')

Failing test case input:
-2 -228

Expected output:
-230


Actual output:
n


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
n = a + b
if n >= 10:
    print('error')
else:
    print(n)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if a+b>=10:
  print('error')
else:
  print('a+b')

Failing test case input:
-3 -266

Expected output:
-269


Actual output:
a+b


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if a+b>=10:
  print('error')
else:
  print(a+b)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
if a+b < 10:
  print("error")
else:
  print(a+b)

Failing test case input:
-169 -2

Expected output:
-171


Actual output:
error


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if a+b >= 10:
  print("error")
else:
  print(a+b)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
print(A + B) if A + B >= 10 else print("error")


Failing test case input:
-44 -1

Expected output:
-45


Actual output:
error


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
print(A + B) if A + B < 10 else print("error")
Problem: p03697
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B = input().split(' ')
A = int(A)
B = int(B)
if A+B < 10:
  print('error')
else:
  print(A+B)

Failing test case input:
0 -252

Expected output:
-252


Actual output:
error


Fixed submission (verdict: Accepted):
A,B = input().split(' ')
A = int(A)
B = int(B)
if A+B < 10:
  print(A+B)
else:
  print('error')

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x,y = map(int,input().split())
if x+y >= 10:
  print(x+y)
else:
  print('error')

Failing test case input:
0 -501

Expected output:
-501


Actual output:
error


Fixed submission (verdict: Accepted):
x,y = map(int,input().split())
if x+y >= 10:
  print('error')
else:
  print(x+y)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
if a+b >= 10:
  print('error')
else:
  print('a+b')

Failing test case input:
-169 -2

Expected output:
-171


Actual output:
a+b


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if a+b >= 10:
  print('error')
else:
  print(a+b)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
if a+b >= 10:print('error')
else:print('a+b')

Failing test case input:
-169 -1

Expected output:
-170


Actual output:
a+b


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if a+b >= 10:print('error')
else:print(a+b)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int, input().split())

if a + b < 10:
  print('Yes')
else:
  print('error')

Failing test case input:
1 -135

Expected output:
-134


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b = map(int, input().split())

if a + b < 10:
  print(a + b)
else:
  print('error')

Problem: p03697
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b = map(int,input().split())

print(a+b if a+b >= 10 else "error")

Failing test case input:
-1 -397

Expected output:
-398


Actual output:
error


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())

print("error" if a+b >= 10 else a+b)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int, input().split())
if a+b<10:
    print('error')
else:
    print(a+b)

Failing test case input:
-1 -241

Expected output:
-242


Actual output:
error


Fixed submission (verdict: Accepted):
a,b = map(int, input().split())
if a+b>=10:
    print('error')
else:
    print(a+b)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
print('a+b'if a+b<10 else 'error')

Failing test case input:
1 -301

Expected output:
-300


Actual output:
a+b


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
print(a+b if a+b<10 else 'error')

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
if A+B <= 10:
    print('error')
else:
    print(A+B)

Failing test case input:
-169 -1

Expected output:
-170


Actual output:
error


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
if A+B >= 10:
    print('error')
else:
    print(A+B)
Problem: p03697
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b = map(int,input().split())

print("a+b" if a+b >= 10 else "error")

Failing test case input:
-1 -397

Expected output:
-398


Actual output:
error


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())

print("error" if a+b >= 10 else a+b)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
if A+B<=10:
    print("error")
else:
    print(A+B)

Failing test case input:
0 -13

Expected output:
-13


Actual output:
error


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
if A+B>=10:
    print("error")
else:
    print(A+B)

Problem: p03697
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A, B = map(int, input().split())

if A + B <= 10:
  print('error')
else:
  print(A + B)

Failing test case input:
-279 -1

Expected output:
-280


Actual output:
error


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
 
if A + B >= 10:
  print('error')
else:
  print(A + B)

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int,input().split())
print(A+B if A+B>10 else 'error')

Failing test case input:
1 -71

Expected output:
-70


Actual output:
error


Fixed submission (verdict: Accepted):

A,B=map(int,input().split())
print(A+B if A+B<10 else 'error')

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())

print(A+B if A+B >= 10 else 'error')

Failing test case input:
-4 -15

Expected output:
-19


Actual output:
error


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())

print(A+B if A+B < 10 else 'error')

Problem: p03697
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int, input().split())
if a + b > 10:
  print(a + b)
else:
  print("error")

Failing test case input:
-91 2

Expected output:
-89


Actual output:
error


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if a + b < 10:
    print(a + b)
else:
    print("error")

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=max(map(int,input().split()))
print(a if a < 10 else "error")

Failing test case input:
4 -135

Expected output:
-131


Actual output:
4


Fixed submission (verdict: Accepted):
a=sum(map(int,input().split()))
print(a if a < 10 else "error")

Problem: p03697
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split(" "))
if a + b <= 10:
  print("error")
else:
  print(a + b)

Failing test case input:
1 -871

Expected output:
-870


Actual output:
error


Fixed submission (verdict: Accepted):
a,b = map(int,input().split(" "))
if a + b >= 10:
  print("error")
else:
  print(a + b)

Problem: p03697
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def resolve():
	a, b = map(int, input().split())
	if a + b >= 10:
		print('error')
	else:
		print(a + b)


Failing test case input:
0 -201

Expected output:
-201


Actual output:

Fixed submission (verdict: Accepted):

def resolve():
	a, b = map(int, input().split())
	if a + b >= 10:
		print('error')
	else:
		print(a + b)
resolve()
Problem: p03821
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ans = 0
for i in range(n):
  a,b = map(int,input().split())
  ans += (b-(a+ans)%b)%b 
print(ans)


Failing test case input:
3
-1 6
6 3
0 9

Expected output:
1


Actual output:
9


Fixed submission (verdict: Accepted):
n = int(input())
ans = 0
li = []
for i in range(n):
    a,b = map(int,input().split())
    li.append((a,b))
li = li[::-1]
for (a,b) in li:
    ans += (b-((a+ans)%b))%b
print(ans)

Problem: p03821
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
import fractions

n = int(stdin.readline().rstrip())
li = [[0,0]]+[list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]
li = li[::-1]
count = 0
for i in range(n):
    if li[i][0]%li[i][1] != 0:
        count += -li[i][0]%li[i][1]
        li[i+1][0] += count
print(count)

Failing test case input:
3
3 5
2 2
18 4

Expected output:
2


Actual output:
4


Fixed submission (verdict: Accepted):
from sys import stdin
import fractions

n = int(stdin.readline().rstrip())
li = [[0,0]]+[list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]
li = li[::-1]
count = 0
for i in range(n):
    count += -li[i][0]%li[i][1]
    li[i+1][0] += count
print(count)

Problem: p03821
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ab = [list(map(int, input().split())) for _i in range(n)]

x = 0
r = 0
for i in range(n-1, -1, -1):
    a, b = ab[i]
    r += b-(x+a)%b
    x = r
print(r)

Failing test case input:
7
5 1
4 2
5 12
2 4
6 1
1 8
17 6

Expected output:
20


Actual output:
21


Fixed submission (verdict: Accepted):
n = int(input())
ab = [list(map(int, input().split())) for _i in range(n)][::-1]

r = 0
for i in range(n):
    a, b = ab[i]
    if (r+a)%b==0:
        continue
    r += b-(r+a)%b
print(r)

Problem: p03821
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
cou = 0
lis = []
li = []
for i in range(n):
  a,b = map(int,input().split())
  lis.append(a)
  li.append(b)
for i in range(1,n+1):
  if li[-i] != 1:
    cou += (li[-i] -(cou + lis[-i]) % li[-i])
print(cou)

Failing test case input:
7
0 1
4 2
0 11
2 8
6 1
5 16
24 6

Expected output:
22


Actual output:
24


Fixed submission (verdict: Accepted):
n = int(input())
cou = 0
lis = []
li = []
for i in range(n):
  a,b = map(int,input().split())
  lis.append(a)
  li.append(b)
for i in range(1,n+1):
  if (cou + lis[-i]) % li[-i] != 0:
    cou += (li[-i] -(cou + lis[-i]) % li[-i])
print(cou)

Problem: p03821
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = []
for i in range(n):
  a1 = list(map(int, input().split()))
  a.append(a1)
a.reverse()
ans = 0
b = 0
for i in a:
  if i[1] != 1:
    c = i[1] - (i[0]+b) % i[1]
    ans += c
    b += c
print(ans)

Failing test case input:
7
4 1
4 2
5 12
2 4
6 1
10 8
2 6

Expected output:
8


Actual output:
20


Fixed submission (verdict: Accepted):
n = int(input())
a = []
for i in range(n):
  a1 = list(map(int, input().split()))
  a.append(a1)
a.reverse()
ans = 0
b = 0
for i in a:
  if i[1] != 1:
    c = i[1] - (i[0]+b) % i[1]
    if c == i[1]:
      c = 0
    ans += c
    b += c
print(ans)
Problem: p03821
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())
AB=[tuple(map(int, input().split())) for _ in range(N)]

ans=0
for a,b in reversed(AB):
    ans += b - ((a+ans) % b) if b!=1 else 0
print(ans)

Failing test case input:
3
2 6
2 2
18 4

Expected output:
4


Actual output:
10


Fixed submission (verdict: Accepted):
N=int(input())
AB=[tuple(map(int, input().split())) for _ in range(N)]

ans=0
for a,b in reversed(AB):
    if b==1 or (a+ans)%b==0: continue
    ans += b - ((a+ans) % b)
print(ans)

Problem: p03821
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n = int(sys.stdin.readline())
m = map(int, sys.stdin.read().split())
ab = list(zip(m, m))
res = 0
for i, j in ab[::-1]:
  if j != 1:
  	res += j - (i + res) % j
print(res)

Failing test case input:
7
4 1
4 2
5 12
2 4
6 1
5 3
26 6

Expected output:
8


Actual output:
20


Fixed submission (verdict: Accepted):
import sys
_ = int(sys.stdin.readline())
m = map(int, sys.stdin.read().split())
ab = list(zip(m, m))
res = 0
for i, j in ab[::-1]:
  res += - (i + res) % j
print(res)

Problem: p03821
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
AB = [list(map(int,input().split())) for _ in range(N)]
AB.reverse()
count = 0

for a,b in AB:
  num_a = a+count
  if b == 1:
    if num_a == 0:
      count += 1
    else:
      continue
  else:
    count += (b-num_a%b)

print(count)

Failing test case input:
7
5 2
4 2
5 12
2 4
0 1
2 8
17 6

Expected output:
9


Actual output:
21


Fixed submission (verdict: Accepted):
N = int(input())
AB = [list(map(int,input().split())) for _ in range(N)]
AB.reverse()
count = 0

for a,b in AB:
  a += count
  if a%b != 0:
    count += (b - (a % b))
  else:
    pass
print(count)

Problem: p03821
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n = int(sys.stdin.readline())
m = map(int, sys.stdin.read().split())
ab = list(zip(m, m))
res = 0
for i, j in ab[::-1]:
  if j != 1:
  	res += j - ((i + res) % j)
print(res)


Failing test case input:
7
4 1
4 2
5 12
4 4
5 4
5 8
10 3

Expected output:
8


Actual output:
20


Fixed submission (verdict: Accepted):
import sys
_ = int(sys.stdin.readline())
m = map(int, sys.stdin.read().split())
ab = list(zip(m, m))
res = 0
for i, j in ab[::-1]:
  res += - (i + res) % j
print(res)

Problem: p03821
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = []
for i in range(N):
    a.append(list(map(int, input().split())))

count = 0
for i in range(N)[::-1]:
    if (a[i][0]%a[i][1]) != 0:
        count += a[i][1] - (a[i][0]%a[i][1])
        if i!=0:
            a[i-1][0] += count
print(count)

Failing test case input:
3
3 4
3 3
9 4

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
a = []
for i in range(N):
    a.append(list(map(int, input().split())))

count = 0
for i in range(N)[::-1]:
    a[i][0] += count
    if (a[i][0]%a[i][1]) != 0:
        count += a[i][1] - (a[i][0]%a[i][1])
print(count)