Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))

for a in A:
  A[a]+=A[a+1]
  
for b in B:
  B[b]+=B[b+1]

ans=0
op=m
for i in range(n+1):
  if A[i]>k:
    break
  while A[i]+B[op]>k:
    op-=1
   
  ans=max(ans,i+op)
  
print(ans)


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

asum=[0]
bsum=[0]

for i in range(n):
  asum.append(asum[i]+A[i])
  
for j in range(m):
  bsum.append(bsum[j]+B[j])

ans=0
ko=m
for i in range(n+1):
  if asum[i]>k:
    break
  while asum[i]+bsum[ko]>k:
    ko-=1
  ans=max(ans,i+ko)
  
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))

for a in A:
  A[a]+=A[a+1]
  
for b in B:
  B[b]+=B[b+1]

ans=0
op=m
for i in range(n+1):
  while A[i]+B[op]>k:
    op-=1
   
  ans=max(ans,i+op)
  
print(ans)

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

asum=[0]
bsum=[0]

for i in range(n):
  asum.append(asum[i]+A[i])
  
for j in range(m):
  bsum.append(bsum[j]+B[j])

ans=0
ko=m
for i in range(n+1):
  if asum[i]>k:
    break
  while asum[i]+bsum[ko]>k:
    ko-=1
  ans=max(ans,i+ko)
  
print(ans)

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()))

ans=0
count=0
i,j=0,0
while ans<k:
  if i > n-1:
    num=b[j]
  if j > m-1:
    num=a[i]
  else:
    num=min(a[i],b[j])
    if num==a[i]:
      i+=1
      count+=1
      ans+=num
    else:
      j+=1
      count+=1
      ans+=num
  
print(count-1)


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

asum=[0]
bsum=[0]

for i in range(n):
  asum.append(asum[i]+A[i])
  
for j in range(m):
  bsum.append(bsum[j]+B[j])

ans=0
ko=m
for i in range(n+1):
  if asum[i]>k:
    break
  while asum[i]+bsum[ko]>k:
    ko-=1
  ans=max(ans,i+ko)
  
print(ans)

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()))

ans=0
count=0
i,j=0,0
while ans<k:
  if i > n-1:
    num=b[j]
  if j > m-1:
    num=a[i]
  else:
    num=min(a[i],b[j])
    if num==a[i]:
      i+=1
      count+=1
      ans+=num
    else:
      j+=1
      count+=1
      ans+=num
  
print(count)

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

asum=[0]
bsum=[0]

for i in range(n):
  asum.append(asum[i]+A[i])
  
for j in range(m):
  bsum.append(bsum[j]+B[j])

ans=0
ko=m
for i in range(n+1):
  if asum[i]>k:
    break
  while asum[i]+bsum[ko]>k:
    ko-=1
  ans=max(ans,i+ko)
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

ans=0
for i in range(1,n+1):
  for j in range(1,n+1):
    if i%j == 0:
      ans+=i
      
print(ans)

Fixed submission:
n=int(input())

ans=0
for i in range(1,n+1):
  num=n//i
  ans+=i*num*(num+1)//2
  
print(ans)

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

ans=0
for i in rabge(1,n+1):
  num=n//i
  ans+=i*num*(num+1)/2
  
print(ans)

Fixed submission:
n=int(input())

ans=0
for i in range(1,n+1):
  num=n//i
  ans+=i*num*(num+1)//2
  
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

ans=0
for i in range(1,a+1):
  num=len(make_divisors(i))*i
  ans+=num
  
print(ans)
  
  

Fixed submission:
n=int(input())

ans=0
for i in range(1,n+1):
  num=n//i
  ans+=i*num*(num+1)//2
  
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
q=int(input())
before=[]
after=[]
for i in range(q):
    a,b=input().split()
    before.append(int(a))
    after.append(int(b))
    
for i in range(q):
  if before[i] in l:
    l=[after[i] if j == before[i] else j for j in l]
  print(sum(l))


Fixed submission:
a=str(input())

if a.isupper()==True:
  print("A")

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

ans=0
for i in range(k):
  mi=min(lis)
  ans+=mi
  lis.remove(mi)
  
print(ans)

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

ans=0
for i in range(k):
  mi=min(lis)
  ans+=mi
  lis.remove(mi)
  
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))

count=0
for i in l:
  for j in l:
    if i%j==0:
      if i!=j:
        count+=1
        break
      
print(n-count)

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

print(lis.index(0)+1)

Buggy python submission (verdict: Runtime Error):
lis=list(map(int,input(),split()))

