Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[1]

for i in range(1,n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]

print(count)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]

for i in range(n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
count = 1

for i in range(1,n):
    if p[i] == min(p[0:(i+1)]):
        count += 1
        
print(count)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]

for i in range(n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]

print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
count = 0

for i in range(n):
    if p[i] == min(p[0:i]):
        count += 1
        
print(count)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]

for i in range(n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]

print(count)
Buggy python submission (verdict: Runtime Error):
a = input()
abc = 'abcdefghijklmnopqrstuvwxyz'

for i in range(26):
    if a = abc[i]:
        print(abc[i+1])
        break

Fixed submission:
a = input()
abc = 'abcdefghijklmnopqrstuvwxyz'

for i in range(26):
    if a == abc[i]:
        print(abc[i+1])
        break
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
count = 0

for i in range(len(s-2)):
    if s[i,i+2] == abc:
        count += 1

print(count)

Fixed submission:
n = int(input())
s = input()
count = 0

for i in range(n-2):
    if s[i]+s[i+1]+s[i+2] == 'ABC':
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
import math

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

def lcm(a,b):
    return (a*b) // math.gcd(a,b)

print(lcm(a,b))

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

n = max(a,b)
m = min(a,b)

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

def lcm(n,m):
    return (n*m) // gcd(n,m)
    
print(lcm(n,m))

Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())

def lcm(a,b):
    return (a*b) // math.gcd(a,b)
  
print(lcm(a,b))

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

n = max(a,b)
m = min(a,b)

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

def lcm(n,m):
    return (n*m) // gcd(n,m)
    
print(lcm(n,m))
Buggy python submission (verdict: Runtime Error):
s = input()
rs = reversed(s)
count = 0

