Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):

def get_expected_value(n):

    # expected_value = 0
    # for i in range(1,n+1):
    #     expected_value += i / n
    # return expected_value
    return (1 + n) / 2

def main():
    n, k = map(int,input().split())
    pn = list(map(int,input().split()))
    expected_value_sum_max = 0
    for i in range(n-k+1):
        tmp = 0
        for j in range(k):
            tmp += get_expected_value(pn[i+j])

        if tmp > expected_value_sum_max:
            expected_value_sum_max = tmp

    print(expected_value_sum_max)

if __name__ == '__main__':
  	main()

Fixed submission:
from itertools import accumulate

def main():
    N, K= map(int, input().split())
    p = list(map(int, input().split()))
    # 累積和
    p = [0] + list(accumulate(p))

    # 累積和が最大になる区間、期待値は(1+p)/2、k個分なので以下の式。
    print((max(b - a for a, b in zip(p, p[K:])) + K) / 2)

if __name__ == '__main__':
  	main()

'''
5 3
1 2 2 4 5

10 4
17 13 13 12 15 20 10 13 17 11
'''

Buggy python submission (verdict: Time Limit Exceeded):

def get_expected_value(n):

    expected_value = 0
    for i in range(1,n+1):
        expected_value += i / n
    return expected_value

def main():
    n, k = map(int,input().split())
    pn = list(map(int,input().split()))
    expected_value_sum_max = 0
    for i in range(n-k+1):
        tmp = 0
        for j in range(k):
            tmp += get_expected_value(pn[i+j])

        if tmp > expected_value_sum_max:
            expected_value_sum_max = tmp

    print(expected_value_sum_max)

if __name__ == '__main__':
  	main()

'''
5 3
1 2 2 4 5
'''

Fixed submission:
from itertools import accumulate

def main():
    N, K= map(int, input().split())
    p = list(map(int, input().split()))
    # 累積和
    p = [0] + list(accumulate(p))

    # 累積和が最大になる区間、期待値は(1+p)/2、k個分なので以下の式。
    print((max(b - a for a, b in zip(p, p[K:])) + K) / 2)

if __name__ == '__main__':
  	main()

'''
5 3
1 2 2 4 5

10 4
17 13 13 12 15 20 10 13 17 11
'''
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**6)

n= int(input())
s= input()

candidate = set()

def dfs(num,pw):
    global s
    global n
    global candidate
    if len(pw) == 3:
        candidate.add(pw)
        return
    elif num == n:
        return
    else:
        dfs(num+1,pw)
        pw+=s[num]
        dfs(num+1,pw)

dfs(0,"")

print(len(candidate))


Fixed submission:
import sys
sys.setrecursionlimit(10**6)

n= int(input())
s= input()

sum=0

for i in range(10):
    ix = s.find(str(i))
    if ix == -1:
        continue
    six = s[ix+1:]
    for j in range(10):
        iy = six.find(str(j))
        if iy == -1:
            continue
        siy = six[iy+1:]
        for k in range(10):
            iz = siy.find(str(k))
            if iz >= 0:
                sum+=1
print(sum)
Buggy python submission (verdict: Runtime Error):
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

a,b=map(int,input().split())
ab_gcd=math.gcd(a,b)
div_list=make_divisors(ab_gcd)
prime_list=[]

for i in div_list:
    flg=True
    for j in prime_list:
        if j == 1:
            continue
        if i % j == 0:
            flg = False
            break
    if flg:
        prime_list.append(i)

print(len(prime_list))

Fixed submission:
import fractions

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

a,b=map(int,input().split())
ab_gcd=fractions.gcd(a,b)
div_list=make_divisors(ab_gcd)
prime_list=[]

for i in div_list:
    flg=True
    for j in prime_list:
        if j == 1:
            continue
        if i % j == 0:
            flg = False
            break
    if flg:
        prime_list.append(i)

print(len(prime_list))

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

a,b=map(int,input().split())
ab_gcd=math.gcd(a,b)
div_list=make_divisors(ab_gcd)
prime_list=[]

