Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
temp_word = [input() for i in range(n)]
word = str(temp_word)

num = int(n / 2)
if word[:num] == word[num:] :
	print("Yes")
else :
	print("No")


Fixed submission:
n = int(input())
word = str(input())

num = int(n / 2)
if word[:num] == word[num:] :
	print("Yes")
else :
	print("No")

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

num = int(n / 2)
if word[:num] == word[num:] :
 print("Yes")
else :
 print("No")


Fixed submission:
n = int(input())
word = str(input())

num = int(n / 2)
if word[:num] == word[num:] :
	print("Yes")
else :
	print("No")

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

num = int(n / 2)
if word[:num] == word[num:] :
 print("Yes")
else :
 print("No")


Fixed submission:
n = int(input())
word = str(input())

num = int(n / 2)
if word[:num] == word[num:] :
	print("Yes")
else :
	print("No")

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

num = int(n / 2)
if word[:num] == word[num:] :
    print("Yes")
else : 
  	print("No")

Fixed submission:
n = int(input())
word = str(input())

num = int(n / 2)
if word[:num] == word[num:] :
	print("Yes")
else :
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=list(map(int,input().split()))
sort_h=sorted(h,reverse=True)
if(n<k):
    print('0')
elif(k==0):
    print(sum(h))
else:
    for i in range(k):
        sort_h.pop(0)
    print(sum(sort_h))
    


Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
sort_h=sorted(h,reverse=True)
if(n<k):
    print('0')
elif(k==0):
    print(sum(h))
else:
    print(sum(sort_h[k:]))
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split())
for i in range(k):
    if(a>=1):
        a-=1
    elif((a<=0)and(b>=1)):
        b-=1
print(str(a)+' '+str(b))


Fixed submission:
a,b,k=map(int,input().split())
if a>k:
    a-=k
    k=0
else:
    k-=a
    a=0
b=max(0,b-k)
print(a,b)
Buggy python submission (verdict: Runtime Error):
s=input()
if s='SUN':
    print(7)
elif s='MON':
    print(6)
elif s='TUE':
    print(5)
elif s='WED':
    print(4)
elif s='THU':
    print(3)
elif s='FRI':
    print(2)
else:
    print(1)


Fixed submission:
s=input()
if s=='SUN':
    print(7)
elif s=='MON':
    print(6)
elif s=='TUE':
    print(5)
elif s=='WED':
    print(4)
elif s=='THU':
    print(3)
elif s=='FRI':
    print(2)
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
s=input()
if s=='Sunny':
    print('Cloudy')
elif s=='Cloudy':
    print('Rainy')
else s=='Rainy':
    print('Sunny')


Fixed submission:
s=input()
if s=='Sunny':
    print('Cloudy')
elif s=='Cloudy':
    print('Rainy')
elif s=='Rainy':
    print('Sunny')
Buggy python submission (verdict: Runtime Error):
be=input()
af=input()
ans=0
for i in range (3):
  	if be[i]==af[i]:
    	ans+=1
print(ans)


Fixed submission:
be=input()
af=input()
ans=0
for i in range (3):
    if be[i]==af[i]:
        ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
be=input()
af=input()
ans=0
for i in range (2):
  	if be[i]==af[i]:
    	ans+=1
print(ans)


Fixed submission:
be=input()
af=input()
ans=0
for i in range (3):
    if be[i]==af[i]:
        ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
be=str(input())
af=str(input())
ans=0
for i in range 3:
  	if be[i]==af[i]:
    	ans+=1
print(ans)


Fixed submission:
be=input()
af=input()
ans=0
for i in range (3):
    if be[i]==af[i]:
        ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
be=list(map(str,input().split()))
af=list(map(str,input().split()))
ans=0
for i in range 2:
  	if be[i]==af[i]:
    	ans+=1
print(ans)


Fixed submission:
be=input()
af=input()
ans=0
for i in range (3):
    if be[i]==af[i]:
        ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
be=list(map(str,input().split()))
af=list(map(str,input().split()))
ans=0
for i in range (0,2):
  	if be[i]==af[i]:
    	ans+=1
print(ans)

