Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# import itertools
# import math


def solve(N, H):
    for i in range(1, N):
        if H[i] < H[i+1]:
            H[i+1] -= 1
        elif H[i] > H[i+1]:
            return 'No'
    return 'Yes'


N = int(input())
# S = input()
# A, B = map(int, input().split())
H = list(map(int, input().split()))

# P = []
# S = []
# for i in range(N):
#     pp, ss  = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N, H))


Fixed submission:
# import itertools
# import math


def solve(N, H):
    for i in range(N - 1):
        if H[i] < H[i+1]:
            H[i+1] -= 1
        elif H[i] > H[i+1]:
            return 'No'
    return 'Yes'


N = int(input())
# S = input()
# A, B = map(int, input().split())
H = list(map(int, input().split()))

# P = []
# S = []
# for i in range(N):
#     pp, ss  = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N, H))
Buggy python submission (verdict: Runtime Error):
# import itertools
# import math

import sys
input = sys.stdin.readline


def solve(N, P):
    NN = sorted(N)
    cnt = 0
    for l1, l2 in zip(N, NN):
        if l1 != l2:
            cnt += 1

    return 'YES' if cnt <= 2 else 'NO'


N = int(input())
# S = input()
# A, B = map(int, input().split())
P = list(map(int, input().split()))

# P = []
# S = []
# for i in range(N):
#     pp, ss = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N, P))


Fixed submission:
# import itertools
# import math

import sys
input = sys.stdin.readline


def solve(N, P):
    PP = sorted(P)
    cnt = 0
    for l1, l2 in zip(P, PP):
        if l1 != l2:
            cnt += 1

    return 'YES' if cnt <= 2 else 'NO'


N = int(input())
# S = input()
# A, B = map(int, input().split())
P = list(map(int, input().split()))

# P = []
# S = []
# for i in range(N):
#     pp, ss = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N, P))
Buggy python submission (verdict: Runtime Error):
# import itertools
# import math

import sys
input = sys.stdin.readline


def solve(N, A):
    for i in range(N):
        tmp = A
        tmp.pop(i)
        print(max(tmp))


N = int(input())
# S = input()
# A, B = map(int, input().split())
# A = list(map(int, input().split()))


A = []
for i in range(N):
    aa = int(input())
    A.append(aa)


solve(N, A)


Fixed submission:
# import itertools
# import math

import sys
input = sys.stdin.readline


def solve(N, A):
    max_idx = A.index(max(A))
    s = sorted(A, reverse=True)

    for i in range(N):
        if i == max_idx:
            print(s[1])
        else:
            print(s[0])


N = int(input())
# S = input()
# A, B = map(int, input().split())
# A = list(map(int, input().split()))


A = []
for i in range(N):
    aa = int(input())
    A.append(aa)


solve(N, A)
Buggy python submission (verdict: Runtime Error):
def list_lcm(A):
    """N個の最小公倍数
    Args:
        A (list[int])

    Returns:
        int: 最小公倍数

    Examples:
        >>> list_lcm([12, 34, 54, 65])
        119340
    """
    ans = A[0]
    for i in range(1, len(A)):
        ans = ans * A[i] // gcd(ans, A[i])
    return ans


def resolve():
    A, B, C, D = map(int, input().split())
    A -= 1

    lcm_C_D = list_lcm([C, D])
    ans_B = B - B // C - B // D + B // lcm_C_D
    ans_A = A - A // C - A // D + A // lcm_C_D

    print(ans_B - ans_A)


resolve()


Fixed submission:
from fractions import gcd


def list_lcm(A):
    """N個の最小公倍数
    Args:
        A (list[int])

    Returns:
        int: 最小公倍数

    Examples:
        >>> list_lcm([12, 34, 54, 65])
        119340
    """
    ans = A[0]
    for i in range(1, len(A)):
        ans = ans * A[i] // gcd(ans, A[i])
    return ans


def resolve():
    A, B, C, D = map(int, input().split())
    A -= 1

    lcm_C_D = list_lcm([C, D])
    ans_B = B - B // C - B // D + B // lcm_C_D
    ans_A = A - A // C - A // D + A // lcm_C_D

    print(ans_B - ans_A)


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


