Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A,B,C,X,Y=map(int,input().split())

P=X*A+B*Y
if X>Y:
    Q=C*2*Y+(X-Y)*A
    L=X*2*C
elif Y<X:
    Q=C*2*Y+(Y-X)*B
    L=Y*2*C
elif X==Y:
    Q=min(C*2*Y, C*2*X)
    L=min(X*2*C, Y*2*C)



print(min(P,Q,L))

Fixed submission:
A,B,C,X,Y=map(int,input().split())

K=10**9
for i in range(10**5+1):
    S=i*2*C+max(0,X-i)*A+max(0,Y-i)*B
    K=min(K,S)
print(K)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
N=int(input())
X=list(map(int,input().split()))
l=copy.copy(X)
for i in range(N):
    X.remove(l[i])
    X.sort(reverse=True)
    print(X[int((N-2)/2)])
    X.insert(i,l[i])

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
y=sorted(X,reverse=True)
for i in X:
    if i<y[(N-2)//2]:
        print(y[(N-2)//2])
    else:
        print(y[N//2])
Buggy python submission (verdict: Runtime Error):
a=int(X,16)
b=int(Y,16)

if a>b:
    print('>')
elif a<b:
    print('<')
elif a == b:
    print('=')

Fixed submission:
X,Y =input().split()
a=int(X,16)
b=int(Y,16)

if a>b:
    print('>')
elif a<b:
    print('<')
elif a == b:
    print('=')
Buggy python submission (verdict: Runtime Error):
X,Y,Z =input().split()

U=(X-Y)/(Y+Z)

print(math.floor(U))

Fixed submission:
X,Y,Z=map(int,input().split())
for i in range(50001):
    if Y*i+(i+1)*Z>X:
        print(i-1)
        break
Buggy python submission (verdict: Runtime Error):
N=int(input())
p=list(map(int,input().split()))

M=0
for i in range(N):
    if p[i]==i+1:
        p[i],p[i+1]=p[i+1],p[i]
        M+=1
    
print(M)        

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

M=0
for i in range(N-1):
    if p[i]==i+1:
        p[i],p[i+1]=p[i+1],p[i]
        M+=1
if p[N-1]==N:
    M+=1
print(M)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

k=1
for i in range(1,N+1):
    k=k*i
print(k%(10**9+7))

Fixed submission:
import math

N=int(input())

k=math.factorial(N)
print(k%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())
N=0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i+j+k==S:
                N+=1
print(N)  

Fixed submission:
K,S=map(int,input().split())
N=0
for i in range(K+1):
    for j in range(K+1):
        if i+j<=S and i+j+K>=S:
            N+=1
print(N)

Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())
N=0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i+j+k==S:
                N+=1
print(N)     

Fixed submission:
K,S=map(int,input().split())
N=0
for i in range(K+1):
    for j in range(K+1):
        if i+j<=S and i+j+K>=S:
            N+=1
print(N)
Buggy python submission (verdict: Runtime Error):
s=input()

A=s.index('C')
for i in range(A,len(s)):
    if s[i]=='F':
        print('Yes')
        break
else:
    print('No')

Fixed submission:
s=input()

if 'C' in s:
    A=s.index('C')
    for i in range(A,len(s)):
        if s[i]=='F':
            print('Yes')
            break
    else:
        print('No')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
if a<=0 and b>=0:
    print('Zero')
elif a>0 and b>0:
    print('Positive')
elif a<0 and b<0:
    N=1
    for i in range(a,b+1,1):
        N=N*i
    if N>0:
        print("Positive")
    else:
        print("Negative")


Fixed submission:
a,b=map(int,input().split())
if a<=0 and b>=0:
    print('Zero')
elif a>0 and b>0:
    print('Positive')
elif a<0 and b<0:
    if ((-a)-(-b)+1)%2==0:
        print("Positive")
    else:
        print("Negative")

Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
if a<=0 and b>=0:
    print('Zero')
elif a>0 and b>0:
    print('Positive')
elif a<0 and b<0:
    N=1
    for i in range(a,b+1,1):
        N=N*i
    if N>0:
        print("Positive")
    else:
        print("Negative")


Fixed submission:
a,b=map(int,input().split())
if a<=0 and b>=0:
    print('Zero')
elif a>0 and b>0:
    print('Positive')
elif a<0 and b<0:
    if ((-a)-(-b)+1)%2==0:
        print("Positive")
    else:
        print("Negative")
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
K = int (input())
line= list(map(int,input().split()))
a,b = line[0],line[1]
if B<K:
  print("NG")
if (b-a+1)>=K:
    print("OK")

else:
    for i in range(a,b+1):
        if i%K==0:
            print("OK")
            break
    print("NG")

Fixed submission:
# coding: utf-8
# Your code here!
K = int (input())
line= list(map(int,input().split()))
a,b = line[0],line[1]
if b<K:
    print("NG")
    

else:
    for i in range(a,b+1):
        if i%K==0:
            print("OK")
            break
        elif i==b:
            print("NG")
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import math
line = list(map(int,input().split()))
A,B,N =line[0],line[1],line[2]

ans = (N+1)//B
if ans ==0:
    print(math.floor(A*N/B)-A*(i-1))
else:
    start = (math.floor(A*N/B)-A*math.floor(N/B))
    for i in range(1,ans+1):
        x= i*B-1
        start = max((math.floor(A*x/B)-A*(i-1)),start)
    print(start)

Fixed submission:
# coding: utf-8
# Your code here!
def main():
    import sys
    line = sys.stdin.readline
    A,B,N = map(int,input().split())
    if B>N:
        ans = A*N//B
    else:
        ans = A*(B-1)//B
    print(ans)

if __name__== "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import math
line = list(map(int,input().split()))
A,B,N =line[0],line[1],line[2]

ans = (N+1)//B
if ans ==0:
    print(math.floor(A*N/B)-A*math.floor(N/B))
else:
    start = (math.floor(A*N/B)-A*math.floor(N/B))
    for i in range(1,ans+1):
        x= i*B-1
        start = max((math.floor(A*x/B)-A*(i-1)),start)
    print(start)

Fixed submission:
# coding: utf-8
# Your code here!
def main():
    import sys
    line = sys.stdin.readline
    A,B,N = map(int,input().split())
    if B>N:
        ans = A*N//B
    else:
        ans = A*(B-1)//B
    print(ans)

if __name__== "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import math
line = list(map(int,input().split()))

A,B,N =line[0],line[1],line[2]

ans = (N+1)//B
if ans ==0:
    print(math.floor(A*N/B)-A*math.floor(N/B))
else:
    start = (math.floor(A*N/B)-A*math.floor(N/B))
    #kouho =[0 for j in range(ans)]
    for i in range(1,ans+1):
        x= i*B-1
        start = max((math.floor(A*x/B)-A*math.floor(x/B)),start)
    print(start)

Fixed submission:
# coding: utf-8
# Your code here!
def main():
    import sys
    line = sys.stdin.readline
    A,B,N = map(int,input().split())
    if B>N:
        ans = A*N//B
    else:
        ans = A*(B-1)//B
    print(ans)

if __name__== "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import math
line = list(map(int,input().split()))

A,B,N =line[0],line[1],line[2]

ans = (N+1)//B
if ans ==0:
    print(math.floor(A*N/B)-A*math.floor(N/B))
else:
    kouho =[0 for j in range(ans)]
    for i in range(1,ans+1):
        x= i*B-1
        kouho[i-1]=(math.floor(A*x/B)-A*math.floor(x/B))
    
    kouho.append(math.floor(A*N/B)-A*math.floor(N/B))
    print(max(kouho))

Fixed submission:
# coding: utf-8
# Your code here!
def main():
    import sys
    line = sys.stdin.readline
    A,B,N = map(int,input().split())
    if B>N:
        ans = A*N//B
    else:
        ans = A*(B-1)//B
    print(ans)

if __name__== "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
line= list(map(int,input().split()))
N = line[0]
K = line[1]
#0~Nの連続した整数から
#K個以上(N+1)個以下だけ選ぶ
answer = 0
for i in range (K,N+2):
    minit = i*(i-1)/2
    maximum = (2*N-i+1)*i/2
    
    num = maximum-minit+1
    answer += num
 
if answer >=(10**9+7):
    print(int(answer%(10**9+7)))
    
else:
    print(int(answer))

Fixed submission:
# coding: utf-8
# Your code here!
r = int(input())
pai = 3.14159265359
rounds = 2*r*pai
print(rounds)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
line= list(map(int,input().split()))
N = line[0]
K = line[1]
#0~Nの連続した整数から
#K個以上(N+1)個以下だけ選ぶ
answer = 0
for i in range (K,N+2):
    minit = i*(i-1)/2
    maximum = (2*N-i+1)*i/2
    
    num = maximum-minit+1
    answer += num
 
if answer >=(10**9+7):
    print(int(answer%(10**9+7)))
    
else:
    print(int(answer))

Fixed submission:
# coding: utf-8
# Your code here!
import collections
num = int(input())
line = list(map(int,input().split()))
clist = collections.Counter(line)
for i in range (1,num+1):
    print(clist[i])

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
num = int(input())
line = list(map(int,input().split()))
for i in range(1,num+1):
    number = line.count(i)
    print(number)

Fixed submission:
# coding: utf-8
# Your code here!
import collections
num = int(input())
line = list(map(int,input().split()))
clist = collections.Counter(line)
for i in range (1,num+1):
    print(clist[i])

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
num = int(input())
line = list(map(int,input().split()))
for i in range(1,num+1):
    print(line.count(i))

Fixed submission:
# coding: utf-8
# Your code here!
import collections
num = int(input())
line = list(map(int,input().split()))
clist = collections.Counter(line)
for i in range (1,num+1):
    print(clist[i])
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import numpy as np
N = int(input())
A = np.array(list(map(int,input().split())))
table = []
 
for i, a in enumerate(A):
    table.append([a,i])
table.sort()
dp = np.zeros((N+1,N+1))
for i in range(1,N+1):
    baby,pos = table.pop()
    dp[i][0]=dp[i-1][0]+baby*abs(pos-i+1)
    dp[0][i] = dp[0][i-1] + baby * abs(pos-(N-i))
    for x in range(1,i):
        y = i-x
        dp[x][y]= max(dp[x-1][y] + baby * abs(pos-x+1),dp[x][y-1] + baby * abs(pos-(N-y)))
print(int(max(dp[k][N-k] for k in range(N+1))))

Fixed submission:
# coding: utf-8
# Your code here!
#import numpy as np
N = int(input())
A = list(map(int,input().split()))
table = []
 
for i, a in enumerate(A):
    table.append([a,i])
table.sort()
dp = [[0for i in range(N+1)]for j in range(N+1)]
for i in range(1,N+1):
    baby,pos = table.pop()
    dp[i][0]=dp[i-1][0]+baby*abs(pos-i+1)
    dp[0][i] = dp[0][i-1] + baby * abs(pos-(N-i))
    for x in range(1,i):
        y = i-x
        dp[x][y]= max(dp[x-1][y] + baby * abs(pos-x+1),dp[x][y-1] + baby * abs(pos-(N-y)))
print(int(max(dp[k][N-k] for k in range(N+1))))

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import numpy as np
N = int(input())
A = np.array(list(map(int,input().split())))
table = []
 
for i, a in enumerate(A):
    table.append([a,i])
table.sort()
dp = [[0 for i in range(N+1)]for j in range(N+1)]
for i in range(1,N+1):
    baby,pos = table.pop()
    dp[i][0]=dp[i-1][0]+baby*abs(pos-i+1)
    dp[0][i] = dp[0][i-1] + baby * abs(pos-(N-i))
    for x in range(1,i):
        y = i-x
        dp[x][y]=  max(dp[x-1][y] + baby * abs(pos-x+1),dp[x][y-1] + baby * abs(pos-(N-y)))
print(max(dp[k][N-k] for k in range(N+1)))
    

Fixed submission:
# coding: utf-8
# Your code here!
#import numpy as np
N = int(input())
A = list(map(int,input().split()))
table = []
 
for i, a in enumerate(A):
    table.append([a,i])
table.sort()
dp = [[0for i in range(N+1)]for j in range(N+1)]
for i in range(1,N+1):
    baby,pos = table.pop()
    dp[i][0]=dp[i-1][0]+baby*abs(pos-i+1)
    dp[0][i] = dp[0][i-1] + baby * abs(pos-(N-i))
    for x in range(1,i):
        y = i-x
        dp[x][y]= max(dp[x-1][y] + baby * abs(pos-x+1),dp[x][y-1] + baby * abs(pos-(N-y)))
print(int(max(dp[k][N-k] for k in range(N+1))))
Buggy python submission (verdict: Runtime Error):
#商品数を取り込む
line_num = input()
line = line_num.split(" ")
  
    #全得票数を計算する
line2 = input().split(" ")
sum_vote = 0
for i in line2:
   # print(i)
    sum_vote += int(i)
  
#規定得票数を算出する。
numa = sum_vote/int(line[1])
num= numa/4

list =[]
for i in line2:
    if int(i) =>num:
        list.append(i)
    else:
        pass

if len(list)>int(line[1]):
    print("Yes")
else:
    print("No")

Fixed submission:
#商品数を取り込む
line_num = input()
line = line_num.split(" ")
  
    #全得票数を計算する
line2 = input().split(" ")
sum_vote = 0
for i in line2:
   # print(i)
    sum_vote += int(i)
  
#規定得票数を算出する。
numa = sum_vote/int(line[1])
num= numa/4

list =[]
for i in line2:
    if int(i) >=num:
        list.append(i)
    else:
        pass

if len(list)>=int(line[1]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
R, G, B, N = map(int, input().split())
answer = 0
for x in range(N // R + 1):
	for y in range(N // G + 1):
		if (N - R * x - G * y) % B == 0 & 0 <= (N - R * x - G * y) // B <= N // B:
			answer += 1
print(answer)

Fixed submission:
# coding: utf-8
# Your code here!
R, G, B, N = list(map(int, input().split()))

answer = 0
for r in range(N//R + 1):
    for g in range((N - r*R)//G + 1):
        if (N-r*R-g*G) % B == 0:
            answer += 1

print(answer)
Buggy python submission (verdict: Runtime Error):
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
if sum(a)+sum(b)<=k:
    print(n+m)
    exit()
num = 0
cnt = -1
for i in range(n+m):
    if num>k:
        break
    elif a == []:
        num += b[0]
        cnt +=1
        del b[0]
    elif b == []:
        num += a[0]
        cnt += 1
        del a[0]
    elif a[0] <= b[0]:
        num += a[0]
        cnt += 1
        del a[0]
    else:
        num += b[0]
        cnt += 1
        del b[0]
print(cnt)

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()))
ans = 1
for i in A:
  ans *= i
if ans > 10**18:
  ans = -1
print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = 1
if 0 in A:
  print(0)
  exit()
for i in A:
  ans *= i
  if ans > 10**18:
    ans = -1
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
\s = input()
t = input()
ans = "Yes"
for i in range(len(s)):
  if s[i] != t[i]:
    ans = "No"
print(ans)

Fixed submission:
s = input()
t = input()
ans = "Yes"
for i in range(len(s)):
  if s[i] != t[i]:
    ans = "No"
print(ans)

Buggy python submission (verdict: Runtime Error):
s,t = input().split()
ans = "Yes"
for i in range(s):
  if s[i] != t[i]:
    ans = "No"
print(ans)

Fixed submission:
s = input()
t = input()
ans = "Yes"
for i in range(len(s)):
  if s[i] != t[i]:
    ans = "No"
print(ans)
Buggy python submission (verdict: Runtime Error):
sunuke,var = map(int,input().split())
loser = [1] * sunuke
for i in range(var):
  d = int(input())
  buy = map(int(input().split())
  for t in buy:
    winer[t-1] = 0
print(sum(loser))

Fixed submission:
n,k = map(int,input().split())
x = []
for i in range (k):
  d = int(input())
  a = list(map(int,input().split()))
  x += a
print(n-len(set(x)))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
have = [0] * n
for i in range (k):
  d = int(input())
  a = list(map(int,input().split()))
  for j in a:
    have[i] += 1
ans = 0
for m in range (1,k+1):
  if have[m] == 0:
    ans += 1
print(ans)

Fixed submission:
n,k = map(int,input().split())
x = []
for i in range (k):
  d = int(input())
  a = list(map(int,input().split()))
  x += a
print(n-len(set(x)))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
have = [0] * n
for i in range (k):
  d = int(input())
  a = map(int,input().split())
  for j in a:
    have[i] += 1
ans = 0
for m in range (1,k+1):
  if have[m] == 0:
    ans += 1
print(ans)

Fixed submission:
n,k = map(int,input().split())
x = []
for i in range (k):
  d = int(input())
  a = list(map(int,input().split()))
  x += a
print(n-len(set(x)))
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
ans = "No"
while True:
  c -= b if c <= 0
    ans = "Yes" break
  a -= d if a <= 0 break
print(ans)

Fixed submission:
a,b,c,d = map(int,input().split())
ans = "No"
while True:
  c -= b 
  if c <= 0:
    ans = "Yes"
    break
  a -= d 
  if a <= 0:
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
R = input()
print(2*R*3.14159265)

Fixed submission:
R = int(input())
print(2*R*3.14159265)
Buggy python submission (verdict: Runtime Error):
X,Y,Z = map(int,input().split())
print(Z X Y)

Fixed submission:
X,Y,Z = map(int,input().split())
print(Z,X,Y)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))

def vote(a,m):
  a.sort(reverse=True)
  if a[m-1] >= sum(a)/(4*m):
      return True
    else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)

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

def vote(a,m):
  a.sort(reverse=True)
  if a[m-1] >= sum(a)/(4*m):
      return True
  else:
      return False
    
ans = "Yes" if vote(A,M) else "No"
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input()split())
ans = N*(N-1)/2 + M*(M-1)/2
ans = int()
print(ans)

Fixed submission:
N,M = map(int,input().split())
ans = N*(N-1)//2 + M*(M-1)//2
print(ans)

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input()split())
ans = N*(N-1)/2 + M*(M-1)/2
print(ans)

Fixed submission:
N,M = map(int,input().split())
ans = N*(N-1)//2 + M*(M-1)//2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
    ans = 0
    B = A[:i] + A[i+1:]
    C = collections.Counter(B)
    for j in set(B):
        D = C[j]
        if D > 1:
            ans += combinations_count(D,2)
    print(ans)

Fixed submission:
import collections
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A)
num = 0
for i in set(A):
    if B[i] > 1:
        num += combinations_count(B[i], 2)
for i in A:
    print(num-B[i]+1)
Buggy python submission (verdict: Runtime Error):
S_1,S_2,S_3 = input().split()
if S_1 == S_2 && S_2 == S_3:
  print("No")
else:
  print("Yes")

Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
S_1,S_2,S_3 = input().split()
if s_1 == s_2 && s_2 == s_3:
  print("No")
else:
  print("Yes")

Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
s_1,s_2,s_3 = input().split()
if s_1 == s_2 && s_2 == s_3:
  print("No")
else:
  print("Yes")

Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
s_1,s_2,s_3 = input().split()
if s_1 == s_2 == s_3:
  print("No")
else:
  print("Yes")
  

Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
bol = 0
for i in range(Q):
    a = input().split()
    if a[0] == "1":
        bol = 0 if bol else 1
    elif a[1] == "1":
        if not bol:
            S = a[2] + S
        else:
            S = S + a[2]
    else:
        if not bol:
            S = S + a[2]
        else:
            S = a[2] + S
print(S if not bol else "".join(reversed(S)))

Fixed submission:
from collections import deque
S = input()
d = deque([S[i] for i in range(len(S))])
Q = int(input())
bol = 0
for i in range(Q):
    a = input().split()
    if a[0] == "1":
        bol = 0 if bol else 1
    elif a[1] == "1":
        if not bol:
            d.appendleft(a[2])
        else:
            d.append(a[2])
    else:
        if not bol:
            d.append(a[2])
        else:
            d.appendleft(a[2])
print("".join(d) if not bol else "".join(reversed(d)))
Buggy python submission (verdict: Runtime Error):
N = input()
N = int(S)
A = N / 2
B = (N + 1) / 2
if N % 2 == 0:
  print(A)
else:
  print(B)


Fixed submission:
N = int(input())
A = N / 2
A = int(A)
B = (N + 1) / 2
B = int(B)
if N % 2 == 0:
  print(A)
else:
  print(B)
Buggy python submission (verdict: Runtime Error):
N,R = input(int,split())
if N <= 9:
  R -= 100*(10-R)
print(R)

Fixed submission:
N,R = map(int,input().split())
if N <= 9:
  R += 100*(10-N)
print(R)
Buggy python submission (verdict: Runtime Error):
S,T,A,B,U = input().split()
A = int(A)
B = int(B)
if U == S:
  A -= 1
else:
  B -= 1
print(A,B)

Fixed submission:
S,T = map(str,input().split())
A,B = map(int,input().split())
U = input()
if S == U:
  A -= 1
else:
  B -= 1
print(A,B)

Buggy python submission (verdict: Runtime Error):
S,T,U = input().split()
A,B = map(int,input()split())
if U == S:
  A -= A
else:
  B -= B
print(A,B)

Fixed submission:
S,T = map(str,input().split())
A,B = map(int,input().split())
U = input()
if S == U:
  A -= 1
else:
  B -= 1
print(A,B)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
p = list(map(int,input().split()))
ans = 0
for i in range(N-K+1):
    ans = max(ans, sum(p[i:i+K]))
print((ans+K)/2)

Fixed submission:
N,K = map(int,input().split())
p = list(map(int,input().split()))
ans,num = sum(p[0:K]),sum(p[0:K])
for i in range(N-K):
    num = num + p[i+K] - p[i]
    ans = max(ans, num)
print((ans+K)/2)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
if N = M:
  print("Yes")
else:
  print("No")

Fixed submission:
N,M = map(int,input().split())
if N == M:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N,M = map(input().split())
if N == M:
  print("Yes")
else:
  print("No")

Fixed submission:
N,M = map(int,input().split())
if N == M:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
if N == M:
  print("Yes")
else:
  print("No")

Fixed submission:
N,M = map(int,input().split())
if N == M:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
if N == M:
  print("Yes")
if N != M:
  print("No")

Fixed submission:
N,M = map(int,input().split())
if N == M:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = 10**18
for i in range(N):
    ans = min(ans, abs(sum(A[:i])-sum(A[i:])))
print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = 10**18
left = 0
right = sum(A)
for i in range(N):
    ans = min(ans, abs(left-right))
    left += A[i]
    right -= A[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
D = list(map(int,input().split()))

if D[0] != 0:
    print(0)
    exit()

for i in range(max(D)):
    if i not in D:
        print(0)
        exit()

A = collections.Counter(D)
A = list(A.items())
A.sort()
ans = 1
for i in range(max(D)):
    ans *= A[i][1]**A[i+1][1]
    if ans >= 998244353:
        ans %= 998244353
print(ans)

Fixed submission:
import collections
N = int(input())
D = list(map(int,input().split()))

if D[0] != 0 or 0 in D[1:]:
    print(0)
    exit()

A = collections.Counter(D)
A = list(A.items())
A.sort()

if len(A) != max(D) + 1:
    print(0)
    exit()

ans = 1
for i in range(max(D)):
    ans *= A[i][1]**A[i+1][1]
    if ans >= 998244353:
        ans %= 998244353
print(ans)