for i in range((len(s) // 2):
    if s[i] != rs[i]:
        count += 1
print(count)

Fixed submission:
s = input()

a = len(s) // 2
count = 0

for i in range(a):
    if s[i] != s[-(i+1)]:
        count += 1
            
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 'No'

for i in range(1,10):
    for j in range(1,10):
        
if n == i*j:
    ans = 'Yes'
    break
    
print(ans)

Fixed submission:
n = int(input())
ans = 'No'

for i in range(1,10):
    for j in range(1,10):
        if n == i*j:
            ans = 'Yes'
            break
    
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

a, b, x = map(int,input().split())
c = b-(x/a**2)
d = a*b

if c <= b//2:
    print(np.degrees(np.arctan2(b-(x / a**2),a/2)))

else:
    print(np.degrees(np.arctan2(x / d),b))

Fixed submission:
import numpy as np

a, b, x = map(int,input().split())
c = b-(x/a**2)
d = (a*b)/2

if c <= b/2:
    print(np.degrees(np.arctan2(c,a/2)))
    
else:
    print(np.degrees(np.arctan2(b,(x/d))))
Buggy python submission (verdict: Runtime Error):
n,l = map(int,input().split())
t = list(l + i - 1) for i in range(1,n)

if min(t) > 0:
    p = sum(t) - l
elif max(t) > 0:
    p = sum(t)
else:
    p = sum(t) - max(t)
print(p)

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

t = [(l + i - 1) for i in range(1,n + 1)]

if t[0] >= 0:
    p = sum(t) - l
elif t[-1] > 0:
    p = sum(t)
else:
    p = sum(t) - t[-1]

print(p)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d = map(int,input().split())

a_b = [i for i in range(a,b+1) if i % c == 0 or i % d == 0]

ans = (b + 1 - a) - len(a_b)
print(ans)

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

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

CD = (c * d) // gcd(c,d)

h_b =b - (b // c) - (b // d) + (b // CD)
h_a = (a - 1) - (a - 1) // c - (a - 1) // d + (a - 1) // CD

print(h_b - h_a)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d = map(int,input().split())

count = 0

for i in range(a,b+1):
        if i % c == 0:
            count += 1
        elif i % d == 0:
            count += 1

ans = (b+1 - a - count)
print(ans)

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

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

CD = (c * d) // gcd(c,d)

h_b =b - (b // c) - (b // d) + (b // CD)
h_a = (a - 1) - (a - 1) // c - (a - 1) // d + (a - 1) // CD

print(h_b - h_a)
Buggy python submission (verdict: Runtime Error):
x,a = map(int,input().split())
if x >= a
    print(10)
else:
    print(0)

Fixed submission:
x,a = map(int,input().split())
if x >= a:
    print(10)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())

print(-(-(n-1) // (k-1)))

Fixed submission:
s = list(input())
ans = 0
for i in s:
    if i == '+':
        ans += 1
    else:
        ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
d,n = map(int,input().split())

if n == 100:
    a = 99

m = 100 ** d
print(a * m)

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

if n == 100:
    a = 101
else:
    a = n

m = 100 ** d
print(a * m)
Buggy python submission (verdict: Runtime Error):
x = int(input())
a = set()

for i in range(2,32):
    for j in range(10):
        if i ** j >= x:
            break
        a.add(i ** j)
print(max(a))

Fixed submission:
x = int(input())
a = [1]

for i in range(2,32):
    for j in range(2,11):
        if i ** j > x:
            break
        a.append(i ** j)
print(max(a))
Buggy python submission (verdict: Runtime Error):
n = input()
if n[-1] == ("2"or"4"or"5"or"7",or9") :
    print("hon")
elif n[-1] in("0"or"1"or"6"or"8"):
    print("pon")
else:
    print("bon")


Fixed submission:
n = input()
if (n[-1] == "2")or(n[-1] == "4")or(n[-1] == "5")or(n[-1] == "7")or(n[-1] == "9") :
    print("hon")
elif (n[-1] == "0")or(n[-1] == "1")or(n[-1] == "6")or(n[-1] == "8"):
    print("pon")
else:
    print("bon")

Buggy python submission (verdict: Runtime Error):
N = int(sys.argv[1])

dev_type = ""
if N%10==(2or4or5or7or9):
  dev_type = "hon"
elif if N%10==(0or1or6or8):
  dev_type = "pon"
else:
  dev_type = "hon"
  
print(dev_type)

Fixed submission:
n = input()
if (n[-1] == "2")or(n[-1] == "4")or(n[-1] == "5")or(n[-1] == "7")or(n[-1] == "9") :
    print("hon")
elif (n[-1] == "0")or(n[-1] == "1")or(n[-1] == "6")or(n[-1] == "8"):
    print("pon")
else:
    print("bon")

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

N = sys.argv[1]

dev_type = ""
  
if (N%10 == 2) or (N%10 == 4) or (N%10 == 5)or (N%10 == 7)or (N%10 == 9):
  dev_type == "hon"
elif (N%10 == 0) or (N%10 == 1) or (N%10 == 6)or (N%10 == 8):
  dev_type == "pon"
else:
  dev_type = "bon"

print(dev_type)



Fixed submission:
n = input()
if (n[-1] == "2")or(n[-1] == "4")or(n[-1] == "5")or(n[-1] == "7")or(n[-1] == "9") :
    print("hon")
elif (n[-1] == "0")or(n[-1] == "1")or(n[-1] == "6")or(n[-1] == "8"):
    print("pon")
else:
    print("bon")
Buggy python submission (verdict: Runtime Error):
[K,S] = input()

if len(S)>K:
     print(S[:K]+"...")
else:
    print(S)



Fixed submission:
k=int(input())
s=input()
if (len(s)>k):
    print(s[:k]+"...")
else:
    print(s)
Buggy python submission (verdict: Runtime Error):
i = int(input())
s= input()
if len(s) > k:
  s=s[:k] + "..."
print(s)

Fixed submission:
i = int(input())
s= input()
if len(s) > i:
	s=s[:i] + "..."
print(s)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N,M = map(int,input().split())
A = [None]*M
B = [None]*M
for i in range(M):
    A[i],B[i] = map(int,input().split())

route_flag = [0]*(N+1)
route_flag[1] = 1
route = [None] * (N+1)
path_clear = 0


while path_clear < M:
    k = 0
    length = len(A)
    for i in range(length):
        if route_flag[A[i-k]] == 1 and route_flag[B[i-k]] == 0:
            route_flag[B[i-k]] = 1
            path_clear += 1
            route[B[i-k]] = A[i-k]
            del A[i-k]
            del B[i-k]
            k += 1
        elif route_flag[B[i-k]] == 1 and route_flag[A[i-k]] == 0:
            route_flag[A[i-k]] = 1
            path_clear += 1
            route[A[i-k]] = B[i-k]
            del A[i-k]
            del B[i-k]
            k += 1
        elif route_flag[A[i-k]] == 1 and route_flag[B[i-k]] == 1:
            del A[i-k]
            del B[i-k]
            path_clear += 1
            k += 1

    if k == 0:
            print('No')
            sys.exit()

route = route[2:]
print('Yes')
for i in range(len(route)):
    print(route[i])


Fixed submission:
N = int(input())

hon_list = [2,4,5,7,9]
pon_list = [0,1,6,8]
bon_list = [3]

if N%10 in hon_list:
    print('hon')
elif N%10 in pon_list:
    print('pon')
elif N%10 in bon_list:
    print('bon')
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
H = list(map(int,input().split()))
road = []
for i in range(M):
    road.append(list(map(int,input().split())))

good_ob = []
for i in range(N):
    good_ob.append(i+1)

for i in range(M):
    if H[road[i][0]-1] > H[road[i][1]-1]:
        if road[i][1] in good_ob:
            good_ob.remove(road[i][1])
    elif H[road[i][0]-1] < H[road[i][1]-1]:
        if road[i][0] in good_ob:
            good_ob.remove(road[i][0])
    else:
        if road[i][1] in good_ob:
            good_ob.remove(road[i][1])
        if road[i][0] in good_ob:
            good_ob.remove(road[i][0])


print(len(good_ob))


Fixed submission:
N,M = map(int,input().split())
H = list(map(int,input().split()))
road = []
for i in range(M):
    road.append(list(map(int,input().split())))

bad_ob = []

for i in range(M):
    if H[road[i][0]-1] > H[road[i][1]-1]:
        bad_ob.append(road[i][1]-1)
    elif H[road[i][0]-1] < H[road[i][1]-1]:
        bad_ob.append(road[i][0]-1)
    else:
        bad_ob.append(road[i][0]-1)
        bad_ob.append(road[i][1]-1)


print(N-len(set(bad_ob)))
Buggy python submission (verdict: Runtime Error):
import math

K = input()
distance = list(map(int,input().split()))

for i in range(distance[1]-distance[0]+1):
    if (distance[0]+i) % K == 0:
        print("OK")

print("NG")


Fixed submission:
import math
import sys

K = int(input())
distance = list(map(int,input().split()))


for i in range(distance[1]-distance[0]+1):
    if (distance[0]+i) % K == 0:
        print("OK")
        sys.exit()

print("NG")

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

K = input()
distance = list(map(int,input().split()))

for i in range(len(distance)):
    if distance[i] % K == 0:
        print("OK")

print("NG")

Fixed submission:
import math
import sys

K = int(input())
distance = list(map(int,input().split()))


for i in range(distance[1]-distance[0]+1):
    if (distance[0]+i) % K == 0:
        print("OK")
        sys.exit()

print("NG")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
for i in range(N):
    temp = input()
    if(temp not in S):
        S.append(temp)

print(len(S))



Fixed submission:
N = int(input())
S = []
for i in range(N):
    S.append(input())

S.sort()

dup = 0;
for i in range(N):
    if i!=0:
        if S[i] == S[i-1]:
            dup += 1

print(N-dup)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [0]
flag = 0
for i in range(N):
    if i==0:
        S[i] = input()
    else:
        temp = input()
        for j in range(len(S)):
            if S[j]==temp:
                flag = 1
        if flag==0:
            S = S + [temp]
        flag = 0

print(len(S))


Fixed submission:
N = int(input())
S = []
for i in range(N):
    S.append(input())

S.sort()

dup = 0;
for i in range(N):
    if i!=0:
        if S[i] == S[i-1]:
            dup += 1

print(N-dup)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [0]*N
for i in range(N):
    S[i] = input()

prize = [S[1]]
flag = 0
for i in range(N):
    for j in range(len(prize)):
        if(S[i] == prize[j]):
            flag = 1
    if(flag==0):
        prize = prize + [S[i]]
    flag = 0


print(len(prize))


Fixed submission:
N = int(input())
S = []
for i in range(N):
    S.append(input())

S.sort()

dup = 0;
for i in range(N):
    if i!=0:
        if S[i] == S[i-1]:
            dup += 1

print(N-dup)
Buggy python submission (verdict: Runtime Error):
n = int(input())
flag = 1

n_1 = (n-(n//10)*10)
n_10 = (n-(n//100)*100 - n_1)//10
n_100 = (n - n_1 - n_10*10)//100

if(n_1!=7 && n_10!=7 && n_100!=7):
  flag = 0

if flag == 0 :
  print("NO")
else:
  print("YES")

Fixed submission:
import sys

n = input()
for i in range(3):
    if(n[i] == "7"):
        print("Yes")
        sys.exit()

print("No")

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

n = input()
for i in range(3):
  if(n[i] == "7"):
    printf("YES")
    sys.exit()

printf("NO")

Fixed submission:
import sys

n = input()
for i in range(3):
    if(n[i] == "7"):
        print("Yes")
        sys.exit()

print("No")
Buggy python submission (verdict: Time Limit Exceeded):
k,n = map(int,input().split())
A = list(map(int,input().split()))

for i in range(n-1):
    for j in range(n-1-i):
        if A[j] > A[j+1]:
            A[j],A[j+1] = A[j+1],A[j]


max_d = 0
max_index = 0
for i in range(n-1):
    if A[i+1] - A[i] > max_d:
        max_d = A[i+1]-A[i]
        max_index = i

if k-A[n-1]+A[0] > max_d:
    max_d = k-A[n-1]+A[0]
    max_index = n-1

min_distance = 0

if(max_index != n-1):
    min_distance = A[max_index]+k-A[max_index+1]
else:
    min_distance = A[n-1]-A[0]

print(min_distance)


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


max_d = 0
max_index = 0
for i in range(n-1):
    if A[i+1] - A[i] > max_d:
        max_d = A[i+1]-A[i]
        max_index = i

if k-A[n-1]+A[0] > max_d:
    max_d = k-A[n-1]+A[0]
    max_index = n-1

min_distance = 0

if(max_index != n-1):
    min_distance = A[max_index]+k-A[max_index+1]
else:
    min_distance = A[n-1]-A[0]

print(min_distance)
Buggy python submission (verdict: Runtime Error):
S = list(input())
T = list(input())
ans = 0

for i in range(3):
  if S[i] = T[i]:
    ans += 1

print(ans)

Fixed submission:
S = list(input())
T = list(input())
ans = 0

for i in range(3):
  if S[i] == T[i]:
    ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0

if N == 1:
  print(ans)
  exit()

for i in range(N-1):
  ans = ans + i + 1

print(ans)

Fixed submission:
N = int(input())
ans = 0

ans = (N*(N-1))//2

print(ans)
Buggy python submission (verdict: Runtime Error):
data = list(map(int,input().sprit()))
add = data[0] + data[1]
sub = data[0] - data[1]
mul = data[0] * data[1]
result = [add,sub,mul]
ans = add
if sub > ans:
  ans = sub
if mul > ans:
  ans = mul
return ans

Fixed submission:
data = list(map(int,input().split()))
add = data[0] + data[1]
sub = data[0] - data[1]
mul = data[0] * data[1]
result = [add,sub,mul]
ans = add
if sub > ans:
  ans = sub
if mul > ans:
  ans = mul
print(ans)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0

c500 = X // 500

if c500 > A:
    print(ans)
    exit()

for i in range(c500 + 1):
    c100 = (X - i*500) / 100
    if c100 > B:
        continue
    for j in range(c100 + 1):
        c50 = (X - i*500 - j*100)/50
        if c50 <= C:
           ans += 1

print(ans)

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

ans = 0

c500 = X // 500

if c500 > A:
    c500 = A

for i in range(c500 + 1):
    c100 = (X - i*500) // 100
    if c100 > B:
        c100 = B
    for j in range(c100 + 1):
        c50 = (X - i*500 - j*100) // 50
        if c50 <= C:
           ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0

c500 = X // 500

for i in range(c500 + 1):
    c100 = (X - i*500) / 100
    if c100 > B:
        continue
    for j in range(c100+1):
        c50 = (X - i*500 - j*100)/50
        if c50 <= C:
           ans += 1

print(ans)

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

ans = 0

c500 = X // 500

if c500 > A:
    c500 = A

for i in range(c500 + 1):
    c100 = (X - i*500) // 100
    if c100 > B:
        c100 = B
    for j in range(c100 + 1):
        c50 = (X - i*500 - j*100) // 50
        if c50 <= C:
           ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a b = map(int, input().split())
c = a*b
if c % 2 == 1:
    print('Odd')
else:
    print('Even')


Fixed submission:
a,b = map(int, input().split())
c = a*b
if c % 2 == 1:
    print('Odd')
else:
    print('Even')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    print(a.count(i+1))

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
for i in range(n):
    print(c[i+1])
Buggy python submission (verdict: Runtime Error):
x = int()[-1]

if x == [2,4,5,7,9]:
    print("hon")

elif x == [0,1,6,8]:
    print("pon")

else:
    print("bon")


Fixed submission:
x = int(input()[-1])

if x in [2,4,5,7,9]:
    print("hon")

elif x in [0,1,6,8]:
    print("pon")

else:
    print("bon")

Buggy python submission (verdict: Runtime Error):
x = input()

if x{-1} == [2,4,5,7,9]:
    print("hon")

elif x{-1} == [0,1,6,8]:
    print("pon")

else:
    print("bon")


Fixed submission:
x = int(input()[-1])

if x in [2,4,5,7,9]:
    print("hon")

elif x in [0,1,6,8]:
    print("pon")

else:
    print("bon")

Buggy python submission (verdict: Runtime Error):
x =  int(input())[-1]

if x == [2,4,5,7,9]:
    print("hon")

elif x == [0,1,6,8]:
    print("pon")

else:
    print("bon")

Fixed submission:
x = int(input()[-1])

if x in [2,4,5,7,9]:
    print("hon")

elif x in [0,1,6,8]:
    print("pon")

else:
    print("bon")

Buggy python submission (verdict: Runtime Error):
x =  int(input())[-1]
if x == [2,4,5,7,9]:
    print("hon")

elif x == [0,1,6,8]:
    print("pon")

else:
    print("bon")

Fixed submission:
x = int(input()[-1])

if x in [2,4,5,7,9]:
    print("hon")

elif x in [0,1,6,8]:
    print("pon")

else:
    print("bon")
Buggy python submission (verdict: Runtime Error):
s= str(input())
k= int(input())


a=len(s)

if k >= a:
  print(s)

else :
  print(s[:k]+"...")

Fixed submission:

k= int(input())
s= input()

a=len(s)

if k >= a:
  print(s)

else :
  print(s[:k]+"...")

Buggy python submission (verdict: Runtime Error):
k=int(input())
s=input()

a=len(s)

if k>=a:
print(s)

else :
print(s[:k]+"...")


Fixed submission:

k= int(input())
s= input()

a=len(s)

if k >= a:
  print(s)

else :
  print(s[:k]+"...")

Buggy python submission (verdict: Runtime Error):
k=int(input())
s=str(input())

a=len(s)

if k>=a:
print(s)

else :
print(s[:k]+"...")

Fixed submission:

k= int(input())
s= input()

a=len(s)

if k >= a:
  print(s)

else :
  print(s[:k]+"...")

Buggy python submission (verdict: Runtime Error):
k=str(input())
s=int(input())

a=len(s)

if k>=a:
print(s)

else k<a:
print(s[k]+"...")

Fixed submission:

k= int(input())
s= input()

a=len(s)

if k >= a:
  print(s)

else :
  print(s[:k]+"...")

Buggy python submission (verdict: Runtime Error):
s=str(input())
k=int(input())
a=len(s)

if k<a
print(s)

elif k>a
print(k+"...")

Fixed submission:

k= int(input())
s= input()

a=len(s)

if k >= a:
  print(s)

else :
  print(s[:k]+"...")

Buggy python submission (verdict: Runtime Error):
s=input()
k=input()
a=len(k)

if s<a
print(s)

elif s>a
print(k+"...")

Fixed submission:

k= int(input())
s= input()

a=len(s)

if k >= a:
  print(s)

else :
  print(s[:k]+"...")
Buggy python submission (verdict: Runtime Error):
import numpy as np
# -*- coding: utf-8 -*-
N = int(input())
X = np.zeros((N, 2))
for i in range(N):
    X[i,:] = list(map(int, input().split()))
print("{0}".format((((np.abs(X @ X.T))[np.triu_indices(N, 1)] > 0).sum() + N)% 1000000007) )

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input()[-1])

print("{0}".format("hon" if N in [2,4,5,7,9] else "pon" if N in [0, 1, 6, 8] else "bon"))
Buggy python submission (verdict: Runtime Error):
import numpy as np
# -*- coding: utf-8 -*-
A, B, C, K = map(int, input().split())
W = np.array([[0,1,1], [1,0,1], [1,1,0]])
bef_X = np.array([A, B, C])
aft_X = np.linalg.matrix_power(W, K) @ bef_X

ans = aft_X[0] - aft_X[1]

print("{0}".format(ans if ans <= 10**18 else 'unfair'))

Fixed submission:
import numpy as np
# -*- coding: utf-8 -*-
A, B, C, K = map(int, input().split())
W = np.array([[0,1,1], [1,0,1], [1,1,0]])
bef_X = np.array([A, B, C])
aft_X = np.dot(np.linalg.matrix_power(W, K),  bef_X)

ans = aft_X[0] - aft_X[1]

print("{0}".format(ans if ans <= 10**18 else 'unfair'))

Buggy python submission (verdict: Runtime Error):
import numpy as np
# -*- coding: utf-8 -*-
A, B, C, K = map(int, input().split())
bef_X = np.array([A, B, C])
aft_X = np.linalg.matrix_power(W, K) @ bef_X

ans = aft_X[0] - aft_X[1]

print("{0}".format(ans if ans <= 10**18 else 'unfair'))

Fixed submission:
import numpy as np
# -*- coding: utf-8 -*-
A, B, C, K = map(int, input().split())
W = np.array([[0,1,1], [1,0,1], [1,1,0]])
bef_X = np.array([A, B, C])
aft_X = np.dot(np.linalg.matrix_power(W, K),  bef_X)

ans = aft_X[0] - aft_X[1]

print("{0}".format(ans if ans <= 10**18 else 'unfair'))
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N[-1] == 2 or 4 or 5 or 7 or 9:
    print("hon")
elif N[-1] == 0 or 1 or 6 or 8:
    print("pon")
elif N[-1] == 3:
    print("bon")

Fixed submission:
N = input()
a = int(N[-1])

if a == 2 or a ==4or a ==7 or a == 9 or a ==5:
    print("hon")
if a == 0 or a ==1 or a==6 or a==8:
    print("pon")
if a == 3:
    print("bon")

Buggy python submission (verdict: Runtime Error):

N = int(input())
if N[-1] == 2 or 4 or 5 or 7 or 9:
    print("hon")
if N[-1] == 0 or 1 or 6 or 8:
    print("pon")
if N[-1] == 3:
    print("bon")

Fixed submission:
N = input()
a = int(N[-1])

if a == 2 or a ==4or a ==7 or a == 9 or a ==5:
    print("hon")
if a == 0 or a ==1 or a==6 or a==8:
    print("pon")
if a == 3:
    print("bon")

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N[-1] == 2:
    print("hon")
if N[-1] == 4:
    print("hon")
if N[-1] == 5:
    print("hon")
if N[-1] == 7:
    print("hon")
if N[-1] == 9:
    print("hon")
if N[-1] == 0:
    print("pon")
if N[-1] == 1:
    print("pon")
if N[-1] == 6:
    print("pon")
if N[-1] == 8:
    print("pon")
if N[-1] == 3:
    print("bon")

Fixed submission:
N = input()
a = int(N[-1])

if a == 2 or a ==4or a ==7 or a == 9 or a ==5:
    print("hon")
if a == 0 or a ==1 or a==6 or a==8:
    print("pon")
if a == 3:
    print("bon")
Buggy python submission (verdict: Runtime Error):
K = input()
S = str(input())
if len(S)<=K:
    print(S)
if len(S)>K:
    K = int(K)
    S = str(S[0:K])+ "..."
    print(S)

Fixed submission:
K = input()
S = str(input())
if len(S)<=int(K):
    print(S)
if len(S)>int(K):
    K = int(K)
    S = str(S[0:K])+ "..."
    print(S)
Buggy python submission (verdict: Runtime Error):
R = int(input())
print(2*pi*R)

Fixed submission:
R = int(input())
print(2*3.141592*R)
Buggy python submission (verdict: Runtime Error):
N = input()
N = N//2
print(N)

Fixed submission:
N = int(input())
if N%2 ==0:
 print(N//2)
if N%2 ==1:
 N = N//2+1
 print(N)

Buggy python submission (verdict: Runtime Error):
import math
n = input()
print(math.ceil(n/2))

Fixed submission:
import math
n = int(input())
print(math.ceil(n/2))