def resolve():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))

    V = np.array(V)
    C = np.array(C)

    ans = 0
    for j in range(1, N + 1):
        combination = itertools.combinations(list(range(N)), j)

        for i in list(combination):
            i = list(i)
            tmp = np.sum(V[i]) - np.sum(C[i])
            ans = max(ans, tmp)

    print(ans)


resolve()

Fixed submission:
def resolve():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))

    ans = 0
    for value, cost in zip(V, C):
        if value - cost > 0:
            ans += value - cost
    print(ans)


resolve()
Buggy python submission (verdict: Runtime Error):
x=int(input)
for i in range(-1000,1000):
  for j in range(-1000,1000):
    if i**5 ==x+j**5:
      print(i,j)
      exit()

Fixed submission:
x=int(input())
for i in range(-133,133):
    for j in range(-133,133):
        if  i**5 == j**5 + x :
            print(i,j)
            exit()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

pre = list(map(int,input().split()))

ans = 1

for i in range (N):
    ans *= pre[i]



if ans > 1000000000000000000:
    print("-1")

else:
    print(ans)

Fixed submission:
N = int(input())

pre = list(map(int,input().split()))

flag = 0

for i in range (N):
    if pre[i] == 0:
        flag = 1

if flag == 0:

    ans = 1

    for i in range (N):
        ans *= pre[i]

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

    if ans <= 10**18:
        print(ans)

else:
    print("0")
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())

con = 0
ans = list(int() for _ in range(100))
pre = 0


for _ in range(K):

    D = int(input())
    arr = list(map(int,input().split()))

    for j in range(D):

        ans[pre+j]=arr[j]

    pre += D

        
fin = (N+1) - len(set(ans))

print(fin)

Fixed submission:
N,K=map(int,input().split())

con = 0
ans = list(int() for _ in range(100000))
pre = 0


for _ in range(K):

    D = int(input())
    arr = list(map(int,input().split()))

    for j in range(D):

        ans[pre+j]=arr[j]

    pre += D

        
fin = (N+1) - len(set(ans))

print(fin)
Buggy python submission (verdict: Runtime Error):
s　=　input()

print(s[:3])

Fixed submission:
s = input()

print(s[:3])

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

print(s[:2])

Fixed submission:
s = input()

print(s[:3])
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))

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

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

result = "Yes" if n == m else "No"
print(result)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = input().split()

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

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

result = "Yes" if n == m else "No"
print(result)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))

j = p[0]
count = 1
for i in range(n):
  '''
    if j == 1:
        break
        '''
    if p[i] <= j:
        count += 1
        j = p[i]
print(count)

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

j = p[0]
count = 0
for i in range(n):
    if j >= p[i]:
        count += 1
        j = p[i]
print(count)
Buggy python submission (verdict: Runtime Error):
N = input()
x = N[-3]+N[-2]+N[-1]
print (1000 - int(x))


Fixed submission:
N = input()
if int(N) < 1001:
    x = N
elif int(N[-3]+N[-2]+N[-1]) == 0:
    x = 1000
else:
    x = N[-3]+N[-2]+N[-1]
print (1000 - int(x))
Buggy python submission (verdict: Runtime Error):
L= int(input())
A = (L/3)*(L/3)*(L/3)
print (A)


Fixed submission:
from math import *


N,M = list(map(int,input().split(" ")))
A = (N*(N-1))/2+(M*(M-1))/2
print (int(A))

Buggy python submission (verdict: Runtime Error):
N = input()
M = input()
A = (factorial(N)*factorial(N-1))+(factorial(M)*factorial(M-1))/2
print A

Fixed submission:
from math import *


N,M = list(map(int,input().split(" ")))
A = (N*(N-1))/2+(M*(M-1))/2
print (int(A))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N=int(input())
A=list(map(int, input().split()))
Q=int(input())
B=[list(map(int, input().split())) for _ in range(Q)]

ans=[]

for i in B:
  b=i[0]
  c=i[1]
  A=np.array(A)
  A=np.where(A!=b,A,c)
  
  ans.append(np.sum(A))
  
for i in ans:
  print(i)
  


Fixed submission:
N=int(input())
A=list(map(int, input().split()))
Q=int(input())

num=[0]*10**5 
a=sum(A)

for i in A: #各数字が何個あるか
  num[i-1]+=1