for i in div_list:
    flg=True
    for j in prime_list:
        if j == 1:
            continue
        if i % j == 0:
            flg = False
            break
    if flg:
        prime_list.append(i)

print(len(prime_list))

Fixed submission:
import fractions

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

a,b=map(int,input().split())
ab_gcd=fractions.gcd(a,b)
div_list=make_divisors(ab_gcd)
prime_list=[]

for i in div_list:
    flg=True
    for j in prime_list:
        if j == 1:
            continue
        if i % j == 0:
            flg = False
            break
    if flg:
        prime_list.append(i)

print(len(prime_list))
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000000000)

a,b=map(int,input().split()[:2])

i=1
while True:
    if (a*i -i + 1) >=b:
        print(i)
        exit()
    i+=1

Fixed submission:
import sys
sys.setrecursionlimit(1000000000)

a,b=map(int,input().split()[:2])

i=0
while True:

    if (a*i -i + 1) >=b:
        print(i)
        exit()
    i+=1
Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
print(np.sum(np.array(np.arange(N))))

Fixed submission:
N=int(input())
print(N*(N-1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
print(sum(set(range(N))))

Fixed submission:
N=int(input())
print(N*(N-1)//2)

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

N=int(input())
print(sum(list(range(N))))

Fixed submission:
N=int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

def listdict(s1):
    ret={}
    for i in s1:
        tmp=ret.get(i,0)
        if tmp==0:
            ret[i]=1
        else:
            ret[i]+=1
    return ret

sN=[listdict(input()) for _ in range(N)]
ret=0

for i in range(N-1):
    for j in range(i+1,N):
        if sN[i]==sN[j]:
            ret+=1

print(ret)

Fixed submission:
N=int(input())

def listdict(s1):
    ret={}
    rets=""
    for i in s1:
        tmp=ret.get(i,0)
        if tmp==0:
            ret[i]=1
        else:
            ret[i]+=1
    ret_sorted = sorted(ret.items(), key=lambda x:x[0])
    
    for k in range(len(ret_sorted)):
        rets+=str(ret_sorted[k][0])
        rets+=str(ret_sorted[k][1])
    return rets

sN=[listdict(input()) for _ in range(N)]

d1={}
for i in sN:
    tmp=d1.get(i,0)
    if tmp==0:
        d1[i]=1
    else:
        d1[i]+=1
ret=0
for i in d1.values():
    if i ==1:
        continue
    for j in range(1,i):
        ret+=j
print(ret)
Buggy python submission (verdict: Time Limit Exceeded):
S=input()
modn=10**9+7
qnum=S.count('?')
lenS=len(S)

if S[0]=='?':
    dp=[1]*10+[0]*3
else:
    dp=[0]*13
    dp[int(S[0])]=1

for i in range(1,lenS):
    dppre = dp
    dp = [0] * 13
    if S[i] == '?':
        R = range(10)
    else:
        R = [int(S[i])]
    
    for j in range(13):
        for k in R:
            dp[(j * 10 + k) % 13 ] += dppre[j]
    for j in range(13):
        dp[j] %= modn

print(dp[5])

Fixed submission:
M=10**9+7
r=[[(j-k)*9%13 for j in range(10)]for k in range(13)]
d=[1]+[0]*12
for c in input():
    d = [sum(d[j]for j in k)%M for k in r] if c>'9' else [d[(int(c)-k)*9%13]for k in range(13)]
print(d[5])

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
modn=10**9+7
qnum=S.count('?')
lenS=len(S)

if S[0]=='?':
    dp=[1]*10+[0]*3
else:
    dp=[0]*13
    dp[int(S[0])]=1

for i in range(1,lenS):
    dppre = dp
    dp = [0] * 13
    if S[i] == '?':
        R = range(10)
    else:
        R = [int(S[i])]
    
    for j in range(13):
        for k in R:
            dp[(j * 10 + k) % 13 ] += dppre[j]
    for j in range(13):
        dp[j] %= modn

print(dp[5])

Fixed submission:
M=10**9+7
r=[[(j-k)*9%13 for j in range(10)]for k in range(13)]
d=[1]+[0]*12
for c in input():
    d = [sum(d[j]for j in k)%M for k in r] if c>'9' else [d[(int(c)-k)*9%13]for k in range(13)]
print(d[5])

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
modn=10**9+7
qnum=S.count('?')
lenS=len(S)

dpa=[0]*13
dpb=[1]+[0]*12


for i in range(lenS):
    dpa=[0]*13
    if S[i]!='?':
        num=int(S[i]) 
        for j in range(13):
            dpa[((j*10)+num)%13]=dpb[j]
            dpa[((j*10)+num)%13]%=modn
    else:
        for k in range(10):
            for j in range(13):
                dpa[((j*10)+k)%13]+=dpb[j]
                dpa[((j*10)+k)%13]%=modn
    dpb=dpa
print(dpa[5])

Fixed submission:
M=10**9+7
r=[[(j-k)*9%13 for j in range(10)]for k in range(13)]
d=[1]+[0]*12
for c in input():
    d = [sum(d[j]for j in k)%M for k in r] if c>'9' else [d[(int(c)-k)*9%13]for k in range(13)]
print(d[5])

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
modn=10**9+7
qnum=S.count('?')
lenS=len(S)

dp=[[0]*13 for _ in range(lenS+1)]
dp[0][0]=1

for i in range(lenS):
    for j in range(13):
        if S[i]=='?': 
            for k in range(10):
                dp[i+1][(j*10+k)%13]+=dp[i][j]
                dp[i+1][(j*10+k)%13]%=modn
        else:
            dp[i+1][(j*10+int(S[i]))%13]+=dp[i][j]
            dp[i+1][(j*10+int(S[i]))%13]%=modn

print(dp[lenS][5])


Fixed submission:
M=10**9+7
r=[[(j-k)*9%13 for j in range(10)]for k in range(13)]
d=[1]+[0]*12
for c in input():
    d = [sum(d[j]for j in k)%M for k in r] if c>'9' else [d[(int(c)-k)*9%13]for k in range(13)]
print(d[5])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
AN=[int(input()) for _ in range(N)]

for i in range(N):
    tmp=AN.copy()
    tmp.pop(i)
    print(max(tmp))

Fixed submission:
N=int(input())
AN=[int(input()) for _ in range(N)]
ret=max(AN)
ANc=sorted(AN,reverse=True)
ret2=ANc[1]

for i in range(N):
    if ret != AN[i]:
        print(ret)
    else:
        print(ret2)
Buggy python submission (verdict: Runtime Error):
import itertools
N=int(input())
an=[int(x) for x in map(int,input().split()[:N])]

ret=an[0]
for x in range(1,N):
    ret= ret[x] ^ ret

if ret==0:
    print("Yes")
else:
    print("No")


Fixed submission:
import itertools
N=int(input())
an=[int(x) for x in map(int,input().split()[:N])]

ret=an[0]
for x in range(1,N):
    ret= an[x] ^ ret

if ret==0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N=int(input())
an=[int(x) for x in map(int,input().split()[:N])]

def judgeXOR(v):
    for x in range(N):
        if x==0:
            if (v[N-1] ^ v[x+1] ) != (x+1):
                return False
        elif x==(N-1):
            if (v[0] ^ v[x-1]) !=(x+1):
                return False
        else:
            if (v[x-1] ^ v[x+1])!=(x+1):
                return False
    return True

for v in itertools.permutations(an,N):
    if v[0] !=an[0]:
        break
    if judgeXOR(v):
        print("Yes")
        exit()

print("No")


Fixed submission:
import itertools
N=int(input())
an=[int(x) for x in map(int,input().split()[:N])]

ret=an[0]
for x in range(1,N):
    ret= an[x] ^ ret

if ret==0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N=int(input())
an=[int(x) for x in map(int,input().split()[:N])]

def judgeXOR(v):
    for x in range(N):
        if x==0:
            if (v[N-1] ^ v[x+1] ) != (x+1):
                return False
        elif x==(N-1):
            if (v[0] ^ v[x-1]) !=(x+1):
                return False
        else:
            if (v[x-1] ^ v[x+1])!=(x+1):
                return False
    return True

for v in itertools.permutations(an,N):
    if v[0] !=an[0]:
        continue
    if judgeXOR(v):
        print("Yes")
        exit()

print("No")


Fixed submission:
import itertools
N=int(input())
an=[int(x) for x in map(int,input().split()[:N])]

ret=an[0]
for x in range(1,N):
    ret= an[x] ^ ret

if ret==0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from sys import stdin

N,D=[int(x) for x in stdin.readline().rstrip().split()]
data = [stdin.readline().rstrip().split() for _ in range(N)]

ret=0
for i in range(N-1):
    for j in range(i+1,N,1):
        a=[ int(x) for x in data[i]]
        b=[ int(x) for x in data[j]]
        u = np.array(b) - np.array(a)
        if np.linalg.norm(u).is_integer:
            ret+=1
            # print(a,end=" ")
            # print(b)

print(ret,flush=True)

Fixed submission:
import numpy as np
from sys import stdin

N,D=[int(x) for x in stdin.readline().rstrip().split()]
data = [stdin.readline().rstrip().split() for _ in range(N)]

ret=0
for i in range(N-1):
    a=[ int(x) for x in data[i]]
    for j in range(i+1,N,1):
        b=[ int(x) for x in data[j]]
        u = np.array(b) - np.array(a)
        c = np.linalg.norm(u)
        de,inte=np.modf(c)
        if de == 0:
            ret+=1
            # print(a,end=" ")
            # print(b)

print(ret,flush=True)
Buggy python submission (verdict: Runtime Error):
import math
N,K=map(int,input().split()[:2])
modp=10**9+7

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(K):
    ret=0
    if i==0:
        print(N-K+1)
        continue
    tmp=combinations_count(K-1,i) % modp
    tmp2=combinations_count(N-K+1,i+1) % modp
    ret=(tmp*tmp2)%modp
    print(ret)

Fixed submission:
import math
N,K=map(int,input().split()[:2])
modp=10**9+7

def combinations_count(n, r):
    if r > n:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(K):
    ret=0
    if i==0:
        print(N-K+1)
        continue
    tmp=combinations_count(K-1,i) % modp
    tmp2=combinations_count(N-K+1,i+1) % modp
    ret=(tmp*tmp2)%modp
    print(ret)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

def luca(n):
	if n==0:
		return 2
	if n==1:
		return 1
	return luca(n-1)+luca(n-2)

print(luca(N))

Fixed submission:
N=int(input())

ret=[]
def luca(n):
	global ret

	if n==0:
		return 2
	if n==1:
		return 1
	return ret[n-1]+ret[n-2]

for i in range(N+1):
	ret.append(luca(i))

print(ret[-1])
Buggy python submission (verdict: Runtime Error):
a , b = map(int , input() .split())
ma = max(a , b)
mi = min(a , b)
if ma == 3 :
    print(ma - mi)
else :
    print(ma + mi)

Fixed submission:
a = int(input())
b = int(input())
ma = max(a , b)
mi = min(a , b)
if ma == 3 :
    print(ma - mi)
else :
    print(ma + mi)
Buggy python submission (verdict: Runtime Error):
num1 = int(input())
num2 = int(input())

if num1 >= 10 or num2 >= 10 :
    print(-1)
else:
    print(num1 * num2 )


Fixed submission:
x , y = map(int , input(). split())
if x < 10 and y < 10 :
    print(x * y)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
x = input()
st = [ 'Sunny' , 'Cloudy' , 'Rainy' ]
print(st[st.index(x) + 1 % 3])

Fixed submission:
st = [ "Sunny" , "Cloudy" , "Rainy" ]
x = input()
s = st.index(x) + 1
if s <= 2 :
    print(st[s])
else :
    print(st[0])

Buggy python submission (verdict: Runtime Error):
st = [ "Sunny" , "Cloudy" , "Rainy" ]
x = input()
print(st[st.index(x) + 1 % 3])

Fixed submission:
st = [ "Sunny" , "Cloudy" , "Rainy" ]
x = input()
s = st.index(x) + 1
if s <= 2 :
    print(st[s])
else :
    print(st[0])
Buggy python submission (verdict: Runtime Error):
# | Its_Rashid | #
n = int(input())
if n == 1 :
    print('Hello World')
else :
    print(sum([int(input()) for i in range()]))

Fixed submission:
# | Its_Rashid | #
n = int(input())
if n == 1 :
    print('Hello World')
else :
    a = int(input())
    b = int(input())
    print(a + b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
lis = list(s)
lis1 = [0]*n


for i in range(n):
    lis1[i] += lis[0:i+1].count("W")
    if lis[i] == "W":
        lis1[i] -= 1

for i in range(n):
    lis1[i] += lis[i:n].count("E")
    if lis[i] == "E":
        lis1[i] -= 1

print(min(lis1))

Fixed submission:
n = int(input())
s = input()
lis = list(s)

left_w_count = 0
right_e_count = lis[1:].count("E")
ans = right_e_count
for i in range(1,n):
    if lis[i-1] == "W":
        left_w_count += 1
    if lis[i] == "E":
        right_e_count -= 1
    ans = min(ans, left_w_count + right_e_count)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
lis = list(s)

#index 0
ans = lis[1:n].count("E")

#index 1~n-2
for i in range(n):
    tmp = 0
    tmp = lis[0:i+1].count("W") + lis[i+1:n].count("E")
    ans = min(ans,tmp)

#index n-1
ans = min(ans,lis[0:n].count("W"))

print(ans)


Fixed submission:
n = int(input())
s = input()
lis = list(s)

left_w_count = 0
right_e_count = lis[1:].count("E")
ans = right_e_count
for i in range(1,n):
    if lis[i-1] == "W":
        left_w_count += 1
    if lis[i] == "E":
        right_e_count -= 1
    ans = min(ans, left_w_count + right_e_count)

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())

N = N % 500

if N > A:
  print(No)
else:
  print(Yes)

Fixed submission:
N = int(input())
A = int(input())

N = N % 500

if N > A:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n, k = map(int, input().split())
a = list(map(int, input().split()))
a_val = collections.Counter(a)
count = 0

if len(a_val) > k:
    for i in range(len(a_val) - k):
        count += a_val.most_common()[-1-i][1]

print(count)

Fixed submission:
from collections import Counter
n, k = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(Counter(a).values(), reverse=True)

print(sum(a[k:]))
Buggy python submission (verdict: Runtime Error):
n = int(input())

myset = {}
for i in range(n):
    a = int(input())
    if a in myset:
        myset.remove(a)
    else:
        myset.add(a)
ans = len(myset)

print(ans)

Fixed submission:
n = int(input())

myset = set()
for i in range(n):
    a = int(input())
    if a in myset:
        myset.remove(a)
    else:
        myset.add(a)
ans = len(myset)

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]

myset = {}
for i in a:
    if i in myset:
        myset.remove(i)
    else:
        myset.add(i)
ans = len(myset)

print(ans)

Fixed submission:
n = int(input())

myset = set()
for i in range(n):
    a = int(input())
    if a in myset:
        myset.remove(a)
    else:
        myset.add(a)
ans = len(myset)

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]

ans = 0
max_a = max(a)
b = [0]*(max_a + 2)

for i in a:
    b[i] += 1

for i in b:
    if i % 2 != 0:
        ans += 1

print(ans)

Fixed submission:
n = int(input())

myset = set()
for i in range(n):
    a = int(input())
    if a in myset:
        myset.remove(a)
    else:
        myset.add(a)
ans = len(myset)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]