Fixed submission:
be=input()
af=input()
ans=0
for i in range (3):
    if be[i]==af[i]:
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=map(int, input().split())
for i in range(n-1):
    if(h[i]<h[i+1]):
        h[i+1]-=1
    if(h[i]>h[i+1]):
        print('No')
        return
print('Yes')


Fixed submission:
n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
    if(h[i]<h[i+1]):
        h[i+1]-=1
    if(h[i]>h[i+1]):
        print('No')
        exit()
print('Yes')

Buggy python submission (verdict: Runtime Error):
n=int(input())
h=[int,input().split() for _ in range(n)]
for i in range(n-1):
    if(h[i]<h[i+1]):
        h[i+1]-=1
    if(h[i]>h[i+1]):
        print('No')
        return
print('Yes')

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
    if(h[i]<h[i+1]):
        h[i+1]-=1
    if(h[i]>h[i+1]):
        print('No')
        exit()
print('Yes')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
for i in range (n):
    if(a[i]>=b[i]):
        ans+=b[i]
    elif(a[i+1]<b[i]-a[i])
        ans+=a[i]+a[i+1]
        a[i+1]=0
    else:
        ans+=b[i]
        a[i+1]-=b[i]-a[i]
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
for i in range (n):
    if(a[i]>=b[i]):
        ans+=b[i]
    elif(a[i+1]<b[i]-a[i]):
        ans+=a[i]+a[i+1]
        a[i+1]=0
    else:
        ans+=b[i]
        a[i+1]-=b[i]-a[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list()
for i in range (n):
    a.append(int(input()))
new_a_reverse=sorted(a,reverse=True)
for i in range(n):
    if(max(a)==a[i]):
        print(new_a_reverse[1])
    elif(max(a)!=a[i]):
        print(max(a))


Fixed submission:
n=int(input())
a=list()
for i in range (n):
    a.append(int(input()))
new_a_reverse=sorted(a,reverse=True)
max=new_a_reverse[0]
max2=new_a_reverse[1]
for i in a:
    if(i==max):
        print(max2)
    else:
        print(max)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list()
for i in range (n):
    a.append(int(input()))
for i in range(n):
    if(max(a)==a[i]):
        new_a_reverse=sorted(a,reverse=True)
        print(new_a_reverse[1])
    elif(max(a)!=a[i]):
        print(max(a))


Fixed submission:
n=int(input())
a=list()
for i in range (n):
    a.append(int(input()))
new_a_reverse=sorted(a,reverse=True)
max=new_a_reverse[0]
max2=new_a_reverse[1]
for i in a:
    if(i==max):
        print(max2)
    else:
        print(max)
Buggy python submission (verdict: Runtime Error):
S=input()
if (S[0]==S[1] and S[2]==s[3]) or (S[0]==S[2] and S[1]==S[3]) or (S[0]==S[3] and S[1]==S[2]):
    print('Yes')
else:
    print('No')
    

Fixed submission:
S=input()
if (S[0]==S[1] and S[2]==S[3]) or (S[0]==S[2] and S[1]==S[3]) or (S[0]==S[3] and S[1]==S[2]):
    if S[0]==S[1]==S[2]==S[3]:
        print('No')
    else:
        print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
ans=0
for a in range(b):
  if a%c!=0 or a%d!=0:
    ans+=1
print(ans)
  

Fixed submission:
S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
    print('Bad')
else:
    print('Good')
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
d=[0]*n
for i in range (2,n+1):
    d[i]=d[i-1]+l[i-1]
    if d[i]<=x:
        ans=ans+1
    else:
        break
print(ans)


Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
d=0
for i in range (0,n):
    d+=l[i]
    if d<=x:
        ans=ans+1
print(ans)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
d=[0]*n
for i in range (1,n+1):
    d[i]=d[i-1]+l[i-1]
    if d[i]<=x:
        ans=ans+1
    else:
        break
print(ans)


Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=1
d=0
for i in range (0,n):
    d+=l[i]
    if d<=x:
        ans=ans+1
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())
K=int(input())
Slist = list(S)
for i in range(N):
    if S[K-1]!=S[i]:
        Slist[i]='*'
        S_changed="".join(Slist)