for _ in range(Q):
  b,c=map(int, input().split())
  
  a=a+(-num[b-1]*b+c*num[b-1])
  num[c-1]+=num[b-1]
  num[b-1]-=num[b-1]
  print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
Q=int(input())
B=[list(map(int, input().split())) for _ in range(Q)]

ans=[]

for i in B:
  b=i[0]
  c=i[1]
  A=[i if i!=b else c for i in A ]
  
  ans.append(sum(A))
  
for i in ans:
  print(i)
  


Fixed submission:
N=int(input())
A=list(map(int, input().split()))
Q=int(input())

num=[0]*10**5 
a=sum(A)

for i in A: #各数字が何個あるか
  num[i-1]+=1

for _ in range(Q):
  b,c=map(int, input().split())
  
  a=a+(-num[b-1]*b+c*num[b-1])
  num[c-1]+=num[b-1]
  num[b-1]-=num[b-1]
  print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
Q=int(input())
B=[list(map(int, input().split())) for _ in range(Q)]

ans=[]

for i in B:
  b=i[0]
  c=i[1]
  A=[i if i!=b else c for i in A ]
  
  ans.append(sum(A))
  
for i in ans:
  print(i)
  


Fixed submission:
N=int(input())
A=list(map(int, input().split()))
Q=int(input())

num=[0]*10**5 
a=sum(A)

for i in A: #各数字が何個あるか
  num[i-1]+=1

for _ in range(Q):
  b,c=map(int, input().split())
  
  a=a+(-num[b-1]*b+c*num[b-1])
  num[c-1]+=num[b-1]
  num[b-1]-=num[b-1]
  print(a)
Buggy python submission (verdict: Runtime Error):
A,B=input().split()
B=Decimal(B)
A=int(A)
ans=int(A*B)
 
print(ans)

Fixed submission:
from decimal import Decimal

A,B=input().split()
B=Decimal(B)
A=int(A)
ans=int(A*B)
 
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M=list(map(int, input().split()))
H=list(map(int, input().split()))
A=[list(map(int, input().split())) for _ in range(M)]

dp=[True]*N
a=[0]*N

for i in A:
  if H[i[0]-1]<H[i[1]-1] and a[i[1]-1]==0:
    dp[i[1]-1]=True
    dp[i[0]-1]=False
    a[i[0]-1]+=1
  elif H[i[0]-1]<H[i[1]-1] and a[i[1]-1]!=0:
    a[i[0]-1]+=1
    continue
  elif H[i[0]-1]>H[i[1]-1] and a[i[0]-1]==0:
    dp[i[1]-1]=False
    dp[i[0]-1]=True
    a[i[1]-1]+=1
  elif H[i[0]-1]>H[i[1]-1] and a[i[0]-1]!=0:
    a[i[1]-1]+=1
    continue
  elif H[i[0]-1]==H[i[1]-1]:
    dp[i[1]-1]=False
    dp[i[0]-1]=False
  

print(dp.count(True))

Fixed submission:
S=input()

if S=="ABC":
  print("ARC")
  
else:
  print("ABC")
Buggy python submission (verdict: Runtime Error):
import sys
K=int(input())
 
A,B=list(map(int, input().split()))
 
for i in range(A,B+1):
  if i%K==0:
    
    print("Yes")
    sys.exit()

print("No")

Fixed submission:
X=int(input())
i=0
a=100
while a<X:
  n=int(a*1.01)
  a=n
  i+=1
print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

S=[input() for _ in range(N)]
b=[]
i=0
for k in S:
  if k not in b:
    i+=1
    b.append(k)
  else:
    continue
print(i)

Fixed submission:
N=int(input())
 
S=[input() for _ in range(N)]



print(len(set(S)))
Buggy python submission (verdict: Runtime Error):
ースコード 

Copy
Copy
N=int(input())
 
S=list(input())
m=0
 
a=S.count("R")
b=S.count("G")
c=S.count("B")
 
num=a*b*c
 
for i in range(N-2):
  for j in range(i+1,N-1):
    k=2*j-i #削る条件
    if k>N-1:
      break
    elif S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      m+=1
      
print(num-m)

Fixed submission:
N=int(input())

S=list(input())
m=0

a=S.count("R")
b=S.count("G")
c=S.count("B")

num=a*b*c

