Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1)

power = power % tmp
print(power)

Fixed submission:
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1) % tmp

print(power)

Buggy python submission (verdict: Time Limit Exceeded):
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1)

print(power % tmp)

Fixed submission:
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1) % tmp

print(power)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1)

print(power % tmp)

Fixed submission:
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1) % tmp

print(power)

Buggy python submission (verdict: Runtime Error):
import numpy as np

power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1)

print(power % tmp)

Fixed submission:
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1) % tmp

print(power)

Buggy python submission (verdict: Runtime Error):
import numpy as np

power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1)

print(power % tmp)

Fixed submission:
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1) % tmp

print(power)

Buggy python submission (verdict: Runtime Error):
import numpy as np

power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1)

print(power % tmp)

Fixed submission:
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1) % tmp

print(power)

Buggy python submission (verdict: Time Limit Exceeded):
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1)

print(power % tmp)

Fixed submission:
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1) % tmp

print(power)

Buggy python submission (verdict: Time Limit Exceeded):
power = 1
n = int(input())

for i in range(n):
    power = power * (i + 1)

print(power % (10 ** 9 + 7))

Fixed submission:
power = 1
n = int(input())
tmp = 10 ** 9 + 7

for i in range(n):
    power = power * (i + 1) % tmp

print(power)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = []
B = []
r = 0
for i in range(N):
  a,b = map(int,input().split())
  A.append(a)
  B.append(b)
while M > 0:
  cnt = 1000000001
  cnt2 = 0
  for i in range(N):
    if (A[i] < cnt) and (B[i] != 0):
      cnt = A[i]
      cnt2 = i
  M -= B[cnt2]
  r += A[cnt2]*B[cnt2]
  B[cnt2] = 0
  if M < 0:
    r -= abs(M)*A[cnt2]
  A[cnt2] = 0
print(r)

Fixed submission:
W,H = map(int,input().split())
w,h = map(int,input().split())
print((W-w)*(H-h))
Buggy python submission (verdict: Runtime Error):
S= input()
if S==3 or S==5 or S==7:
  print(Yes)
else:
  print(No)

Fixed submission:
S=int(input())
if (S==3) or (S==5) or (S==7):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
L,R = map(int,input().split())
ans = 100000000
for i in range(L,R + 1):
    for j in range(i + 1,R + 1):
        if i*j % 2019 < ans:
            ans = i*j % 2019
            if ans == 0:
                print(ans)
                sys.exit
print(ans)

Fixed submission:
L,R = map(int,input().split())
ans = 100000000
for i in range(L,R + 1):
    if ans == 0:
        break
    for j in range(i + 1,R + 1):
        if i*j % 2019 < ans:
            ans = i*j % 2019
            if ans == 0:
                break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int,input().split())
ans = 100000000
for i in range(L,R + 1):
    for j in range(i + 1,R + 1):
        if i*j % 2019 < ans:
            ans = i*j % 2019
print(ans)

Fixed submission:
L,R = map(int,input().split())
ans = 100000000
for i in range(L,R + 1):
    if ans == 0:
        break
    for j in range(i + 1,R + 1):
        if i*j % 2019 < ans:
            ans = i*j % 2019
            if ans == 0:
                break
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
M = int(input())
print(N - M + 1)

Fixed submission:
N,M = map(int,input().split())
print(N - M + 1)
Buggy python submission (verdict: Runtime Error):
S = input()
A = 0
for s in S:
	if s == "-":
		A--
	if s == "+":
		A++
print(A);

Fixed submission:
S = input()
A = 0
for s in S:
	if s == "-":
		A -= 1
	if s == "+":
		A += 1
print(A);

Buggy python submission (verdict: Runtime Error):
S = input()
A = 0
for s in S
	if s == "-":
		A--
	if s == "+":
		A++
print(A);

Fixed submission:
S = input()
A = 0
for s in S:
	if s == "-":
		A -= 1
	if s == "+":
		A += 1
print(A);
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
ans = 0
if a > b:
  ans += a
else:
  ans += b
if c > d
  ans += c
else:
  ans += d
print(ans)
	

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
ans = 0
if a > b:
  ans += b
else:
  ans += a
if c > d:
  ans += d
else:
  ans += c
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
ans = 0
if a > b:
  ans += a
else:
  ans += b
if c > d
  ans += c
else:
  ans += d
print(ans)
	

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
ans = 0
if a > b:
  ans += b