print(S_changed)


Fixed submission:
N=int(input())
S=str(input())
K=int(input())
Slist = list(S)
S_changed= S
for i in range(N):
    if S[K-1]!=S[i]:
        Slist[i]='*'
        S_changed="".join(Slist)
print(S_changed)
Buggy python submission (verdict: Runtime Error):
N=int(input())
H=[int(x) for x in input().split()]
cnt=1
tall=H[0]
for i in range(1,N):
    if tall<=H[i]:
        tall=H[i]
        cnt+=1
print(cnt)


Fixed submission:
A,B=map(int,input().split())
if A>=B:
    a=A-1
    if a>=B:
        print(A+a)
    else :
        print(A+B)
elif B>A:
    b=B-1
    if b>=A:
        print(b+B)
    else :
        print(B+A)
Buggy python submission (verdict: Runtime Error):
N=int(input())
H=[int(x) for x in input().split()]
cnt=1
tall=H[0]
for i in range(1,n):
    if tall<=H[i]:
        tall=H[i]
        cnt+=1
print(cnt)


Fixed submission:
N=int(input())
H=[int(x) for x in input().split()]
cnt=1
tall=H[0]
for i in range(1,N):
    if tall<=H[i]:
        tall=H[i]
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
N=int(input())
s=input()
if s.count('R')>s.count('B'):
    print('Yes')
else:
    print('No')


Fixed submission:
A,B,C=map(int,input().split())
if A==C and A==B:
    print('Yes')
else :
    print('No')
Buggy python submission (verdict: Runtime Error):
b=input()
if b=A:
    print('T')
elif b=T:
    print('A')
elif b=C:
    print('G')
else:
    print('C')


Fixed submission:
b=input()
if b=='A':
    print('T')
elif b=='T':
    print('A')
elif b=='C':
    print('G')
else:
    print('C')

Buggy python submission (verdict: Runtime Error):
b=input()
if b='A':
    print('T')
elif b='T':
    print('A')
elif b='C':
    print('G')
else:
    print('C')

Fixed submission:
b=input()
if b=='A':
    print('T')
elif b=='T':
    print('A')
elif b=='C':
    print('G')
else:
    print('C')
Buggy python submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for d in range(n)]
ans=0
for i in range(n):
  C=c
  for j in range(m):
    C=C+a[i][j]*b[j]
    if C>0:
      ans=ans+1
print(ans)


Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

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

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))
Buggy python submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
for d in range(n):
  a=[list(map(int,input().split()))]
ans=0
for i in range(n):
    C=c
    for j in range(m):
        C+=a[i][j]*b[j]
    if C>0:
        ans+=1
print(ans)


Fixed submission:
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for d in range(n)]
ans=0
for i in range(n):
    C=c
    for j in range(m):
        C+=a[i][j]*b[j]
    if C>0:
        ans+=1
print(ans)

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

Fixed submission:
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for d in range(n)]
ans=0
for i in range(n):
    C=c
    for j in range(m):
        C+=a[i][j]*b[j]
    if C>0:
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B=map(iny,input().split())
if A<=8 and B<=8:
    print('Yay!')
else :
    print(':(')

Fixed submission:
A,B=map(int,input().split())
if A<=8 and B<=8:
    print('Yay!')
else :
    print(':(')
Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
for i in range(1,N+1):
    ans=i%10+i/10%10+i/100%10+i/1000%10+i/10000%10
    if A<=ans and ans<=B:
        total.append(ans)
print(sum(total))

Fixed submission:
N,A,B=map(int,input().split())
total=[]
for i in range(1,N+1):
    ans=i%10+i//10%10+i//100%10+i//1000%10+i//10000%10
    if A<=ans and ans<=B:
        total.append(i)
print(sum(total))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=map(int,input().split())
loop=True
cnt=0
while loop:
    for i in range(n):
        if a[i]%2==0:
            a[i]=a[i]/2
        else:
          loop=False
          break
    cnt=cnt+1
print(cnt)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
loop=True
cnt=0
while loop:
    for i in range(n):
        if a[i]%2==0:
            a[i]=a[i]/2
        else:
          loop=False
          break
    cnt=cnt+1
