Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from itertools import product
H, W, N = list(map(int, input().split()))
A = [tuple(map(int, input().split())) for _ in range(N)]
count = {}
for x, y in A:
    for xx, yy in product(range(x-1, x+2), range(y-1, y+2)):
        if not(2 <= xx <= H-1 and 2 <= yy <= W-1):
            continue
        count[(xx, yy)] = count.get((xx, yy), 0) + 1
ans = [0] * 10
for k, v in count.items():
    ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
print(*ans, sep="\n")


Fixed submission:
from itertools import product

S = tuple(input())
N = len(S)
res = 0
for ops in product(["+", ""], repeat=N-1):
    exp = "".join([n + op for n, op in zip(S, ops+("",))]).strip("+")
    res += eval(exp)
print(res)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1500)

def f(x, y):
    if x == 0:
        return 0
    if x == y:
        return x
    x, y = min(x, y), max(x, y)
    return 2 * x + f(x, y - x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)


Fixed submission:
import sys
sys.setrecursionlimit(1500)

def f(x, y):
    if x == 0:
        return 0
    if y % x == 0:
        return 2 * (y // x) * x - x
    return 2 * (y // x) * x + f(y % x, x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1500)

def f(x, y):
    if x == y:
        return x
    x, y = min(x, y), max(x, y)
    return 2 * (y // x) * x + f(x, y % x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)


Fixed submission:
import sys
sys.setrecursionlimit(1500)

def f(x, y):
    if x == 0:
        return 0
    if y % x == 0:
        return 2 * (y // x) * x - x
    return 2 * (y // x) * x + f(y % x, x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)

Buggy python submission (verdict: Runtime Error):
def f(x, y):
    if x == y:
        return x
    x, y = min(x, y), max(x, y)
    return 2 * x + f(x, y - x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)


Fixed submission:
import sys
sys.setrecursionlimit(1500)

def f(x, y):
    if x == 0:
        return 0
    if y % x == 0:
        return 2 * (y // x) * x - x
    return 2 * (y // x) * x + f(y % x, x)

N, X = list(map(int, input().split()))
print(f(X, N-X) + N)
Buggy python submission (verdict: Runtime Error):
import sys

n,m=map(int,input().split())
ans=[]*(m+1)
output=0

for i in range(n):
    k=list(map(int,input().split()))
    for j in range(1,len(k)):
        ans[j]+=1

for i in ans:
    if ans[i]==n:
        output+=1

print(output)

Fixed submission:
import sys

n,m=map(int,input().split())
ans=[0]*(m+1)
output=0

for i in range(n):
    k=list(map(int,input().split()))
    for j in range(1,len(k)):
        ans[k[j]]+=1

for i in ans:
    if i==n:
        output+=1

print(output)

Buggy python submission (verdict: Runtime Error):
import sys

n,m=map(int,input().split())
ans=[0]*(m+1)
output=0

for i in range(n):
    k=list(map(int,input().split()))
    for j in range(1,len(k)):
        ans[j]+=1

for i in ans:
    if ans[i]==n:
        output+=1

print(output)

Fixed submission:
import sys

n,m=map(int,input().split())
ans=[0]*(m+1)
output=0

for i in range(n):
    k=list(map(int,input().split()))
    for j in range(1,len(k)):
        ans[k[j]]+=1

for i in ans:
    if i==n:
        output+=1

print(output)
Buggy python submission (verdict: Time Limit Exceeded):
n, w = map(int, input().split())

ws = [0] * n
vs = [0] * n

for i in range(n):
  a, b = map(int, input().split())
  ws[i] = a
  vs[i] = b
  
dp = [0] * (w + 1)

for i in range(n):
  for j in range(w, -1, -1):
    if j + ws[i] <= w:
      dp[j + ws[i]] = max(dp[j + ws[i]], dp[j] + vs[i])
      
print(dp[w])

Fixed submission:
n, w = map(int, input().split())

ws = [0] * n
vs = [0] * n

for i in range(n):
  a, b = map(int, input().split())
  ws[i] = a
  vs[i] = b
  
dp = [0] * (w + 1)

for i in range(n):
  for j in range(w, -1, -1):
    if j + ws[i] <= w:
      dp[j + ws[i]] = max(dp[j + ws[i]], dp[j] + vs[i])
      
print(dp[w])

Buggy python submission (verdict: Time Limit Exceeded):
n, w = map(int, input().split())

ws = []
vs = []

for i in range(n):
  a, b = map(int, input().split())
  ws.append(a)
  vs.append(b)

dp = [0] * (w + 1)

for i in range(n):
  for j in reversed(range(w + 1)):
    if j + ws[i] <= w:
      dp[j + ws[i]] = max(dp[j + ws[i]], dp[j] + vs[i])
      
print(dp[w])

Fixed submission:
n, w = map(int, input().split())

ws = [0] * n
vs = [0] * n

for i in range(n):
  a, b = map(int, input().split())
  ws[i] = a
  vs[i] = b
  
dp = [0] * (w + 1)

for i in range(n):
  for j in range(w, -1, -1):
    if j + ws[i] <= w:
      dp[j + ws[i]] = max(dp[j + ws[i]], dp[j] + vs[i])
      
print(dp[w])

Buggy python submission (verdict: Time Limit Exceeded):
n, w = map(int, input().split())

ws, vs = zip(*[map(int, input().split()) for _ in range(n)])

dp = [0] * (w + 1)

for i in range(n):
  for j in reversed(range(w + 1)):
    if j + ws[i] <= w:
      dp[j + ws[i]] = max(dp[j + ws[i]], dp[j] + vs[i])
      
print(dp[w])

Fixed submission:
n, w = map(int, input().split())

ws = [0] * n
vs = [0] * n

for i in range(n):
  a, b = map(int, input().split())
  ws[i] = a
  vs[i] = b
  
dp = [0] * (w + 1)

for i in range(n):
  for j in range(w, -1, -1):
    if j + ws[i] <= w:
      dp[j + ws[i]] = max(dp[j + ws[i]], dp[j] + vs[i])
      
print(dp[w])
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n == 1:
    print("Hello World")
else:
    a, b = map(int, input().split())
    print(a + b)

Fixed submission:
n = int(input())

if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    
    print(a + b)
Buggy python submission (verdict: Runtime Error):
h, w, d = map(int, input().split())

a = [list(map(int, input().split())) for i in range(h)]

dic = [0] * (h * w)

for i in range(h):
    for j in range(w):
        dic[a[i][j] - 1] = i, j

s = [[0] * (h * w // d + 1) for i in range(d)]

for i in range(d):
    for j in range(1, h * w // d + 1):
        b = i + d * (j - 1)
        c = i + d * j

        if c >= len(dic):
            break
        
        y, x = dic[b]
        ny, nx = dic[c]
        s[i][j] = s[i][j - 1] + abs(ny - y) + abs(nx - x)

q = int(input())

for i in range(q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1
    print(s[l % d][r // d] - s[l % d][l // d])


Fixed submission:
n = int(input())

print(n // 3)
Buggy python submission (verdict: Time Limit Exceeded):
h, w, d = map(int, input().split())

a = [list(map(int, input().split())) for i in range(h)]

#dict = {a[i][j]: (i, j) for i in range(h) for j in range(w)}

dic = [0] * (h * w)

for i in range(h):
    for j in range(w):
        dic[a[i][j] - 1] = i, j

q = int(input())

for i in range(q):
    l, r = map(int, input().split())
    
    ans = 0
    while l != r:
        y, x = dic[l - 1]
        ny, nx = dic[l + d - 1]
        
        ans += abs(ny - y) + abs(nx - x)
        l += d
        
    print(ans)

Fixed submission:
h, w, d = map(int, input().split())

a = [list(map(int, input().split())) for i in range(h)]

dic = [0] * (h * w)

for i in range(h):
    for j in range(w):
        dic[a[i][j] - 1] = i, j

s = [0] * (h * w)
        
for i in range(d, h * w):
    j = i - d
        
    y, x = dic[j]
    ny, nx = dic[i]
    s[i] = s[i - d] + abs(ny - y) + abs(nx - x)

q = int(input())

for i in range(q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1
    print(s[r] - s[l])
Buggy python submission (verdict: Runtime Error):
import math
import functools
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = functools.reduce(math.gcd, a)

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

Fixed submission:
import fractions
import functools
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = functools.reduce(fractions.gcd, a)

if max(a) >= k and k % g == 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):

def main():
    d = int(input())
    c = [-1] + list(map(int,input().split()))
    s = [0] * (d+1)
    last = [-1] + [0] * d
    for i in range(1,d+1):
        s[i] = [0] + list(map(int,input().split()))

    for i in range(1,d+1):
        mx = max(s[i])
        mx_ind = s.index(mx)
        print(mx_ind)



if __name__ == '__main__':
    main()


Fixed submission:


def main():

    for i in range(365):
        print(10)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import random

def main():
    d = int(input())
    for i in range(d):
        random.randint()
        print(random.randint(1,27))


if __name__ == '__main__':
    main()

Fixed submission:


def main():

    for i in range(365):
        print(10)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import random

def main():
    d = int(d)
    for _ in range(d):
        input()
    for i in range(d):
        random.randint()
        print(random.ranint(1,27))


if __name__ == '__main__':
    main()


Fixed submission:


def main():

    for i in range(365):
        print(10)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import turtle


def main():
    x = int(input())
    if False:
        print((360 // x) if 360%x == 0 else (360 // x)+1)
    else:
        k = 1
        temp = x
        while temp % 360 != 0:
            k += 1
            temp += x
        print(k)


    temp = 360 // x

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    x = int(input())
    if False:
        print((360 // x) if 360%x == 0 else (360 // x)+1)
    else:
        k = 1
        temp = x
        while temp % 360 != 0:
            k += 1
            temp += x
        print(k)


    temp = 360 // x

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = list(map(int,input().split()))
    temp = 1
    for n in a:
        temp *= n
    if temp > (10 ** 18):
        temp = -1
    print(temp)

if __name__ == '__main__':
    main()


Fixed submission:

def main():
    n = int(input())
    a = list(map(int,input().split()))
    temp = 1
    if 0 in a:
        temp = 0

    for n in a:
        if temp == -1:
            break
        temp *= n
        if temp > 10 ** 18:
            temp = -1
            break
    print(temp)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):

def main():
    n = int(input())
    a = list(map(int,input().split()))
    temp = 1
    for n in a:
        temp *= n
    if temp > (10 ** 18):
        temp = -1
    print(temp)

if __name__ == '__main__':
    main()


Fixed submission:

def main():
    n = int(input())
    a = list(map(int,input().split()))
    temp = 1
    if 0 in a:
        temp = 0

    for n in a:
        if temp == -1:
            break
        temp *= n
        if temp > 10 ** 18:
            temp = -1
            break
    print(temp)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):

n,m,q = map(int,input().split())
num_lst = []
for i in range(q):
    num_lst.append(list(map(int,input().split())))
l = list(range(1,m+1))
A = list(combinations_with_replacement(l,n))

mx = 0
for now_A in A:
    score = 0
    for nums in num_lst:
        a,b,c,d = nums
        if now_A[b-1] - now_A[a-1] == c:
            score += d
    mx = max(mx,score)
print(mx)





Fixed submission:
from itertools import combinations_with_replacement


def main():
    n,m,q = map(int,input().split())
    num_lst = []
    for i in range(q):
        num_lst.append(list(map(int,input().split())))
    l = list(range(1,m+1))
    A = list(combinations_with_replacement(l,n))

    mx = 0
    for now_A in A:
        score = 0
        for nums in num_lst:
            a,b,c,d = nums
            if now_A[b-1] - now_A[a-1] == c:
                score += d
        mx = max(mx,score)
    print(mx)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
print(2 * r *3.14159265359 )

Fixed submission:
print(2 * int(input()) *3.14159265359 )

Buggy python submission (verdict: Runtime Error):
print(2 * r *3.14159265359 )

Fixed submission:
print(2 * int(input()) *3.14159265359 )
Buggy python submission (verdict: Time Limit Exceeded):
import math

K = int(input())

ans = 0
for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      tmp = math.gcd(a,b)
      ans += math.gcd(tmp, c)

print(ans)


Fixed submission:
#-------------------------------------------------------------------------------
# Name:        module6
# Purpose:
#
# Author:      user
#
# Created:     12/04/2020
# Copyright:   (c) user 2020
# Licence:     <your licence>
#-------------------------------------------------------------------------------
from math import gcd



def main():
    k = int(input())
    total = 0

    for a in range(1,k+1):
        for b in range(1,k+1):
            for c in range(1,k+1):
                total += gcd(gcd(a,b),c)
    print(total)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    s = input()
    q = int(input())
    hanten = False
    for i in range(q):
        query = input().split()
        if query[0] == "1":
            hanten = not hanten
        else:
            if query[1] == "1":
                if hanten:
                    s = s + query[2]
                else:
                    s = query[2] + s
            if query[1] == "2":
                if hanten:
                    s = query[2] + s
                else:
                    s = s + query[2]
    print(s if not hanten else s[::-1])



if __name__ == '__main__':
    main()


Fixed submission:

def main():
    n,blue,red = map(int,input().split())
    total = blue+red
    answer = 0
    answer += (n // total) * blue
    amari = min(blue,(n % total))
    answer += amari
    print(answer)




if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
    c = input()
    print(chr(ord(c)+1))

Fixed submission:
c = input()

print(chr(ord(c)+1))

Buggy python submission (verdict: Runtime Error):
c = input()
print(chr(ord("")+1))

Fixed submission:
c = input()

print(chr(ord(c)+1))
Buggy python submission (verdict: Runtime Error):
n =int(input())
s=[""]*n
t=[0]*n
for i in range(n):
  s[i],t[i] =[s,int(t) for s,t in input().split()]
r = [0] * (n+1)  
for i in range(1,n+1):
  r[i] = r[i-1] + t[i-1]
x=input()
ind = s.index(x)
print(r[n] - r[ind])

Fixed submission:


def main():
    n = int(input())
    s = [0] * n
    t = [0] * n
    all_time_count = 0

    for i in range(n):
        s[i],t[i] = input().split()
        t[i] = int(t[i])
        all_time_count += t[i]
    x = input()
    time_count = 0
    for i in range(n):
        time_count += t[i]
        if s[i] == x:
            break
    print(all_time_count - time_count)




if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input.split())

a=max(a-k,0)
k=max(k-a,0)
b=max(b-k,0)
print(a,b)

Fixed submission:

a,b,k=map(int,input().split())

a1=max(a-k,0)
k=max(k-a,0)
b=max(b-k,0)
print(a1,b)
Buggy python submission (verdict: Runtime Error):
x = int(input())

num = x // 100



dp = ["?"] * x
dp[0] = "Yes"

for i in range(1,x+1):
    if i <= 99:
        dp[i] = "No"
    elif i in (100,101,102,103,104,105):
        dp[i] = "Yes"
    else:
        if "Yes" in(dp[i-100],dp[i-101],dp[i-102],dp[i-103],dp[i-104],dp[i-105]):
            dp[i] = "Yes"
        else:
            dp[i] = "No"

            
print(dp[x])

Fixed submission:
x = int(input())

num = x // 100



dp = ["?"] * (x+1)
dp[0] = "1"

for i in range(1,x+1):
    if i <= 99:
        dp[i] = "0"
    elif i in (100,101,102,103,104,105):
        dp[i] = "1"
    else:
        if "1" in(dp[i-100],dp[i-101],dp[i-102],dp[i-103],dp[i-104],dp[i-105]):
            dp[i] = "1"
        else:
            dp[i] = "0"

            
print(dp[x])

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
item_num = x // 100

def brute(t):
    for i in range(t+1):
        for j in range(t+1-i):
            for k in range(t+1-i-j):
                for l in range(t+1-i-j-k):
                    for m in range(t+1-i-j-k-l):
                            n = t - i - j -k - l - m
                            total = i + j + k + l + m + n
                            if total == t and (100 * i + 101 * j + 102 * k +  103 * l + 104 * m + 105 * n ) == x:
                                return 1
    return 0

print(brute(item_num))


Fixed submission:
x = int(input())

num = x // 100



dp = ["?"] * (x+1)
dp[0] = "1"

for i in range(1,x+1):
    if i <= 99:
        dp[i] = "0"
    elif i in (100,101,102,103,104,105):
        dp[i] = "1"
    else:
        if "1" in(dp[i-100],dp[i-101],dp[i-102],dp[i-103],dp[i-104],dp[i-105]):
            dp[i] = "1"
        else:
            dp[i] = "0"

            
print(dp[x])

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
item_num = x // 100

def brute(t):
    for i in range(t+1):
        for j in range(t+1-i):
            for k in range(t+1-i-j):
                for l in range(t+1-i-j-k):
                    for m in range(t+1-i-j-k-l):
                        for n in range(t+1-i-j-k-l-m):
                            total = i + j + k + l + m + n
                            if total == t and (100 * i + 101 * j + 102 * k +  103 * l + 104 * m + 105 * n ) == x:
                                return 1
    return 0

print(brute(item_num))

Fixed submission:
x = int(input())

num = x // 100



dp = ["?"] * (x+1)
dp[0] = "1"

for i in range(1,x+1):
    if i <= 99:
        dp[i] = "0"
    elif i in (100,101,102,103,104,105):
        dp[i] = "1"
    else:
        if "1" in(dp[i-100],dp[i-101],dp[i-102],dp[i-103],dp[i-104],dp[i-105]):
            dp[i] = "1"
        else:
            dp[i] = "0"

            
print(dp[x])
Buggy python submission (verdict: Runtime Error):
    n = int(input())
    s = input()
    half = n//2
     
    if s == (s[0:half] + s[0:half]):
             print("Yes")
    else:
             print("No")

Fixed submission:
n = int(input())
s = input()
half = n//2

if half == 0:
  				print("No")

elif s == (s[0:half] + s[0:half]):
                 print("Yes")
else:
                 print("No")

Buggy python submission (verdict: Runtime Error):
n = int(inpur())
s = input()
half = n//2

if s == (s[0:half] + s[0:half]:
         print("Yes")
else:
         print("No")

Fixed submission:
n = int(input())
s = input()
half = n//2

if half == 0:
  				print("No")

elif s == (s[0:half] + s[0:half]):
                 print("Yes")
else:
                 print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split)

def solve(a,b):
  if a<=9 and b<=9:
    return a * b
  else:
    return -1
  
print(solve(a,b))

Fixed submission:
a,b = map(int,input().split())
     
def solve(a,b):
  if a<=9 and b<=9:
    return a * b
  else:
    return -1
  
print(solve(a,b))

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

def solve(a,b)
	if a <= 9 and b <= 9:
  	  return a * b
  	else:
      return pr
    
print(solve(a,b))

Fixed submission:
a,b = map(int,input().split())
     
def solve(a,b):
  if a<=9 and b<=9:
    return a * b
  else:
    return -1
  
print(solve(a,b))
Buggy python submission (verdict: Runtime Error):
 n=int(input())
 odd=(n+1)//2
 print(odd/n)

Fixed submission:
n=int(input())
odd=(n+1)//2
print(odd/n)
Buggy python submission (verdict: Runtime Error):
#「県ごとの市の「市番号(id)、誕生年(year)」リスト」と「市番号順の市の認識番号(tag)リスト」を用意する

class City:
    #市番号と誕生年を管理する
    def __init__(self,id,y):
        self.id = id
        self.year = y


def main():
    n,m = map(int,input().split())
    pre_lst = [[] for _ in range(n)]  #各県に含まれる市のリスト
    city_tags = [0 for _ in range(m)] #上記のリストから作った市の認識番号を格納するためのリスト

    for i in range(m):
        p,y = map(int,input().split())
        pre_lst[p-1].append(City(i,y))　#入力を受け取り、県ごとのリストを作る

    for pre_num,pre in enumerate(pre_lst):
        if len(pre) <= 0:
            continue
        pre.sort(key = lambda x:x.year) #各県ごとに誕生年順にソート

        counter = 0 #認識番号の右側、何番目に誕生した都市かを作るためのカウンター
        for city in pre:
            city_tags[city.id] = str(pre_num+1).zfill(6) + str(counter+1).zfill(6)
            counter += 1
    for tag in city_tags:
        print(tag)


if __name__ == '__main__':
    main()


Fixed submission:
class City:
    def __init__(self,id,y):
        self.id = id
        self.year = y


def main():
    n,m = map(int,input().split())
    pre_lst = [[] for _ in range(n)]
    city_tags = [0 for _ in range(m)]

    for i in range(m):
        p,y = map(int,input().split())
        pre_lst[p-1].append(City(i,y))

    for pre_num,pre in enumerate(pre_lst):
        if len(pre) <= 0:
            continue
        pre.sort(key = lambda x:x.year)
        counter = 0
        for city in pre:
            city_tags[city.id] = str(pre_num+1).zfill(6) + str(counter+1).zfill(6)
            counter += 1
    for tag in city_tags:
        print(tag)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):

def main():
    N,M,X,Y = map(int,input().split())

    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    x_max = max(x_s)
    y_min = min(y_s)

    ok = False
    for z in range(-101,101):
        #print(z)
        if x_max < z and y_min >= z and X < z and x <= Y:
            ok = True
            break
    answer =  "War" if ok else "No War"
    print(answer)





if __name__ == '__main__':
    main()


Fixed submission:

def main():
    N,M,X,Y = map(int,input().split())
    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    ok = False
    for z in range(X+1,Y+1):
        if z > max(x_s) and z <= min(y_s):
            ok = True
            break

    print("No War" if ok else "War")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
from math import gcd
from functools import reduce

def main():
    n,x = map(int,input().split())
    x_s = [int(i) for i in input().split()]
    x_s = sorted(x_s)
    diffs = []
    for i in x_s:
        diffs.append(abs(x-i))
    print(reduce(gcd,diffs))

if __name__ == '__main__':
    main()


Fixed submission:
from fractions import gcd
from functools import reduce

def main():
    n,x = map(int,input().split())
    x_s = [int(i) for i in input().split()]
    x_s = sorted(x_s)
    diffs = []
    for i in x_s:
        diffs.append(abs(x-i))
    print(reduce(gcd,diffs))





if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
from numpy import gcd

def main():
    n,x = map(int,input().split())
    x_s = [int(i) for i in input().split()]
    x_s = sorted(x_s)
    diffs = []
    for i in x_s:
        diffs.append(abs(x-i))
    print(gcd.reduce(diffs))





if __name__ == '__main__':
    main()


Fixed submission:
from fractions import gcd
from functools import reduce

def main():
    n,x = map(int,input().split())
    x_s = [int(i) for i in input().split()]
    x_s = sorted(x_s)
    diffs = []
    for i in x_s:
        diffs.append(abs(x-i))
    print(reduce(gcd,diffs))





if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
s = int(input())

sm = sum([int(c) for c in s])
if s%sm == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
s=sum([i for i in map(int,str(n))])
if n % s == 0:
  print("Yes")
else:
  print("No")