Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, x = map(int, input().split())

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

ans = 0

for i in range(n - 1):
    while a[i] + a[i + 1] > x:
        a[i + 1] -= 1
        ans += 1

print(ans)


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

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

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

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

before_sum = sum(a)

for i in range(n - 1):
    while a[i] + a[i + 1] > x:
        a[i + 1] -= 1

after_sum = sum(a)

print(before_sum - after_sum)


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

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

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

a = list(map(int, input().split())
before = sum(a)

for i in range(n-1):
	while a[i] + a[i+1] > x:
		a[i+1] -= 1
		
after = sum(a)

print(after - before)

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

cnt, a[0] = sum(a), min(a[0], x)
for i in range(1, n):
    if a[i - 1] + a[i] > x:
        a[i] = x - a[i - 1]
print(cnt - sum(a))
Buggy python submission (verdict: Runtime Error):
a=int(input())
ans=0
for i in range(1,n+1):
  num=n//i
  ans+=(((num+1)*num)//2)*i
print(ans)

Fixed submission:
a=int(input())
ans=0
for i in range(1,a+1):
  num=a//i
  ans+=(((num+1)*num)//2)*i
print(ans)

Buggy python submission (verdict: Runtime Error):
a=int(input())
ans=0
for i in range(1,n+1):
  num=n//i
  ans+=((num+1)//2)*i
print(ans)

Fixed submission:
a=int(input())
ans=0
for i in range(1,a+1):
  num=a//i
  ans+=(((num+1)*num)//2)*i
print(ans)

Buggy python submission (verdict: Runtime Error):
a=int(input())
ans=0
for i in range(1,n+1):
  num=n//1
  ans+=((num+1)//2)*i
print(ans)

Fixed submission:
a=int(input())
ans=0
for i in range(1,a+1):
  num=a//i
  ans+=(((num+1)*num)//2)*i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import functools
import operator

a=int(input())
b=list(map(int,input().split()))
c = functools.reduce(operator.mul, b)
if c>10**18:
  print(-1)
else:
  print(c)

Fixed submission:
import numpy as np
a=int(input())
b=list(map(int,input().split()))
c=1
if 0 in b:
    print(0)
    exit()
else:
    for i in range(a):
        c=c*b[i]
        if c>10**18:
            print(-1)
            exit()
        else:
            continue
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
b=list(map(int,input().split()))
c=1
for i in range(a):
  c=c*b[i]
if c>10**18:
  print(-1)
else:
  print(c)

Fixed submission:
import numpy as np
a=int(input())
b=list(map(int,input().split()))
c=1
if 0 in b:
    print(0)
    exit()
else:
    for i in range(a):
        c=c*b[i]
        if c>10**18:
            print(-1)
            exit()
        else:
            continue
print(c)
Buggy python submission (verdict: Runtime Error):
def cloth(a):
    n=len(a)
    r=[0]*3
    for i in range(n):
        r[0]+=a[i][0]
        r[1]+=a[i][1]
        r[2]+=a[i][2]
    return r
a,b,c=map(int,input().split())
d=[]
for i in range(a):
    n=list(map(int,input().split()))
    d.append(n)

m=[]
q=[]

for i in range(2**a):
    score=[]
    total=0
    for j in range(a):
        if ((i>>j)&1):
            score.append(d[j][1:b+1])
            total+=d[j][0]
    m.append([score,total])

large=len(m)
決勝=[]
n=0
q=0
while True:
    q=len(m[n][0])
    if q==a:
        break
    r=cloth(m[n][0])
    n+=1
    if r[0]<c or r[1]<c or r[2]<c:
        continue
    else:
        決勝.append(m[n][1])

u=cloth(m[-1][0])
if len(決勝)==0 and len([i for i in u if i>=c])==3:
    print(m[-1][1])

elif len(決勝)==0:
    print(-1)
else:
    print(min(決勝))
                
    




Fixed submission:
a,b,c=map(int,input().split())
d=[]
for i in range(a):
    n=list(map(int,input().split()))
    d.append(n)
ans=[]
q=len(d)
for i in range(2**q):
    score=[0]*b
    total=0
    n=0
    for j in range(q):
        if ((i>>j)&1):
            for m in range(b):
                score[m]+=d[j][m+1]
            total+=d[j][0]
    for mm in range(b):
        if score[mm]>=c:
            n+=1
    if n==b:
        ans.append(total)

if ans==[]:
    print(-1)
else:
    print(min(ans))

Buggy python submission (verdict: Runtime Error):
def cloth(a):
    n=len(a)
    r=[0]*3
    for i in range(n):
        r[0]+=a[i][0]
        r[1]+=a[i][1]
        r[2]+=a[i][2]
    return r
a,b,c=map(int,input().split())
d=[]
for i in range(a):
    n=list(map(int,input().split()))
    d.append(n)

m=[]
q=[]

for i in range(2**a):
    score=[]
    total=0
    for j in range(a):
        if ((i>>j)&1):
            score.append(d[j][1:b+1])
            total+=d[j][0]
    m.append([score,total])

large=len(m)
決勝=[]
n=0
q=0
while True:
    q=len(m[n][0])
    if q==a:
        break
    r=cloth(m[n][0])
    n+=1
    if r[0]<c or r[1]<c or r[2]<c:
        continue
    else:
        決勝.append(m[n-1][1])

u=cloth(m[-1][0])
if len(決勝)==0 and len([i for i in u if i>=c])==3:
    print(m[-1][1])

elif len(決勝)==0:
    print(-1)
else:
    print(min(決勝))
                
    




Fixed submission:
a,b,c=map(int,input().split())
d=[]
for i in range(a):
    n=list(map(int,input().split()))
    d.append(n)
ans=[]
q=len(d)
for i in range(2**q):
    score=[0]*b
    total=0
    n=0
    for j in range(q):
        if ((i>>j)&1):
            for m in range(b):
                score[m]+=d[j][m+1]
            total+=d[j][0]
    for mm in range(b):
        if score[mm]>=c:
            n+=1
    if n==b:
        ans.append(total)

if ans==[]:
    print(-1)
else:
    print(min(ans))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=int(input())
d=list(map(int,input().split()))
e=[input() for _ in range(b)]
f=list(map(int,input().split()))

print(a-c)

Fixed submission:
import itertools
a,b=map(int,input().split())
c=[]
for i in range(1,b*2+1):
    c.append(list(map(int,input().split())))
n=c[1::2]
n=list(itertools.chain.from_iterable(n))
print(a-len(set(n)))
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=0
f=0
while a-d>=0:
    g=a-d
    e+=1
    a=g
while c-b>=0:
    h=c-b
    f+=1
    c=h
if g<h:
    print('Yes')
elif f==0:
    print('Yes')
elif e==f:
    print('No')
else:
    print('No')
    


Fixed submission:
import math
a,b,c,d=map(int,input().split())
e=math.ceil(c/b)
f=math.ceil(a/d)
if e>f:
  print('No')
elif e==f:
  print('Yes')
else:
  print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)
n,m=zip(*c.most_common())
n,m=list(n),list(m)

for i in range(1,a+1):
    if i in n:
        print(c[i])
    else:
        print(0)

Fixed submission:
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)
n,m=zip(*c.most_common())
n,m=list(n),list(m)
o=c.most_common()

result=[0]*a
for i in range(len(o)):
    result[o[i][0]-1]=o[i][1]

for i in result:
    print(i)

Buggy python submission (verdict: Runtime Error):
import collections
a=int(input())
b=list(map(int,input().split()))
c=[0]*a
d=collections.Counter(b)
n,m=zip(*d.most_common())
n=list(n)
m=list(m)

for i in n:
    c[i-1]=m[i-1]
for i in range(a):
    print(c[i])


Fixed submission:
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)
n,m=zip(*c.most_common())
n,m=list(n),list(m)
o=c.most_common()

result=[0]*a
for i in range(len(o)):
    result[o[i][0]-1]=o[i][1]

for i in result:
    print(i)

Buggy python submission (verdict: Runtime Error):
import collections
a=int(input())
b=list(map(int,input().split()))
c=[0]*a
d=collections.Counter(b)
n,m=zip(*d.most_common())
n=list(n)
m=list(m)
for i in n:
    c[i-1]=m[i-1]
print(c)
for i in c:
    print(i)


Fixed submission:
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)
n,m=zip(*c.most_common())
n,m=list(n),list(m)
o=c.most_common()

result=[0]*a
for i in range(len(o)):
    result[o[i][0]-1]=o[i][1]

for i in result:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
b=list(map(int,input().split()))
c=list(range(1,a+1))
for i in c:
    print(b.count(i))

Fixed submission:
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)
n,m=zip(*c.most_common())
n,m=list(n),list(m)
o=c.most_common()

result=[0]*a
for i in range(len(o)):
    result[o[i][0]-1]=o[i][1]

for i in result:
    print(i)

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

for i in range(1,len(b)+1):
    print(b.count(i))
print(0)

Fixed submission:
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)
n,m=zip(*c.most_common())
n,m=list(n),list(m)
o=c.most_common()

result=[0]*a
for i in range(len(o)):
    result[o[i][0]-1]=o[i][1]

for i in result:
    print(i)
Buggy python submission (verdict: Runtime Error):
p=list(int(input()))
a=(p[0])
b=(p[1])
c=(p[2])
if a==7 or b==7 or c==7:
	print(Yes)
else:
	print(No)

Fixed submission:
p=list(input())
a=int(p[0])
b=int(p[1])
c=int(p[2])
if a==7 or b==7 or c==7:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
p=list(input())
a=int(a[0])
b=int(a[1])
c=int(a[2])
if a==7 or b==7 or c==7:
	print(Yes)
else:
	print(No)

Fixed submission:
p=list(input())
a=int(p[0])
b=int(p[1])
c=int(p[2])
if a==7 or b==7 or c==7:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(7)
if a in b:
    print('yes')
else a in b:
    print('no')


Fixed submission:
p=list(input())
a=int(p[0])
b=int(p[1])
c=int(p[2])
if a==7 or b==7 or c==7:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=(7)
if a in b:
    print('yes')
else a in b:
    print('no')


Fixed submission:
p=list(input())
a=int(p[0])
b=int(p[1])
c=int(p[2])
if a==7 or b==7 or c==7:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=((a//3)*(3+(3*(a//3))))*(1/2)
c=((a//5)*(5+(5*(a//5))))*(1/2)
d=((a//15)*(15+(15*(a//15))))*(1/2)
e=(a(1+a)*(1/2))-(b+c-d)
print(e)

Fixed submission:
a=int(input())
b=((a//3)*(3+(3*(a//3))))*(1/2)
c=((a//5)*(5+(5*(a//5))))*(1/2)
d=((a//15)*(15+(15*(a//15))))*(1/2)
e=(a*(1+a)*(1/2))-(b+c-d)
print(int(e))
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        te=gcd(i,j)
        for k in l3:
            count+=(te,k)

print(count)

Fixed submission:
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        te=math.gcd(i,j)
        for k in l3:
            count+=math.gcd(te,k)

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        for k in l3:
            count+=gcd_list([i,j,k])

print(count)

Fixed submission:
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        te=math.gcd(i,j)
        for k in l3:
            count+=math.gcd(te,k)

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        for k in l3:
            count+=gcd_list([i,j,k])

print(count)

Fixed submission:
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        te=math.gcd(i,j)
        for k in l3:
            count+=math.gcd(te,k)

print(count)
Buggy python submission (verdict: Runtime Error):
def uhe(x):
    return x%2

a,b=map(int,input().split())
c=list(range(2,a*2+1,2))
d=list(range(1,b*2+1,2))

e=[(x+y) for x in c for y in d]
f=list(map(uhe,e))

while a!=1:
    g=(a-1)*a
    a=a-1
while b!=1:
    h=(b-1)*b
    b=a-1
print(g,h)
print(f.count(0)+g//a+h//b)

Fixed submission:
a,b=map(int,input().split())
n=(a*(a-1))//2
m=(b*(b-1))//2
if b<2 and a<2:
  print(0)
elif b<2:
  print(n)
else:
  print(n+m)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b,c,d=a/3
print(a*b*c)

Fixed submission:
a=int(input())
print((a/3)**3)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)
n,m=zip(*c.most_common())
n,m=list(n),list(m)
result=0
for i in range(len(m)):
    result+=(m[i]*(m[i]-1))//2

for i in b:
    print(result-m[n.index(i)]+1)
    

Fixed submission:
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)

n,m=zip(*c.most_common())
n,m=list(n),list(m)
result=0
for i in range(len(m)):
    result+=(m[i]*(m[i]-1))//2

for i in b:
    print(result-c[i]+1)

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

c=collections.Counter(b)
n,m=zip(*c.most_common())
n,m=list(n),list(m)
result=0
for i in range(len(m)):
    result+=(m[i]*(m[i]-1))//2

for i in b:
    print(result-m[n.index(i)]+1)
    

Fixed submission:
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)

n,m=zip(*c.most_common())
n,m=list(n),list(m)
result=0
for i in range(len(m)):
    result+=(m[i]*(m[i]-1))//2

for i in b:
    print(result-c[i]+1)

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

c=collections.Counter(b)
n,m=zip(*c.most_common())
n,m=list(n),list(m)
result=0
for i in range(len(m)):
    result+=(m[i]*(m[i]-1))//2
for i in range(a):
    print(result-(m[n.index(b[i])]-1))




Fixed submission:
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)

n,m=zip(*c.most_common())
n,m=list(n),list(m)
result=0
for i in range(len(m)):
    result+=(m[i]*(m[i]-1))//2

for i in b:
    print(result-c[i]+1)

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

c=collections.Counter(b)
n,m=zip(*c.most_common())
m=list(m)
n=list(n)
q=0
for i in range(len(m)):
    t=(m[i]*(m[i]-1))//2
    q+=t

for i in range(a):
    w=m[n.index(b[i])]-1
    print(q-w)


Fixed submission:
import collections
a=int(input())
b=list(map(int,input().split()))

c=collections.Counter(b)

n,m=zip(*c.most_common())
n,m=list(n),list(m)
result=0
for i in range(len(m)):
    result+=(m[i]*(m[i]-1))//2

for i in b:
    print(result-c[i]+1)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=len([i for i in range(1,a+1) if i%2==0])
d=len([i for i in range(1,a+1) if i%2!=0])
e=len([i for i in range(1,b+1) if i%2==0])
f=len([i for i in range(1,b+1) if i%2!=0])
if a%2==0 and b%2==0:
    print((a*b)//2)
elif a%2==0 and b%2!=0:
    print((a//2)*b)
elif a%2!=0 and b==0:
    print((b//2)*a)
else:
    print(d*f+c*e)

Fixed submission:
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[int(input())-1])
Buggy python submission (verdict: Runtime Error):
a=input()
if a=='AAA'or'BBB':
  print(No)
else:
  print(Yes)

Fixed submission:
a=input()
if a=='AAA'or a=='BBB':
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=''
while a>len(d):
    d+='b'*b
    d+='r'*c
d=d[:a]
print(d)
print(d.count('b'))



Fixed submission:
a,b,c=map(int,input().split())
if a%(b+c)<=b:
  print((a//(b+c))*b+a%(b+c))
else:
  print((a//(b+c))*b+b)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=''
while a>len(d):
    d+='b'*b
    d+='r'*c
d=d[:a]
print(d)
print(d.count('b'))



Fixed submission:
a,b,c=map(int,input().split())
if a%(b+c)<=b:
  print((a//(b+c))*b+a%(b+c))
else:
  print((a//(b+c))*b+b)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a%(b+c)<=b:
  print(((a//b*c)*b)+a%(b+c))
elif b==0:
  print(0)
else:
  print(((a//b*c)*b)+a%(b+c))

Fixed submission:
a,b,c=map(int,input().split())
if a%(b+c)<=b:
  print((a//(b+c))*b+a%(b+c))
else:
  print((a//(b+c))*b+b)
Buggy python submission (verdict: Runtime Error):
print(sum(divmod(input(a),2)))

Fixed submission:
a=int(input())
print(sum(divmod(a,2)))

Buggy python submission (verdict: Runtime Error):
print(sum(divmod(input(a),2)))

Fixed submission:
a=int(input())
print(sum(divmod(a,2)))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=0
if a>b:
while a//b>=b:  
  a=a//b
  c+=1
print(c+2)
else:
    print(len(a))


Fixed submission:
a,b=map(int,input().split())
if a<10:
  print(b+(100*(10-a)))
else:
  print(b)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a=b=c or a!=b!=c:
  print('No')
else:
  print('Yes')


Fixed submission:
a,b,c=map(int,input().split())
if a==b!=c or a!=b==c or a==c!=b:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split())
c=[i for i in b if i%2==0]
d=len(c)
e=[j for j in c if i%3==0 or i%5==0]
f=len(e)
if d==f:
       print('APPROVED')
else:
       print('DENIED')

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
c=[i for i in b if i%2==0]
d=len(c)
e=[j for j in c if j%3==0 or j%5==0]
f=len(e)
if d==f:
       print('APPROVED')
else:
       print('DENIED')
Buggy python submission (verdict: Runtime Error):
a,b=map(str,input().split())
c.d=map(int,input().split())
e=str(input())
if a==e:
    print(c-1,d)
else:
    print(c,d-1)
 

Fixed submission:
a,b=map(str,input().split())
c,d=map(int,input().split())
e=str(input())
if a==e:
    print(c-1,d)
else:
    print(c,d-1)

Buggy python submission (verdict: Runtime Error):
a,b=map(str,input().split())
c.d=map(int,input().split())
e=input()
if a==e:
  print(c-1,d)
else:
  print(c,d-1)
 

Fixed submission:
a,b=map(str,input().split())
c,d=map(int,input().split())
e=str(input())
if a==e:
    print(c-1,d)
else:
    print(c,d-1)

Buggy python submission (verdict: Runtime Error):
a,b=map(str,input().split())
c.d=map(int,input().split())
e=input()
if c==e:
  print(c-1,d)
else:
  print(c,d-1)
 

Fixed submission:
a,b=map(str,input().split())
c,d=map(int,input().split())
e=str(input())
if a==e:
    print(c-1,d)
else:
    print(c,d-1)
Buggy python submission (verdict: Runtime Error):
def cumsum(xs):
    result = [xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result

a,b=map(int,input().split())
c=list(map(int,input().split()))

d=[]

c=[(i+1)/2 for i in c]
n=cumsum(c)
m=[]
for i in range(a-b):
    m.append(n[i+b]-n[i])


print(max(m))


Fixed submission:
def cumsum(xs):
    result = [xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result

a,b=map(int,input().split())
c=list(map(int,input().split()))

if a==b:
    print((sum(c)+a)/2)
    exit()

d=[]

c=[(i+1)/2 for i in c]
n=cumsum(c)

m=[]
for i in range(0,a-b):
    m.append(n[i+b]-n[i])


print(max(m))

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

d=[]
for i in range(a-b+1):
    d.append(sum(c[i:i+b]))

n=max(d)
print((n+b)/2)


Fixed submission:
def cumsum(xs):
    result = [xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result

a,b=map(int,input().split())
c=list(map(int,input().split()))

if a==b:
    print((sum(c)+a)/2)
    exit()

d=[]

c=[(i+1)/2 for i in c]
n=cumsum(c)

m=[]
for i in range(0,a-b):
    m.append(n[i+b]-n[i])


print(max(m))

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=list(map(int,input().split()))

d=[]
for i in range(a-b):
    d.append(sum(c[i:i+b]))

n=max(d)
print((n+b)/2)


Fixed submission:
def cumsum(xs):
    result = [xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result

a,b=map(int,input().split())
c=list(map(int,input().split()))

if a==b:
    print((sum(c)+a)/2)
    exit()

d=[]

c=[(i+1)/2 for i in c]
n=cumsum(c)

m=[]
for i in range(0,a-b):
    m.append(n[i+b]-n[i])


print(max(m))

Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=[]
for i in range(a-b+1):
    d.append(sum(c[i:i+b]))
n=max(d)
print((n+b)/2)

Fixed submission:
def cumsum(xs):
    result = [xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result

a,b=map(int,input().split())
c=list(map(int,input().split()))

if a==b:
    print((sum(c)+a)/2)
    exit()

d=[]

c=[(i+1)/2 for i in c]
n=cumsum(c)

m=[]
for i in range(0,a-b):
    m.append(n[i+b]-n[i])


print(max(m))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=[int(input()) for i in reange(b+1)]
if a<=sum(n):
  print('Yes')
else:
  print('No')

Fixed submission:
a,b=map(int,input().split())
n=list(map(int,input().split()))
if a<=sum(n):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a=input()
n=[chr(i) for i in range(97, 97+26)]
# [chr(i) for i in range(ord('a'), ord('z')+1)]
print(n[1+n.count(a)]


Fixed submission:
a=input()
n=[chr(i) for i in range(97, 97+26)]
# [chr(i) for i in range(ord('a'), ord('z')+1)]
print(n[1+n.index(a)])
Buggy python submission (verdict: Runtime Error):
import sympy as sym
a=int(input())
b=[]
while len(b)<2:
  for i in sym.primerange(a,10**5):
    b.append(i)
print(b[0])
  


Fixed submission:
import math
import bisect
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True
result=[]
a=int(input())
for i in range(a-500,a+501):
    if i<0:
        continue
    if is_prime(i):
        result.append(i)
bisect.insort_left(result,a)
n=bisect.bisect_left(result,a)
print(result[n+1])
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=[1,2,3]
n.remove(a)
n.remove(b)
print(n[0])

Fixed submission:
a=int(input())
b=int(input())
n=[1,2,3]
n.remove(a)
n.remove(b)
print(n[0])

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=[1,2,3]
n.remove(a)
n.remove(b)
print(n[0])

Fixed submission:
a=int(input())
b=int(input())
n=[1,2,3]
n.remove(a)
n.remove(b)
print(n[0])
Buggy python submission (verdict: Runtime Error):
a=input()
n=['SUN','MON','TUE','WED','THU','FRI','SAT']
if a!='SAT':
  print(n[6]-n.index(a))
else:
  print(7)

Fixed submission:
a=input()
n=['SUN','MON','TUE','WED','THU','FRI','SAT']
if a!='SAT':
  print(7-n.index(a))
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=input()
if b[0:a//2-1]==[a//2:a-1]:
  print('Yes')
else:
  print('No')

Fixed submission:
a=int(input())
b=input()
if b[0:a//2]==b[a//2:]:
  print('Yes')
else:
  print('No')