ans = 0

for i in a:
    if a.count(i) % 2 != 0:
        ans += 1

print(ans)

Fixed submission:
n = int(input())

myset = set()
for i in range(n):
    a = int(input())
    if a in myset:
        myset.remove(a)
    else:
        myset.add(a)
ans = len(myset)

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

a.sort()
cur = a[0]
ans1 = 1
ans = 1

for i in range(max(a)+1):
    if a[i + 1] - a[i] <= 2:
        cur = a[i]
        ans1 = a.count(cur) + a.count(cur + 1) + a.count(cur + 2)

        if ans < ans1:
            ans = ans1
        ans1 = 0

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
max_a = max(a)

b = [0]*(max_a + 2)

for i in a:
    b[i] += 1

ans = 0
for i in range(max_a + 1):
    tmp = b[i-1] + b[i] + b[i+1]
    ans = max(ans, tmp)

print(ans)

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

a.sort()
cur = a[0]
ans1 = 1
ans = 1

for i in range(n - 1):
    if a[i + 1] - a[i] <= 2:
        cur = a[i]
        ans1 = a.count(cur) + a.count(cur + 1) + a.count(cur + 2)

        if ans < ans1:
            ans = ans1
        ans1 = 0

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
max_a = max(a)

b = [0]*(max_a + 2)