print(lis.index(0)+1)

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

print(lis.index(0)+1)
Buggy python submission (verdict: Runtime Error):
a=map(str, input())
print(a[0:3])

Fixed submission:
a=input()
print(a[0:3])
Buggy python submission (verdict: Runtime Error):
a,v=map(int, input().split())
b,w=map(int, input().split())
t=int(input())

ans="NO"
if v>w:
  f=v-w
  hoge=hoge(a-b)
  if f*t>=hoge:
    ans="YES"
    
print(ans)

  

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

ans="NO"
if v>w:
  f=v-w
  hoge=abs(a-b)
  if f*t>=hoge:
    ans="YES"
    
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=input().split()
ans=a*b
ans=ans//1
print(int(ans))

Fixed submission:
s=input().split()
a=int(s[0])
b=int(float(s[1])*1000) 
ans=a*b
print(ans//1000)

Buggy python submission (verdict: Runtime Error):
a,b =map(int,input().split())
ans=a*b
ans=ans//1
print(ans)

Fixed submission:
s=input().split()
a=int(s[0])
b=int(float(s[1])*1000) 
ans=a*b
print(ans//1000)

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

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

print(math.floor(ans))


Fixed submission:
s=input().split()
a=int(s[0])
b=int(float(s[1])*1000) 
ans=a*b
print(ans//1000)

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

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

print(math.floor(ans))

Fixed submission:
s=input().split()
a=int(s[0])
b=int(float(s[1])*1000) 
ans=a*b
print(ans//1000)
Buggy python submission (verdict: Runtime Error):
k,n=map(int,input().split())
l=list(map(int,input().split()))

diff=[]
l.append(l[0]+k)

for i in range(n-1):
  diff.append(l[n+1]-l[n])
  
print(sum(diff)-max(diff))

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

diff=[]
l.append(l[0]+k)
for i in range(n):
  diff.append(l[i+1]-l[i])

print(sum(diff)-max(diff))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

n=int(input())
l=list(map(int,input().split()))

cl=Counter(l)

for i in range(n):
  if i==0:
    num=0
    cl[l[i]]-=1
    for j in cl.values():
      num+=(j*(j-1)/2)
  else:
    cl[l[i]]-=1
    cl[l[i-1]]+=1
    num=0
    for j in cl.values():
      num+=(j*(j-1)/2)
  print(int(num))
  

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Mon Sep  7 22:04:16 2020

@author: liang
"""

N = int(input())
A = [int(x) for x in input().split()]
d = [0]*N

for a in A:
    d[a-1] += 1
#print(d)
score = 0
for  a in d:
    score += a*(a-1)//2
#print(score)
for a in A:
    print(score - d[a-1] + 1)
Buggy python submission (verdict: Runtime Error):
l=list(map(int,imput().split()))
l+=list(map(int,imput().split()))
l+=list(map(int,imput().split()))

n=int(input())

ans_list=[False]*9

for i in range(n):
  num=int(input())
  if num in l:
    index=l.index(num)
    ans_list[index]=True
    
if ans_list[0] and ans_list[1] and ans_list[2]:
  print("Yes")
elif ans_list[0] and ans_list[3] and ans_list[6]:
  print("Yes")
elif ans_list[3] and ans_list[4] and ans_list[5]:
  print("Yes")
elif ans_list[6] and ans_list[7] and ans_list[8]:
  print("Yes")
elif ans_list[1] and ans_list[4] and ans_list[7]:
  print("Yes")
elif ans_list[2] and ans_list[5] and ans_list[8]:
  print("Yes")
elif ans_list[0] and ans_list[4] and ans_list[8]:
  print("Yes")
elif ans_list[2] and ans_list[4] and ans_list[6]:
  print("Yes")
else:
  print("No")

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

n=int(input())

ans_list=[False]*9

for i in range(n):
  num=int(input())
  if num in l:
    index=l.index(num)
    ans_list[index]=True
    
if ans_list[0] and ans_list[1] and ans_list[2]:
  print("Yes")
elif ans_list[0] and ans_list[3] and ans_list[6]:
  print("Yes")
elif ans_list[3] and ans_list[4] and ans_list[5]:
  print("Yes")
elif ans_list[6] and ans_list[7] and ans_list[8]:
  print("Yes")
elif ans_list[1] and ans_list[4] and ans_list[7]:
  print("Yes")
elif ans_list[2] and ans_list[5] and ans_list[8]:
  print("Yes")
elif ans_list[0] and ans_list[4] and ans_list[8]:
  print("Yes")
elif ans_list[2] and ans_list[4] and ans_list[6]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[list(map(int,input().split())) for i in range(m)]

num=[-1]*n

for i in l:
  if num[i[0]-1]==-1 or num[i[0]-1]==i[1]:
    num[i[0]-1]=i[1]
  elif i[0]==1 and i[1]==0 and n==1:
    print(0)
    exit()
  else:
    print(-1)
    exit()
    
if num[0]==0:
  print(-1)
elif n=1 and num[0]==-1:
  print(0)
else:
  for i in range(len(num)):
    if num[i]==-1 and i==0:
      num[i]=1
    elif num[i]==-1:
      num[i]=0
    
  print(*num,sep='')

Fixed submission:
N,M = map(int,input().split())
a = [-1]*N
ans = 0
for i in range(M):
    s,c = map(int,input().split())
    if a[s-1] == -1:
        a[s-1] = c
    elif a[s-1] != c:
        ans = -1
        break
if a[0] == 0 and N>1:
    ans = -1
if ans != -1:
    if a[0] == -1 and N>1:
        a[0] = 1
    if a[0] == -1 and N == 1:
        a[0] = 0
    for i in range(N):
        if a[i] == -1:
            a[i] = 0
        a[i] = str(a[i])
    ans = "".join(a)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
l=list(map(int,input().split()))

lis=[(i+1)/2 for i in l]
ans=0

for i in range(n-k+1):
  l=lis[i:i+k]
  num=sum(l)
  ans=max(num,ans)
  
print(ans)

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

for i in range(n):
  l[i]=(l[i]+1)/2

lis=[0]*(n+1)
for i in range(n):
  lis[i+1]=lis[i]+l[i]
  
ans=0
for i in range(n-k+1):
  num=lis[i+k]-lis[i]
  ans=max(num,ans)
  
print(ans)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=sorted(list(map(int,input().split())),reversed=True)

l=l[0:k]
max_l=max(l)

num=0
sum_lis=[]
for i in range(1,max_l+1):
  num+=i
  sum_lis.append(num)
  
ans=0
for i in l:
  a=sum_lis[i-1]
  ans+=(a/i)
  
print(ans)

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

for i in range(n):
  l[i]=(l[i]+1)/2

lis=[0]*(n+1)
for i in range(n):
  lis[i+1]=lis[i]+l[i]
  
ans=0
for i in range(n-k+1):
  num=lis[i+k]-lis[i]
  ans=max(num,ans)
  
print(ans)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=sorted(list(map(int,input().split())),reversed=True)

l=l[0:k]
max_l=max(l)

num=0
sum_lis=[]
for i in range(1,max_l+1):
  num+=i
  sum_lis.append(num)
  
ans=0
for i in l:
  a=sum_lis[i-1]
  ans+=(a/i)
  print(ans,i,a)
  
print(ans)

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

for i in range(n):
  l[i]=(l[i]+1)/2

lis=[0]*(n+1)
for i in range(n):
  lis[i+1]=lis[i]+l[i]
  
ans=0
for i in range(n-k+1):
  num=lis[i+k]-lis[i]
  ans=max(num,ans)
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))

cnt=0
for i in range(1,n+1):
  if min(l[:i])==l[i-1]:
    cnt+=1
  
    
print(cnt)

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

cnt=0
num=max(l)

for i in l:
  num=min(num,i)
  if num==i:
    cnt+=1
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
s=int(input())

sl=len(s)+1
l=[0]*sl

for i in range(sl-1):
  if s[i]=="<":
    l[i+1]=l[i]+1
    
for i in range(sl-2,-1,-1):
  if s[i]==">":
    l[i]=max(l[i+1], l[i])
    
print(sum(l))
  
  

Fixed submission:
s=input()

sl=len(s)+1
l=[0]*sl

for i in range(sl-1):
  if s[i]=="<":
    l[i+1]=l[i]+1
    
for i in range(sl-2,-1,-1):
  if s[i]==">":
    l[i]=max(l[i+1]+1, l[i])
    
print(sum(l))
Buggy python submission (verdict: Runtime Error):
n,k,q=map(int,input().split())

for i in range(1,n+1):
  ans=k
  for j in range(q):
    que=int(input())
    if que!=i:
      ans-=1
    if ans<=0:
      break
  if ans<=0:
    print("No")
  else:
    print("Yes")
  


Fixed submission:
from collections import Counter

n,k,q=map(int,input().split())
l=[int(input()) for i in range(q)]

l_c=Counter(l)

for i in range(1,n+1):
  ok=l_c[i]
  num=k-q+ok
  if num>0:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n,k,q=map(int,input().split())
l=[int(input()) for i in range(q)]

for i in range(1,n+1):
  ans=k
  for que in l:
    if que!=i:
      ans-=1
  if ans<=0:
    print("No")
  else:
    print("Yes")
  


Fixed submission:
from collections import Counter

n,k,q=map(int,input().split())
l=[int(input()) for i in range(q)]

l_c=Counter(l)

for i in range(1,n+1):
  ok=l_c[i]
  num=k-q+ok
  if num>0:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
l=[int(input().split()) for i in range(q)]

for i in range(1,n+1):
  ans=k
  for que in l:
    if que!=i:
      ans-=1
  if ans<=0:
    print("No")
  else:
    print("Yes")
  


Fixed submission:
from collections import Counter

n,k,q=map(int,input().split())
l=[int(input()) for i in range(q)]

l_c=Counter(l)

for i in range(1,n+1):
  ok=l_c[i]
  num=k-q+ok
  if num>0:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n,k,q=map(int,input().split())

for i in range(1,n+1):
  ans=k
  for j in range(q):
    que=int(input())
    if que!=i:
      ans-=1
  if ans<=0:
    print("No")
  else:
    print("Yes")
  

Fixed submission:
from collections import Counter

n,k,q=map(int,input().split())
l=[int(input()) for i in range(q)]

l_c=Counter(l)

for i in range(1,n+1):
  ok=l_c[i]
  num=k-q+ok
  if num>0:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

n=1
while (a-1)n+1 <= b:
  n+=1
  
print(n)


Fixed submission:
a,b=map(int,input().split())
 
n=0
while (a-1)*n+1 < b:
  n+=1
  
print(n)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==b:
  print(1)
  break
else:
  num=0
  hoge=a
  while b>hoge:
    hoge+=a
    num+=1
    print(num)
  


Fixed submission:
a,b=map(int,input().split())
 
n=0
while (a-1)*n+1 < b:
  n+=1
  
print(n)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

ans=0
for i in range(n):
  ans+=i
  
print(ans)

Fixed submission:
n=int(input())

ans=n*(n-1)//2
  
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=[int(input()) for i in range(n)]

for i in range(n):
  lis=l[:i]+l[i+1:]
  print(max(lis))

Fixed submission:
n=int(input())
l=[int(input()) for i in range(n)]

max_num=max(l)
max_index=l.index(max(l))

for i in range(n):
  if i!=max_index:
    print(max_num)
  else:
    l.remove(max_num)
    print(max(l))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(map(int,input().split()))

if m==1:
  print(0)
else:
  num=n-1
  sl=sorted(l)

  dsl=[abs(sl[i+1]-sl[i]) for i in range(m-1)]

  for i in range(num):
    ml=max(dsl)
    dsl.remove(ml)
  
  print(sum(dsl))


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

if n>=m:
  print(0)
else:
  num=n-1
  sl=sorted(l)

  dsl=[abs(sl[i+1]-sl[i]) for i in range(m-1)]

  dsl=sorted(dsl)
  print(sum(dsl[0:len(dsl)-num]))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(map(int,input().split()))

num=n-1
sl=sorted(l)

dsl=[sl[i+1]-sl[i] for i in range(m-1)]
priny(dsl)

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

if n>=m:
  print(0)
else:
  num=n-1
  sl=sorted(l)

  dsl=[abs(sl[i+1]-sl[i]) for i in range(m-1)]

  dsl=sorted(dsl)
  print(sum(dsl[0:len(dsl)-num]))
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[input() for i in range(n)]

if l.most_common()[0][1] != 1:
  ans="No"
else:
  l_head = [i[0] for i in l]
  l_tail = [i[-1] for i in l]
  if l_head == l_tail:
    ans="Yes"
  else:
    ans="No"
    
print(ans)
  

Fixed submission:
from collections import Counter

n=int(input())
l=[input() for i in range(n)]

if Counter(l).most_common()[0][1] != 1:
  ans="No"
else:
  l_head = [l[i+1][0] for i in range(n-1)]
  l_tail = [l[i][-1] for i in range(n-1)]
  if l_head == l_tail:
    ans="Yes"
  else:
    ans="No"
    
print(ans)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
lis=[list(input()) for i in range(h)]

fin=[]
ans=[]

for l in lis:
  if l.count(".") != w:
    fin.append(l)
  else:  
    h=h-1

tr = []
for i in range(w):
    tr_row = []
    for vector in fin:
        tr_row.append(vector[i])
    tr.append(tr_row)
    
for t in tr:
  if t.count(".") != h:
    ans.append(t)
  else:  
    w=w-1
    
for i in range(w):
    tr_row = []
    for vector in ans:
        tr_row.append(vector[i])
    print(*tr_row)


Fixed submission:
h,w=map(int,input().split())
lis=[list(input()) for i in range(h)]

fin=[]
num=[0]*w

for l in lis:
  if l.count(".") != w:
    fin.append(l)
  for i in range(w):
    if l[i]==".":
      num[i]+=1

for f in fin:
  ans=[]
  for i in range(len(num)):
    if num[i]!=h:
      ans.append(f[i])
  print(*ans,sep='')

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
lis=[list(input()) for i in range(h)]

fin=[]

for l in lis:
  if l.count(".") != w:
    fin.append(l)
  else:  
    h=h-1

num=[]
for i in range(w):
  cnt=0
  for f in fin:
    if f[i] == ".":
      cnt+=1
  if cnt == h:
    num.append(i)
      
for i in num:
  for f in fin:
    f.pop(i)
    
for i in fin:
  print(*i)

Fixed submission:
h,w=map(int,input().split())
lis=[list(input()) for i in range(h)]

fin=[]
num=[0]*w

for l in lis:
  if l.count(".") != w:
    fin.append(l)
  for i in range(w):
    if l[i]==".":
      num[i]+=1

for f in fin:
  ans=[]
  for i in range(len(num)):
    if num[i]!=h:
      ans.append(f[i])
  print(*ans,sep='')
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=list(map(int,input()))

cnt=1
num=k
while num<n:
  num+=(k-1)
  cnt+=1
  
print(cnt)


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

cnt=1
num=k
while num<n:
  num+=(k-1)
  cnt+=1
  
print(cnt)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=list(map(int,input()))

cnt=1
num=3
while num<n:
  num+=2
  cnt+=1
  
print(cnt)

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

cnt=1
num=k
while num<n:
  num+=(k-1)
  cnt+=1
  
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,k=map(int,input().split())

if a==b:
  print(0)
elif k==0:
  print(a-b)
else:
  for i in range(k):
    a,b,c = b+c,a+c,a+b
  if abs(a-b)>=10**18:
    print(-1)
  else:
    print(a-b)
  

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

if a==b:
  print(0)
else:
  ans_0=a-b
  ans_1=b-a
  if abs(ans_0)>=10**18:
    print("Unfair")
  elif k%2!=0:
    print(ans_1)
  elif k%2==0:
    print(ans_0)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
  ans=a-b
elif n==1 and b==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)


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

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
  ans=a-b
elif n==1 and m==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-
  ans=a-b
elif n==1 and b==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)


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

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
  ans=a-b
elif n==1 and m==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m=int(input())

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
elif n==1 or m==1:
  a=n*m
  b=2
elif n==2 or m==2:
  a=0
  b=0
  
print(a-b)

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

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
  ans=a-b
elif n==1 and m==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)
Buggy python submission (verdict: Runtime Error):
l=[list(map(int,input())) for i in range(3)]

sum_l=0
ans="No"

for i in l:
  sum_l+=sum(i)
  
if sum_l%3==0:
  ans="Yes"

print(ans)

Fixed submission:
c=[list(map(int,input().split())) for i in range(3)]
if (c[0][0]+c[1][1]+c[2][2])*2==c[0][1]+c[0][2]+c[1][0]+c[1][2]+c[2][0]+c[2][1]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      num_500=500*i
      num_100=100*j
      num_50=50*k
      if num_500+num_100+num_50==x:
        ans+=1
        
print(ans)


Fixed submission:
a=int(input())
b=int(input())
c=int(input())
x=int(input())

ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      num_500=500*i
      num_100=100*j
      num_50=50*k
      if num_500+num_100+num_50==x:
        ans+=1
        
print(ans)
Buggy python submission (verdict: Runtime Error):
a=str(input())
b=str(input())

n=a+b
 
for i in range(int(n)//2):
  if i**2==int(n):
    ans="Yes"
    break
  else:
    ans="No"
print(ans)

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

n=a+b
 
for i in range(int(n)//2):
  if i**2==int(n):
    ans="Yes"
    break
  else:
    ans="No"
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b=str(input()),str(input())
n=a+b

for i in range(n//2):
  if i**2==n:
    print("Yes")
    break
  else:
    print("No")

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

n=a+b
 
for i in range(int(n)//2):
  if i**2==int(n):
    ans="Yes"
    break
  else:
    ans="No"
print(ans)