else:
  ans += a
if c > d:
  ans += d
else:
  ans += c
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
ans = 0
if a > b:
  ans += a
  else:
    ans += b
if c > d
  ans += c
  else:
    ans += d
print(ans)
	

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
ans = 0
if a > b:
  ans += b
else:
  ans += a
if c > d:
  ans += d
else:
  ans += c
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
A,B = map(int,input().split())
ans = 0
for i in range (A,B+1):
    s = str(i)
    kai = True
    for j in range (0, math.celi(len(s)/2)):
        if s[j] != s[-j - 1]:
            kai = False
            break
    if kai == True:
        ans += 1
print(ans)

Fixed submission:
import math
A,B = map(int,input().split())
ans = 0
for i in range (A,B+1):
    s = str(i)
    kai = True
    for j in range (0, math.ceil(len(s)/2)):
        if s[j] != s[-j - 1]:
            kai = False
            break
    if kai == True:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N % 3 => 1:
	print((N // 3 ) + 1)
else:
	print(N//3)

Fixed submission:
N = int(input())
if N % 3 >= 1:
	print(N // 3)
else:
	print(N//3)
Buggy python submission (verdict: Runtime Error):
A, B, C, X = map(int, input().split())
I = 0
for i in range(A + 1):
	for j in range(B + 1):
		for k in range(C + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
for i in range(C + 1):
	for j in range(B + 1):
		for k in range(A + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
for i in range(B + 1):
	for j in range(A + 1):
		for k in range(C + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
for i in range(A + 1):
	for j in range(C + 1):
		for k in range(B + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
for i in range(C + 1):
	for j in range(A + 1):
		for k in range(B + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
for i in range(B + 1):
	for j in range(C + 1):
		for k in range(A + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
print(I)


Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())

ans = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if 500 * a + 100 * b + 50 * c == X:
                ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
A, B, C, X = map(int, input().split())
I = 0
for i in range(A + 1):
	for j in range(B + 1):
		for k in range(C + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
print(I)


Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())

ans = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if 500 * a + 100 * b + 50 * c == X:
                ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
A, B, C, X = map(int, input().split())
I = 0
for i in range(A + 1):
	for j in range(B + 1):
		for k in range(C + 1):
			if 500 * i + 100 * j + 50 * k == X:
			I++
print(I)


Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())

ans = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if 500 * a + 100 * b + 50 * c == X:
                ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
A, B, C, X = map(int, input().split())
I = 0
for i in range(A + 1):
	for j in range(B + 1):
		for k in range(C + 1):
			if 500 * i + 100 * j + 50 * k == X:
		I++
print(I)


Fixed submission:
A=int(input())
B=int(input())
C=int(input())
X=int(input())

ans = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if 500 * a + 100 * b + 50 * c == X:
                ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a == b:
	print(c)
elif a == c:
	print(b)
elif b == c:
	print(a)
	
a,b,c,d = map(int,input().split())
l = a + b
r = c + d
if l > r:
	print("Left")
elif l < r:
	print("Right")
elif l == r:
	print("Balanced")

Fixed submission:
a,b,c,d = map(int,input().split())
l = a + b
r = c + d
if l > r:
	print("Left")
elif l < r:
	print("Right")
elif l == r:
	print("Balanced")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a == b
	print(c)
else if a == c
	print(b)
else if b == c
	print(a)

Fixed submission:
a,b,c = map(int,input().split())
if a == b:
	print(c)
elif a == c:
	print(b)
elif b == c:
	print(a)
Buggy python submission (verdict: Runtime Error):
ans = int(input()) - int(input())
if ans < 0:
	print(0)
else:
	print(ans)

Fixed submission:
x,n = map(int,input().split())
ans = x - n
if ans < 0:
	print(0)
else:
	print(ans)
Buggy python submission (verdict: Runtime Error):
r, g, b = map(int, input().split())
ans = 0
ans += r * 100 + g * 10 + b
if ans % 4 = 0:
	print("YES")
else:
	print("NO")

Fixed submission:
r, g, b = map(int, input().split())
ans = 0
ans = r * 100 + g * 10 + b
if ans % 4 == 0:
	print("YES")
else:
	print("NO")

Buggy python submission (verdict: Runtime Error):
r, g, b = map(int, input().split())
ans = 0
ans += r * 100 + g * 10 + b
if ans % 4 = 0:
  print("YES")
  else:
    print("NO")

Fixed submission:
r, g, b = map(int, input().split())
ans = 0
ans = r * 100 + g * 10 + b
if ans % 4 == 0:
	print("YES")
else:
	print("NO")
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A[-1] == B[0] and B[-1] == C[0]:
  print("YES")
else :
  print("NO")

Fixed submission:
A, B, C = input().split()
if A[-1] == B[0] and B[-1] == C[0]:
  print("YES")
else :
  print("NO")

Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A[-1] == B[0] && B[-1] == C[0]:
  print("YES")
else :
  print("NO")

Fixed submission:
A, B, C = input().split()
if A[-1] == B[0] and B[-1] == C[0]:
  print("YES")
else :
  print("NO")
Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
ans = ""
for i in len(o):
  ans += o[i]
  if len(e) > i:
    ans += e[i]
print(ans)

Fixed submission:
o = input()
e = input()
ans = ""
for i in range(len(o)):
  ans += o[i]
  if len(e) > i:
    ans += e[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
ans = ""
for i in o:
  ans += o[i]
  if len(e) > i:
    ans += e[i]
print(ans)

Fixed submission:
o = input()
e = input()
ans = ""
for i in range(len(o)):
  ans += o[i]
  if len(e) > i:
    ans += e[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
ans = ""
for i in o:
  ans += o[i]
	if len(e) > i:
  		ans += e[i]
print(ans)

Fixed submission:
o = input()
e = input()
ans = ""
for i in range(len(o)):
  ans += o[i]
  if len(e) > i:
    ans += e[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
ans = ""
for i in o:
  ans += o[i]
	if ans[i]:
  		ans += e[i]
print(ans)

Fixed submission:
o = input()
e = input()
ans = ""
for i in range(len(o)):
  ans += o[i]
  if len(e) > i:
    ans += e[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
ans = ""
for i in o:
  ans += o[i]
  ans += e[i]
print(ans)

Fixed submission:
o = input()
e = input()
ans = ""
for i in range(len(o)):
  ans += o[i]
  if len(e) > i:
    ans += e[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
from math import gcd
n = int(input())

a = list(map(int,input().split()))
lcm = a[0]
for i in a[1:]:
  lcm = (lcm * i) // int(gcd(lcm, i)) 

lcm -= 1
ans = 0
for i in a:
	ans += lcm % i 
print(ans)

Fixed submission:
def gcd(x, y):
 
   while(y):
       x, y = y, x % y
 
   return x

   
n = int(input())

a = list(map(int,input().split()))
lcm = a[0]
for i in a[1:]:
  lcm = (lcm * i) // int(gcd(lcm, i)) 

lcm -= 1
ans = 0
for i in a:
	ans += lcm % i 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int, input().split())
# l=0
# r=10000

mini=l*r%2019
for i in range(l,r+1):
    if(i%2019==0):
        break;
    for j in range(i+1,r+1):
        if(i*j%2019<mini):
            mini=i*j%2019
print(mini)

Fixed submission:
l,r = map(int, input().split())
# l=10000000
# r=100000000

mini=l*r%2019
for i in range(l,r+1):
    for j in range(i+1,r+1):
        if(j%2019==0):
            mini=0
            break;
        
        if(i*j%2019<mini):
            mini=i*j%2019
    if mini==0:
        break;
print(mini)

Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int, input().split())
# l=2020
# r=2040

mini=l*r%2019
for i in range(l,r+1):
    for j in range(i+1,r+1):
        if(i*j%2019<mini):
            mini=i*j%2019
print(mini)

Fixed submission:
l,r = map(int, input().split())
# l=10000000
# r=100000000

mini=l*r%2019
for i in range(l,r+1):
    for j in range(i+1,r+1):
        if(j%2019==0):
            mini=0
            break;
        
        if(i*j%2019<mini):
            mini=i*j%2019
    if mini==0:
        break;
print(mini)
Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

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

N = int(input())
A = (input()).split()
# N = int('2')
# A = ('1000000000 1000000000').split()
A = [int(a) for a in A]
max=0

for i in range(N):
    B = A.copy()
    del B[i]
    for j in range(N-1):
        if max < gcd(*B):
            max = gcd(*B)
            
print(max)


Fixed submission:
A_B_T = input()
A = int(A_B_T.split()[0])
B = int(A_B_T.split()[1])
T = int(A_B_T.split()[2])

print(int((T + 0.5) // A * B))

Buggy python submission (verdict: Runtime Error):
import fraction
from functools import reduce

def gcd(*numbers):
    return reduce(fraction.gcd, numbers)

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

N = int(input())
A = (input()).split()
# N = int('2')
# A = ('1000000000 1000000000').split()
A = [int(a) for a in A]
max=0

for i in range(N):
    B = A.copy()
    del B[i]
    for j in range(N-1):
        if max < gcd(*B):
            max = gcd(*B)
            
print(max)


Fixed submission:
A_B_T = input()
A = int(A_B_T.split()[0])
B = int(A_B_T.split()[1])
T = int(A_B_T.split()[2])

print(int((T + 0.5) // A * B))

Buggy python submission (verdict: Runtime Error):
import fraction
from functools import reduce

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

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

N = int(input())
A = (input()).split()
# N = int('2')
# A = ('1000000000 1000000000').split()
A = [int(a) for a in A]
max=0

for i in range(N):
    B = A.copy()
    del B[i]
    for j in range(N-1):
        if max < gcd(*B):
            max = gcd(*B)
            
print(max)


Fixed submission:
A_B_T = input()
A = int(A_B_T.split()[0])
B = int(A_B_T.split()[1])
T = int(A_B_T.split()[2])

print(int((T + 0.5) // A * B))
Buggy python submission (verdict: Runtime Error):

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:map(int,input().split())

n=int(input())

a=list(mii())
a.sort()

if a[0]==a[n-1]:
    if 0 in b:
        print("Yes")
    else:
        print("No")
elif n%3:
    print("No")
else:
    a1,a2,a3=a[0],a[n//3],a[n//3*2]
    if a1!=a[n//3-1] or a2!=a[n//3*2-1] or a3!=a[n-1]:
        print("No")
    elif a1^a2!=a3 or a1^a3!=a2 or a2^a3!=a1:
        print("No")
    else:
        print("Yes")






Fixed submission:

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:map(int,input().split())

n=int(input())

a=list(mii())
a.sort()

if a[0]==a[n-1]:
    if a[0]==0:
        print("Yes")
    else:
        print("No")
elif n%3:
    print("No")
else:
    a1,a2,a3=a[0],a[n//3],a[n//3*2]
    if a1!=a[n//3-1] or a2!=a[n//3*2-1] or a3!=a[n-1]:
        print("No")
    elif a1^a2!=a3 or a1^a3!=a2 or a2^a3!=a1:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

nums=[]

num=0
pow10=1
for i in range(135):
    num+=pow10
    if i%9==8: pow10*=10
    nums.append(num)

# add a few possible answers
for i in range(1,14):
    for j in range(1,10):
        t=str(j)+"8"+"9"*i
        nums.append(int(t))

# remove some bad numbers
nums.sort()
for i in range(len(nums))[::-1]:
    if i>=len(nums): continue
    ratio=nums[i]/(i+1)
    for j in range(i)[::-1]:
        ratio2=nums[j]/(j+1)
        if ratio2>ratio:
            nums.pop(j)

#print(len(nums))

k=int(input())
for i in range(k):
    print(nums[i])


Fixed submission:

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

nums=[]

num=0
pow10=1

# add a few possible answers
for i in range(16):
    t="9"*i
    if t!="": nums.append(int(t))
    for j in range(1,1000):
        t=str(j)+"9"*i
        if len(t)>15: continue
        nums.append(int(t))

def dsum(x):
    t=0
    while x:
        t+=x%10
        x//=10
    return t

# remove some bad numbers
out=[]
rat=[]
for i in sorted(set(nums)):
    j=i/dsum(i)
    while rat and rat[-1]>j:
        out.pop(-1)
        rat.pop(-1)
    out.append(i)
    rat.append(j)

#print(len(out))

#for i in range(len(out)): print(i,out[i],rat[i])

#for i in range(len(nums)):
#    print(i,dsum(nums[i]),nums[i]/dsum(nums[i]))

k=int(input())
for i in range(k):
    print(out[i])

Buggy python submission (verdict: Runtime Error):

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

nums=[]

num=0
pow10=1
for i in range(1000):
    num+=pow10
    if num>10**15: break
    if i%9==8: pow10*=10
    nums.append(num)

k=int(input())
for i in range(k):
    print(nums[i])


Fixed submission:

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

nums=[]

num=0
pow10=1

# add a few possible answers
for i in range(16):
    t="9"*i
    if t!="": nums.append(int(t))
    for j in range(1,1000):
        t=str(j)+"9"*i
        if len(t)>15: continue
        nums.append(int(t))

def dsum(x):
    t=0
    while x:
        t+=x%10
        x//=10
    return t

# remove some bad numbers
out=[]
rat=[]
for i in sorted(set(nums)):
    j=i/dsum(i)
    while rat and rat[-1]>j:
        out.pop(-1)
        rat.pop(-1)
    out.append(i)
    rat.append(j)

#print(len(out))

#for i in range(len(out)): print(i,out[i],rat[i])

#for i in range(len(nums)):
#    print(i,dsum(nums[i]),nums[i]/dsum(nums[i]))

k=int(input())
for i in range(k):
    print(out[i])
Buggy python submission (verdict: Time Limit Exceeded):
def prob_d():
    n = int(input())
    a_list = [int(a) for a in input().split()]
    sum_list = sum(a_list)
    ans_list = [sum_list - sum(a_list[1::2]) * 2] + [sum_list - sum(a_list[2::2]) * 2] + \
               [sum_list - sum(a_list[(i+1)::2]) * 2 -
                sum(a_list[i % 2:i-1:2]) * 2 for i in range(2, n-1)] + \
               [sum_list - sum(a_list[0:(n-2):2]) * 2]
    print(" ".join([str(a) for a in ans_list]))

prob_d()

Fixed submission:
def prob_d():
    n = int(input())
    a_list = [int(a) for a in input().split()]
    even_sum = sum(a_list[2::2])
    odd_sum = sum(a_list[1::2])
    sum_list = even_sum + odd_sum + a_list[0]
    ans = ""
    for i in range(n):
        if i % 2 == 0:
            ans += str(sum_list - odd_sum * 2)
            if i != n-1:
                odd_sum -= a_list[i+1]
                odd_sum += a_list[i]
        else:
            ans += str(sum_list - even_sum * 2)
            if i != n-1:
                even_sum -= a_list[i+1]
                even_sum += a_list[i]
        if i != n-1:
            ans += " "
    print(ans)

prob_d()
Buggy python submission (verdict: Runtime Error):
a = [x for x in input().split()]
if a[0] == a[1]:
    if a[0] != a[2] and a[2] == a[3]:
        print("Yes")
    else:
        print("No")
else:
    if a[0] == a[2] and a[1] == a[3]:
        print("Yes")
    elif a[0] == a[3] and a[1] == a[2]:
        print("Yes")
    else:
        print("No")

Fixed submission:
a = input()
if a[0] == a[1]:
    if a[0] != a[2] and a[2] == a[3]:
        print("Yes")
    else:
        print("No")
else:
    if a[0] == a[2] and a[1] == a[3]:
        print("Yes")
    elif a[0] == a[3] and a[1] == a[2]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N, P = [int(a) for a in input().split()]
# N, P = [10, 2972439611840]
prod = P
ans = 1
if N == 1:
    ans = P
else:
    for i in range(2, P):
        if i > 2 and i % 2 == 0:
            continue
        if prod < i ** N:
            break
        count = 0
        while prod % i == 0:
            prod /= i
            count += 1
            if count % N == 0:
                ans *= i
print(str(ans))

Fixed submission:
N, P = [int(a) for a in input().split()]
# N, P = [10, 2972439611840]
prod = P
ans = 1
if N == 1:
    ans = P
elif N > 40:
    ans = 1
else:
    for i in range(2, P):
        if i > 2 and i % 2 == 0:
            continue
        if prod < i ** N:
            break
        count = 0
        while prod % i == 0:
            prod /= i
            count += 1
            if count % N == 0:
                ans *= i
print(str(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, P = [int(a) for a in input().split()]
# N, P = 4, 972439611840
prod = P
ans = 1
for i in range(2, P):
    if prod < i ** N:
        break
    count = 0
    while prod % i == 0:
        prod /= i
        count += 1
        if count % N == 0:
            ans *= i

print(str(ans))

Fixed submission:
N, P = [int(a) for a in input().split()]
# N, P = [10, 2972439611840]
prod = P
ans = 1
if N == 1:
    ans = P
elif N > 40:
    ans = 1
else:
    for i in range(2, P):
        if i > 2 and i % 2 == 0:
            continue
        if prod < i ** N:
            break
        count = 0
        while prod % i == 0:
            prod /= i
            count += 1
            if count % N == 0:
                ans *= i
print(str(ans))