for i in a:
    b[i] += 1

ans = 0
for i in range(max_a + 1):
    tmp = b[i-1] + b[i] + b[i+1]
    ans = max(ans, tmp)

print(ans)
Buggy python submission (verdict: Runtime Error):
r,g,b=map(int,input().split())

x = 10*g + b

if x % 4 == 0:
  print("YES") 
  else 
  print("NO")

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

x = 10*g + b

if x % 4 == 0:
  print("YES") 
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
r,g,b=map(int,input().split())

x = 10*g + b

if x%4 == 0 :
  print("YES") 
  else 
  print("NO")

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

x = 10*g + b

if x % 4 == 0:
  print("YES") 
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
r,g,b=map(int,input().split())

x = 10*g + b

if x%4 == 0 :
  print("YES")
  
else
  print("NO")

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

x = 10*g + b

if x % 4 == 0:
  print("YES") 
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
k, s = list(map(int, input().split()))
k = k+1

count = 0

for x in range(k):
    for y in range(k):
        for z in range(k):
            if s == x + y + z:
                count += 1

print(count)

Fixed submission:
k, s = list(map(int, input().split()))
k = k+1

count = 0
for x in range(k):
    for y in range(k):
        z = s - x - y
        if z >=0 and z < k:
            count += 1

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