print(cnt-1)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=map(int,input().split())
loop=True
cnt=0
while True:
    for i in range(n):
        if a[i]%2==0:
            a[i]=a[i]/2
        else:
          loop=False
          break
    cnt=cnt+1
print(cnt)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
loop=True
cnt=0
while loop:
    for i in range(n):
        if a[i]%2==0:
            a[i]=a[i]/2
        else:
          loop=False
          break
    cnt=cnt+1
print(cnt-1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if b>=c:
    printabs((min(b,d)-max(a,c)))
else :
    print(0)


Fixed submission:
a,b,c,d=map(int,input().split())
if b>c and a<d:
    print((min(b,d)-max(a,c)))
else :
    print(0)
Buggy python submission (verdict: Runtime Error):
s=input()
print(s[0])
print(len(s)-2)
print(s[s-1])


Fixed submission:
s=input()
print(s[0]+str(len(s)-2)+s[-1])
Buggy python submission (verdict: Runtime Error):
X,A,B=map(int,input().split())
if C-B>A:
    print('dangerous')
elif C-B==A:
    print('safe')
else:
    print('delicious')

Fixed submission:
X,A,B=map(int,input().split())
if B<=A:
    print('delicious')
elif (B-A)<=X:
    print('safe')
else:
    print('dangerous')
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
g1=[1,3,5,7,8,10,12]
g2=[4,6,9,11]
if (((x in g1) and (y in g1)) or ((x in g2) and (y in g2)))
    print('Yes')
else:
    print('No')

Fixed submission:
x,y=map(int,input().split())
g1=[1,3,5,7,8,10,12]
g2=[4,6,9,11]
if (((x in g1) and (y in g1)) or ((x in g2) and (y in g2))):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
print int((N*800-(N/15)*200))

Fixed submission:
N=int(input())
print (int((N*800-int(N/15)*200)))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(str,input.split())
print('a'+ 'b'+ 'c')

Fixed submission:
s=str(input())
print(s.replace(',',' '))
Buggy python submission (verdict: Runtime Error):
a,op,b=map(input().split())
A=int(a)
B=int(b)
if op == '+':
    print(A+B)
else:
    print(A-B)

Fixed submission:
A,op,B=map(str,input().split())
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))

Buggy python submission (verdict: Runtime Error):
A=int(input())
op=input()
B=int(input())
if op == '+':
    print(A+B)
else:
    print(A-B)

Fixed submission:
A,op,B=map(str,input().split())
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))

Buggy python submission (verdict: Runtime Error):
A=int,input()
op=input()
B=int,input()
if op == '+':
    print(A+B)
else:
    print(A-B)

Fixed submission:
A,op,B=map(str,input().split())
if op == '+':
    print(int(A)+int(B))
else:
    print(int(A)-int(B))
Buggy python submission (verdict: Runtime Error):
c=input()
if c == a or c== i or c == u or c == e or c == o :
    print('vowel')
else:
    print('consonant')

Fixed submission:
c=input()
if (c == 'a' or c== 'i' or c == 'u' or c == 'e' or c == 'o') :
    print('vowel')
else:
    print('consonant')
Buggy python submission (verdict: Runtime Error):
a,b,c=map(str,input().split())
s=list[b]
print("A"+s[0]+"C")


Fixed submission:
a,b,c = map(str,input().split())
B = list(b)
print("A"+B[0]+"C")

Buggy python submission (verdict: Runtime Error):
a,b,c=map(input().split())
s=list[b]
print("A"+s[0]+"C")


Fixed submission:
a,b,c = map(str,input().split())
B = list(b)
print("A"+B[0]+"C")

Buggy python submission (verdict: Runtime Error):
a,b,c=map(input().split())
s=list[b]
print("A"+b[0]+"C")


Fixed submission:
a,b,c = map(str,input().split())
B = list(b)
print("A"+B[0]+"C")

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
s=list(b)
print("a"+"b[0]"+"c")


Fixed submission:
a,b,c = map(str,input().split())
B = list(b)
print("A"+B[0]+"C")

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
s=list[b]
print(a+b[0]+c)