for i in range(N-2):
  for j in range(i+1,N):
    k=2*j-i #削る条件
    if k>N-1:
      break
    elif S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      m+=1
      
print(num-m)

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

S=list(input())
m=0

a=S.count("R")
b=S.count("G")
c=S.count("B")

num=a*b*c

for i in range(N-2):
  for j in range(i+1,N):
    k=2*j-i
    if k>=n-1:
      break
    elif S[i]!=S[j]!=S[k]:
      m+=1
      
print(num-m)

Fixed submission:
N=int(input())

S=list(input())
m=0

a=S.count("R")
b=S.count("G")
c=S.count("B")

num=a*b*c

for i in range(N-2):
  for j in range(i+1,N):
    k=2*j-i #削る条件
    if k>N-1:
      break
    elif S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      m+=1
      
print(num-m)
Buggy python submission (verdict: Time Limit Exceeded):
S=int(input())
a=0
for i in range(S//500+1):
  for j in range(S//5+1):
    if i*500+j*5<=S:
      a=max(a,i*1000+j*5)
    else:
      continue
      
print(a)


Fixed submission:
S=int(input())

a=S//500

b=(S-500*a)//5

c=a*1000+b*5

print(c)
Buggy python submission (verdict: Runtime Error):
h=input()

id=[i for i,k in enumerate(h) if k=="h"] 

a=0

for l in id:
  if "i"==h[l+1]:
    if "i"!=h[l+2]:
      a+=1
    elif "ii" == h[l+2]:
      a+=0
  elif "i" != h[l+1]:
    a+=0
        
if "h" not in h:
  a+=0
  
if a>0:
  print("Yes")
else:
  print("No")
    

Fixed submission:
S = input()
hitachi = [
    'hi',
    'hihi',
    'hihihi',
    'hihihihi',
    'hihihihihi',
]
if S in hitachi:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a=0
for i in range(10^100):
  N, A, B=list(map(int, input().split()))
  if A+B==N:
    a=a+A
  else:
    a=a+A+N-(A+B)
  
    
print(a)

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

if N%(A+B)==0:
    print(N//(A+B)*A)

else:
    rem=min(N%(A+B),A)
    print(N//(A+B)*A+rem)
Buggy python submission (verdict: Runtime Error):
N=input()

if N%2==0:
    print(N/2)

elif N%2==1:
    print(int(N/2)+1)

Fixed submission:
N=int(input())

if N%2==0:
    print(int(N/2))

elif N%2==1:
    print(int(int(N/2)+1))
Buggy python submission (verdict: Time Limit Exceeded):
N,K=list(map(int, input().split()))
h=list(map(int, input().split()))


dp=[0]+[float("inf")]*(N-1)


for i in range(N-1):
    for j in range(K):
        if j+i+1>N-1:
            break
        dp[j+i+1]=min(abs(h[j+i+1]-h[i])+dp[i],dp[j+i+1])
    

print(dp[-1])

Fixed submission:
N,K=list(map(int, input().split()))
h=list(map(int, input().split()))
 
 
dp=[0]+[float("inf")]*(N-1)
 
 
for i in range(N-1):
    for j in range(i,i+K):
        if j+1>N-1:
            break
        dp[j+1]=min(abs(h[j+1]-h[i])+dp[i],dp[j+1])
    
 
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K=list(map(int, input().split()))
h=list(map(int, input().split()))


dp=[0]+[float("inf")]*(N-1)


for i in range(N-1):
    for j in range(i,i+K):
        if j+1>N-1:
            break
        dp[j+1]=min(abs(h[j+1]-h[i])+dp[i],dp[j+1])
    

print(dp[-1])

Fixed submission:
N,K=list(map(int, input().split()))
h=list(map(int, input().split()))
 
 
dp=[0]+[float("inf")]*(N-1)
 
 
for i in range(N-1):
    for j in range(i,i+K):
        if j+1>N-1:
            break
        dp[j+1]=min(abs(h[j+1]-h[i])+dp[i],dp[j+1])
    
 
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K=list(map(int, input().split()))
h=list(map(int, input().split()))


dp=[0]+[float("inf")]*(N-1)


for i in range(N-1):
    for j in range(i,i+K):
        if not j+1>N-1:
            dp[j+1]=min(abs(h[j+1]-h[i])+dp[i],dp[j+1])
    

print(dp[-1])

Fixed submission:
N,K=list(map(int, input().split()))
h=list(map(int, input().split()))
 
 
dp=[0]+[float("inf")]*(N-1)
 
 
for i in range(N-1):
    for j in range(i,i+K):
        if j+1>N-1:
            break
        dp[j+1]=min(abs(h[j+1]-h[i])+dp[i],dp[j+1])
    
 
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
import sys

N,Y=list(map(int, input().split()))

for j in range(N+1):
    for k in range(N+1):
        if N-j-k<0:
            continue
        Total=10**4*(N-j-k)+5000*j+10**3*k
        if Total==Y:
        print("{} {} {}".format(N-j-k,j,k))
        sys.exit()
        
print("-1 -1 -1")

Fixed submission:
import sys

N,Y=list(map(int, input().split()))

for j in range(N+1):
    for k in range(N+1):
        if N-j-k<0:
            continue
        Total=10**4*(N-j-k)+5000*j+10**3*k
        if Total==Y:
            print("{} {} {}".format(N-j-k,j,k))
            sys.exit()
        
print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
print(a + (a ** 2) + (a ** 3))

Fixed submission:
a = int(input())
print(a + a ** 2 + a ** 3)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
replaces = 0
for ch in range(S):
    if S[ch] == T[ch]:
        replaces += 1

print(replaces)


Fixed submission:
S = input()
T = input()
replaces = 0
for ch in range(len(S)):
    if S[ch] != T[ch]:
        replaces += 1

print(replaces)

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
replaces = 0
for ch in range(S):
    if S[ch] == T[ch]:
    replaces += 1

print(replaces)


Fixed submission:
S = input()
T = input()
replaces = 0
for ch in range(len(S)):
    if S[ch] != T[ch]:
        replaces += 1

print(replaces)

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
replaces = 0
for ch in range(S):
  if S[ch] == T[ch]:
    replaces += 1

print(replaces)

Fixed submission:
S = input()
T = input()
replaces = 0
for ch in range(len(S)):
    if S[ch] != T[ch]:
        replaces += 1

print(replaces)
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
print(a*b)

Fixed submission:
a, b = map(int, input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
_, *a = map(int, open(0).read.split())
ret = 1
for x in sorted(a):
  ret *= x
  if ret > 10**18:
    ret = -1
    break
print(ret)

Fixed submission:
_, *a = map(int, open(0).read().split())
ret = 1
for x in sorted(a):
  ret *= x
  if ret > 10 ** 18:
    ret = -1; break
    
print(ret)

Buggy python submission (verdict: Runtime Error):
_, *a = map(int, open(0).read.split())
ret = 1
for x in a:
  ret *= x
  if ret > 10**18:
    ret = -1
    break
print(ret)


Fixed submission:
_, *a = map(int, open(0).read().split())
ret = 1
for x in sorted(a):
  ret *= x
  if ret > 10 ** 18:
    ret = -1; break
    
print(ret)

Buggy python submission (verdict: Runtime Error):
_, *a = map(int, input().split())
ret = 1
for x in a:
  ret *= x
  if ret > 10**18:
    print(-1)
    return

print(ret)


Fixed submission:
_, *a = map(int, open(0).read().split())
ret = 1
for x in sorted(a):
  ret *= x
  if ret > 10 ** 18:
    ret = -1; break
    
print(ret)

Buggy python submission (verdict: Time Limit Exceeded):
input()
a = map(int, input().split())
ret = 1
for x in a:
  ret *= x
if ret > 1e+18:
  print(-1)
else:
  print(ret)

Fixed submission:
_, *a = map(int, open(0).read().split())
ret = 1
for x in sorted(a):
  ret *= x
  if ret > 10 ** 18:
    ret = -1; break
    
print(ret)
Buggy python submission (verdict: Runtime Error):
def main():
    n, m, x, y = list(map(int, input().split()))
    x_list = list(map(int, input().split()))
    y_list = list(map(int, input().split()))
    x_list.append(x)
    y_list.append(y)

    zx = max(x_list) + 1
    zy = min(y_list)

    if zx > zy :
        print('War')
	else:
    	print('No war')


if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n, m, x, y = list(map(int, input().split()))
    x_list = list(map(int, input().split()))
    y_list = list(map(int, input().split()))
    x_list.append(x)
    y_list.append(y)

    zx = max(x_list) + 1
    zy = min(y_list)

    if zx > zy :
        print('War')
    else:
        print('No War')


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

N = int(input())
A = list(map(int, input().split()))
Asrt = sorted(A, reverse=True)


num = math.ceil(N/2)

a = Asrt([:num])

if N % 2 == 0:#guusuu
    print(sum(a) * 2 - a[0])
else:#kisuu
    print(sum(a) * 2 - a[0] - a[-1])


Fixed submission:
import math

N = int(input())
A = list(map(int, input().split()))
Asrt = sorted(A, reverse=True)


num = math.ceil(N/2)

a = Asrt[:num]

if N % 2 == 0:#guusuu
    print(sum(a) * 2 - a[0])
else:#kisuu
    print(sum(a) * 2 - a[0] - a[-1])
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int, inout().split()));
ans = 0;
if a <= (b*2):
  ans = 0;
else:
  ans = a - (b*2);
  
print(ans);
  

Fixed submission:
a, b = list(map(int, input().split()));
ans = 0;
if a > (b*2):
    ans = a - (b * 2);
print(ans);
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())

print(2*n//math.gcd(2,n)) #最小公倍数

Fixed submission:
import math

n = int(input())
asn = 0

if n % 2 == 0: ans = n
else: ans = 2*n

print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
print(2*n//math.gcd(2,n)) #最小公倍数

Fixed submission:
import math

n = int(input())
asn = 0

if n % 2 == 0: ans = n
else: ans = 2*n

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if (a - c) <= c:
    print("Yes"):
else:
    print("No")

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

if abs(a-c) <= d:
    ans = "Yes"
elif abs(a-b) <= d and abs(b-c) <= d:
    ans = "Yes"

print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
print(a+a**2+a**3)

Fixed submission:
a = int(input())
print(a+a**2+a**3)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
result = 1
target = 10**18
 
if a.count(0) >= 1:
  result = 0
else:
  for an in a:
    result = an*result
  
  if result > 10**18:
    result = -1
 
print(result)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
result = 1
target = 10**18
 
if a.count(0) >= 1:
  result = 0
else:
  for an in a:
    result = an*result
    if result > target:
      result = -1
      break
 
print(result)

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

for an in a:
  result = an*result
  
if result > 10**18:
  result = -1
  
print(result)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
result = 1
target = 10**18
 
if a.count(0) >= 1:
  result = 0
else:
  for an in a:
    result = an*result
    if result > target:
      result = -1
      break
 
print(result)
Buggy python submission (verdict: Runtime Error):
array = map(int, input().split())
print(f'{ "bust" if sum(array) >= 22 else "win"}')


Fixed submission:
array = map(int, input().split())
if sum(array) >= 22:
  print("bust")
else:
  print("win")

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(f'string value: { "bust" if a+b+c >= 22 else "win"}')

Fixed submission:
array = map(int, input().split())
if sum(array) >= 22:
  print("bust")
else:
  print("win")

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(f'string value: { "bust" if a+b+c >= 22 else "win"}')

Fixed submission:
array = map(int, input().split())
if sum(array) >= 22:
  print("bust")
else:
  print("win")

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input().split())
# 出力
print("{}".format(x = "bust" if n >= 22 else "win"))

Fixed submission:
array = map(int, input().split())
if sum(array) >= 22:
  print("bust")
else:
  print("win")
Buggy python submission (verdict: Runtime Error):
n = map(int, input())
print(n // 3)

Fixed submission:
n = int(input())
print(n // 3)
Buggy python submission (verdict: Runtime Error):
import itertools
n = int(input())
names = [input() for i in range(n)]
names = [i for i in names if i[0] in "MARCH"]


print(len(list(itertools.combinations(seq,3))))

Fixed submission:
import itertools
n = int(input())
counters = {"M":0,"A":0,"R":0,"C":0,"H":0}

for _ in range(n):
  s = input()[0]
  
  if s in "MARCH":
  	counters[s] += 1
res = 0
for i in list(itertools.combinations(["M","A","R","C","H"],3)):
  res += counters[i[0]] * counters[i[1]] * counters[i[2]]

print(res)