n=int(input())
if n%1000==0:
    print(0)
else:
    x=math.ceil(n/1000)
    ans=int(x*1000)-n
    print(ans)



Fixed submission:
import math
n=int(input())
if n%1000==0:
    print(0)
else:
    x=math.ceil(n/1000)
    ans=int(x*1000)-n
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in a:
  ans*=i

if ans>10**18:print(-1)
else:print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=1
if 0 in a:
  flag=True
else:
  flag=False
for i in a:
  if flag:ans=0;break
  ans*=i
  if ans>10**18:
    ans=-1
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(int(a*b))

Fixed submission:
from decimal import *
getcontext().prec=18
a,b=map(Decimal,input().split())
print(int(Decimal(a)*Decimal(b)))
Buggy python submission (verdict: Runtime Error):
 = 998244353
n, m, k = map(int, input().split())
 
fact = [0]*(n+1)
fact[0] = 1
for i in range(1, n+1):
    fact[i] = fact[i-1]*i % MOD
 
invfact= [0]*(n+1)
for i in range(n+1):
    invfact[i] = pow(fact[i], MOD-2, MOD)
 
 
def nCk(n, k):
    return fact[n]*invfact[k]*invfact[n-k]
 
 
ans = 0
for i in range(k+1):
    ans += m*pow(m-1, n-1-i, MOD)*nCk(n-1, i)
    ans %= MOD
print(ans)

Fixed submission:
MOD = 998244353
n, m, k = map(int, input().split())
 
fact = [0]*(n+1)
fact[0] = 1
for i in range(1, n+1):
    fact[i] = fact[i-1]*i % MOD
 
invfact = [0]*(n+1)
for i in range(n+1):
    invfact[i] = pow(fact[i], MOD-2, MOD)
 
 
def nCk(n, k):
    return fact[n]*invfact[k]*invfact[n-k]
 
 
ans = 0
for i in range(k+1):
    ans += m*pow(m-1, n-1-i, MOD)*nCk(n-1, i)
    ans %= MOD
print(ans)