Fixed submission:
a,b,c = map(str,input().split())
B = list(b)
print("A"+B[0]+"C")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
if(a+b==c)||(b+c==a)||(a+c==b):
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c=map(int, input().split())
if(a+b==c)or(b+c==a)or(a+c==b):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
if((a+b+c)%3=0):
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c=map(int, input().split())
if(a+b==c)or(b+c==a)or(a+c==b):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a=[N,K,X,Y]
for i in range(0,4):
    a=a.append(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy python submission (verdict: Runtime Error):
a=[N,K,X,Y]
for i in range(0,4):
    a=append(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(/n))
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print((K*X)+((N-K)*Y))
else:
    print(N*X)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print((K*X)+((N-K)*Y))
else:
    print((N*X))

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print((K*X)+((N-K)*Y))
else:
    print(int(N*X))

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print(int((K*X)+((N-K)*Y)))
else:
    print(int(N*X))

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=map(int,input().split(sep))
print(int((K*X)+((N-K)*Y)))

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)
Buggy python submission (verdict: Runtime Error):
n=int(input())
print(int (n(n+1)/2))

Fixed submission:
n=int(input())
print(int (n*(n+1)/2))
Buggy python submission (verdict: Runtime Error):
N,L=map(input().split())
list=[]
i=0
while i<N:
    S=input()
    list.append(S)
    i+=1
list.sort()
print(''.join(list))

Fixed submission:
N,L=map(int,input().split())
list=[]
i=0
while i<N:
    S=input()
    list.append(S)
    i+=1
list.sort()
print(''.join(list))
Buggy python submission (verdict: Runtime Error):
int n = input()
arr = []
arr = list(map(int, input().split()))
for i in range(n):
  num = arr[i]
  if num % 2 == 0:
    if (num % 6 == 0) or (num % 10 == 0):
      print("APPROVED")
    else:
      print("DENIED")

Fixed submission:
n = int(input())
arr = []
arr = list(map(int, input().split()))
flag = 0
count = 0
for i in range(n):
  num = arr[i]
  if num % 2 == 0:
    count += 1
    if(num % 6 == 0) or (num % 10 == 0):
      flag += 1
      
if flag == count:
    print("APPROVED")
else:
    print("DENIED")
Buggy python submission (verdict: Runtime Error):
N, M = [int(s) for s in input().split(' ')]
ac = 0
wa = 0
result = dict()
fail = dict()
for m in range(M):
    p, s = input().split(' ')
    if p in result and result[p] == 'AC':
        continue
    if s == 'WA':
        fail[p] = fail.get(p, 0) + 1
        result[p] = s
    elif s == 'AC': # AC
        ac += 1
        wa += fail[p]
        result[p] = s
    
print(str(ac) + ' ' + str(wa))


Fixed submission:
N, M = [int(s) for s in input().split(' ')]
ac = 0
wa = 0
result = dict()
fail = dict()
for m in range(M):
    p, s = input().split(' ')
    if p in result and result[p] == 'AC':
        continue
    if s == 'WA':
        fail[p] = fail.get(p, 0) + 1
        result[p] = s
    elif s == 'AC': # AC
        ac += 1
        wa += fail.get(p, 0) 
        result[p] = s
    
print(str(ac) + ' ' + str(wa))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ret = 0
for i in range(1, N):
    ret += i
# 1 2 3 4 5 6 7 8 9 10 11 12 13
# 2 3 4 5 6 7 8 9 10 11 12 13 1
print(ret)


Fixed submission:
N = int(input())
ret = (1 + N) * N // 2 - N 
# 1 2 3 4 5 6 7 8 9 10 11 12 13
# 2 3 4 5 6 7 8 9 10 11 12 13 1
print(ret)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = [i for i in range(1, N + 1)]
# 1 2 3 4 5 6 7 8 9 10 11 12 13
# 2 3 4 5 6 7 8 9 10 11 12 13 1
print(sum(P) - P[-1])


Fixed submission:
N = int(input())
ret = (1 + N) * N // 2 - N 
# 1 2 3 4 5 6 7 8 9 10 11 12 13
# 2 3 4 5 6 7 8 9 10 11 12 13 1
print(ret)