Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
for i in range(n,10**6):
  for j in range(2,int(math.sqrd(i**0.5))+1):
    if i%j==0:
      break
  else:
    print(i)
    break


Fixed submission:
n=int(input())
for i in range(n,10**6):
  for j in range(2,int(i**0.5)+1):
    if i%j==0:
      break
  else:
    print(i)
    break

Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==2:
    print(n)
else:
    cost=0
    for i in range(n,10**6):
        for j in range(2,int(i**0.5))+1):
            if i%j==0:
                cost+=1
        if cost==0:
            print(i)
            break

Fixed submission:
n=int(input())
for i in range(n,10**6):
  for j in range(2,int(i**0.5)+1):
    if i%j==0:
      break
  else:
    print(i)
    break

Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
if n==2:
    print(n)
else:
    cost=0
    for i in range(n,10**6):
        for j in range(2,int(math.sqrt(i))+1):
            if i%j==0:
                cost+=1
        if cost==0:
            print(i)
            break


Fixed submission:
n=int(input())
for i in range(n,10**6):
  for j in range(2,int(i**0.5)+1):
    if i%j==0:
      break
  else:
    print(i)
    break

Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
if n==2:
    print(n)
else:
    cost=0
    for i in range(n,10**6):
        for j in range(2,int(math.sqrt(i))+1):
            if i%j==0:
                cost+=1
        if cost==0:
            print(i)
            break


Fixed submission:
n=int(input())
for i in range(n,10**6):
  for j in range(2,int(i**0.5)+1):
    if i%j==0:
      break
  else:
    print(i)
    break

Buggy python submission (verdict: Runtime Error):
from sympy import nextprime
n=int(input())
print(nextprime(n))

Fixed submission:
n=int(input())
for i in range(n,10**6):
  for j in range(2,int(i**0.5)+1):
    if i%j==0:
      break
  else:
    print(i)
    break

Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(n,10**5):
  for j in range(2,10*5):
	if i%j==0:
      print(i)
      quit()

Fixed submission:
n=int(input())
for i in range(n,10**6):
  for j in range(2,int(i**0.5)+1):
    if i%j==0:
      break
  else:
    print(i)
    break
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=n/1.08
nn=x*1.08
if n<=nn<n+1:
    if x*10%10>=5:    
		print(int(x)+1)
    else:
        print(int(x))
else:
  print(":(")


Fixed submission:
import math
n=int(input())
xc=math.ceil(n/1.08)
nn=xc*1.08
if math.floor(nn)==n:    
	print(xc)
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
ans=1
bb=b-a
while bb=>0:
  bb=bb-(a-1)
  ans+=1
print(ans)

Fixed submission:
a,b=map(int,input().split())
if b==1:
	print(0)
else:
	ans=1
	bb=b-a
	while bb>0:
  		bb=bb-(a-1)
  		ans+=1
	print(ans)

Buggy python submission (verdict: Runtime Error):
a,b=int(input().split())
ans=1
bb=b-a
while bb>0:
  bb=bb-(a-1)
  ans+=1
print(ans)

Fixed submission:
a,b=map(int,input().split())
if b==1:
	print(0)
else:
	ans=1
	bb=b-a
	while bb>0:
  		bb=bb-(a-1)
  		ans+=1
	print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
v=list(map(int,input().split()))
v.sort(key=int)
for i in range(n-1):
  z=(v[i]+v[i+1])/2
  v[i]=z
  v[i+1]=z
print(v[n])

Fixed submission:
n=int(input())
v=list(map(int,input().split()))
v.sort(key=int)
for i in range(n-1):
  z=(v[i]+v[i+1])/2
  v[i]=z
  v[i+1]=z
print(v[n-1])
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=list(map(int,input().split()))
ar=a.sort(reverse=True,key=int)
ans=0
for i in range(n):
  x-=ar[i]
  if x<0:
    x+=ar[i]
  else:
    ans+=1
print(ans)
  

Fixed submission:
n,x=map(int,input().split())
a=list(map(int,input().split()))
a.sort(key=int)
ans=0
for i in range(n):
  x=x-a[i]
  if x<0:
    x=x+a[i]
  else:
    ans+=1
if ans==n:
    if x>0:
        print(ans-1)
    else:
        print(ans)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.reverse(key=int)
Ali=0
Bob=0
for i in range(n):
	if i%2==0:
       Ali+=a[i]
	else:
       Bob+=a[i]
ans(Ali-Bob)
       

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
aa=sorted(a,key=int,reverse=True)
Ali=0
Bob=0
for i in range(n):
	if i%2==0:
	    Ali+=aa[i]
	else:
	    Bob+=aa[i]
print(Ali-Bob)
Buggy python submission (verdict: Runtime Error):
a,b=input()
ab=int("a"+"b")
ans=0
for i in range(350):
	if int(ab**(1/2))==i:
      print("Yes")
      ans+=1
      quit()
if ans==0:
  print("No")
    

Fixed submission:
a,b=input().split()
ab=int(a+b)
ans=0
for i in range(350):
	if ab**(1/2)==i:
	    print("Yes")
	    ans+=1
	    quit()
if ans==0:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
k=int(input())
x=list(map(int,input().split())
ans=0
for i in range (n):
	if abs(x[i])>abs(x[i]-k):
		ans+=abs(x[i]-k)*2
    else:
       ans+=x[i]*2
print(ans)

Fixed submission:
n=int(input())
k=int(input())
x=list(map(int,input().split()))
ans=0
for i in range (n):
    if abs(x[i])>abs(x[i]-k):
	    ans+=abs(x[i]-k)*2
    else:
        ans+=x[i]*2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def func(n):
    cnt = 0
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x**2+y**2+z**2+x*y+y*z+z*x == n:
                    cnt += 1
    return(cnt)

n = int(input())
for i in range(1, n+1):
    print(func(i))



Fixed submission:
n = int(input())
cont = [0 for i in range(10050)]

for x in range(1,105):
  for y in range(1,105):
    for z in range(1,105):
      v = x**2 + y**2 + z**2 + z*x + y*z + x*y
      if v <= 10001:
        cont[v]+=1

for i in range(1,n+1):
  print(cont[i])
Buggy python submission (verdict: Runtime Error):
d = int(input())
c = list(map(int, input().split()))
for i in range(d):
    s = list(map(int, input().split()))
    num = max(s)
    print(l.index(num)+1)

Fixed submission:
d = int(input())
c = list(map(int, input().split()))
for i in range(d):
    s = list(map(int, input().split()))
    num = max(s)
    print(s.index(num)+1)
Buggy python submission (verdict: Runtime Error):
import itertools 
x = int(input())
list_ = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "y", "w", "z" ]
len(list_)
kara = []
if x >= 1 and x <= 26 :
    ans = 0
    for i in itertools.product(list_, repeat = 1):
        ans += 1
        if ans == n:
            print(*i, sep = '')
elif 27<=x and x<= 702:
    ans = 26
    for i in itertools.product(list_, repeat = 2):
        ans += 1
        if ans == n:
            print(*i, sep = '')
elif 703<=x and x<=18278:
    ans = 702
    for i in itertools.product(list_, repeat = 3):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 475254:
    ans = 18278
    for i in itertools.product(list_, repeat = 4):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 12356630:
    ans =475254
    for i in itertools.product(list_, repeat = 5):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 321272406:
    ans = 12356630
    for i in itertools.product(list_, repeat = 6):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 8353082582:
    ans = 321272406
    for i in itertools.product(list_, repeat = 7):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 217180147158:
    ans = 8353082582
    for i in itertools.product(list_, repeat = 8):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 5646683826134:
    ans = 217180147158
    for i in itertools.product(list_, repeat = 9):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 146813779479510:
    ans = 5646683826134
    for i in itertools.product(list_, repeat = 10):
        ans += 1
        if ans == n:
            print(*i, sep='')
elif x <= 3817158266467286:
    ans = 5646683826134
    for i in itertools.product(list_, repeat = 11):
        ans += 1
        if ans == n:
            print(*i, sep='')

Fixed submission:
n = int(input())
n -= 1
for i in range(1, 15):
    if n >= 26**i :
        n -= 26**i
        continue 
    ans = ""
    for j in range(i):
        d = n % 26
        ans += chr(ord("a")+d)
        n //= 26
    ans = ans[::-1]
    break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input()
q = int(input())
for i in range(q):
    b, c = map(str, input().split())
    A = a.replace(b, c)    
    ans = 0
    s = "0"
    for j in list(A):
        if j != " ":
            s += j
        else :
            ans += int(s[1:])
            s = "0"
    ans += int(s[1:])
    print(ans)
    a = A
    


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
l = [0]*(10**5+1)
all_sum = sum(a)
for i in a:
    l[i] += 1
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    cnt = l[b]
    l[c] += cnt 
    all_sum += cnt * (c-b)
    l[b] = 0
    print(all_sum)
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
ans = reduce(mul, a)
print(ans if ans <= 10**18 else -1)


Fixed submission:
n = input()
a = list(map(int, input().split()))
if 0 in a:
  print(0)
  exit()
ans = 1
for x in a:
  ans *= x
  if ans > 10**18:
    print(-1)
    exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = sorted(list(map(int, input().split())), reverse = True)
ans = 1
for i in a:
    ans *= i
print(ans if ans <= 10**18 else -1)


Fixed submission:
n = input()
a = list(map(int, input().split()))
if 0 in a:
  print(0)
  exit()
ans = 1
for x in a:
  ans *= x
  if ans > 10**18:
    print(-1)
    exit()
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
ans = np.prod(a)
if ans > 10**18:
    print(-1)
else :
    print(ans)


Fixed submission:
n = input()
a = list(map(int, input().split()))
if 0 in a:
  print(0)
  exit()
ans = 1
for x in a:
  ans *= x
  if ans > 10**18:
    print(-1)
    exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from operator import add, mul
n = map(int, input().split())
a = list(map(int, input().split()))
ans = reduce(mul, a)
if ans > 10**18:
    print(-1)
else :
    print(ans)


Fixed submission:
n = input()
a = list(map(int, input().split()))
if 0 in a:
  print(0)
  exit()
ans = 1
for x in a:
  ans *= x
  if ans > 10**18:
    print(-1)
    exit()
print(ans)

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


Fixed submission:
n = input()
a = list(map(int, input().split()))
if 0 in a:
  print(0)
  exit()
ans = 1
for x in a:
  ans *= x
  if ans > 10**18:
    print(-1)
    exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
b.replace(".", "")
a = int(a)
b = int(b)
print(a*b//100)


Fixed submission:
a, b = input().split()
b = int(b.replace(".", ""))
a = int(a)
print(a*b//100)
Buggy python submission (verdict: Runtime Error):
n=int(input())
cnt=0
for i in range(2,int(n**0.5)+2):
    if n%i==0:
        expo=0
    while n%i==0:
        n//=i
        expo+=1
    j=1
    while expo-j>=0:
        cnt+=1
        expo-=j
        j+=1
if n>1:
    cnt+=1
print(cnt)


Fixed submission:
n=int(input())
cnt=0
for i in range(2,int(n**0.5)+2):
    if n%i==0:
        expo=0
        while n%i==0:
            n//=i
            expo+=1
        j=1
        while expo-j>=0:
            cnt+=1
            expo-=j
            j+=1
if n>1:
    cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
cnt=0
for i in range(2,int(n**0.5)+2):
    if n%i==0:
        expo=0
    while n%i==0:
        n//=i
        expo+=1
        j=1
    while expo-j>=0:
        cnt+=1
        expo-=j
        j+=1
if n>1:
	cnt+=1
print(cnt)


Fixed submission:
n=int(input())
cnt=0
for i in range(2,int(n**0.5)+2):
    if n%i==0:
        expo=0
        while n%i==0:
            n//=i
            expo+=1
        j=1
        while expo-j>=0:
            cnt+=1
            expo-=j
            j+=1
if n>1:
    cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
ans = 0
for i in range(n, 0, -1):
    value = (a*i//b) - a*(i//b)
    ans = max(value, ans)
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
x = min(b-1, n)
print(a*x//b - a*(x//b))

Buggy python submission (verdict: Time Limit Exceeded):
a, b, n = map(int, input().split())
ans = 0
for i in range(n, 0, -1):
    value = (a*i//b) - a*(i//b)
    ans = max(value, ans)
print(ans)

Fixed submission:
a, b, n = map(int, input().split())
x = min(b-1, n)
print(a*x//b - a*(x//b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
l = [0]*n
for i in range(n-1):
    j = A[i]
    l[j-1] += 1
for i in range(n):
    print(l[i])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
l = [0]*n
for i in range(n-1):
    j = a[i]
    l[j-1] += 1
for i in range(n):
    print(l[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(1, n+1):
    j = a.count(i)
    if j != 0:
        b[i-1] = j
for i in b:
    print(i)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
l = [0]*n
for i in range(n-1):
    j = a[i]
    l[j-1] += 1
for i in range(n):
    print(l[i])

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

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
l = [0]*n
for i in range(n-1):
    j = a[i]
    l[j-1] += 1
for i in range(n):
    print(l[i])
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
cnt = 0
import math
for i in range(1, k+1):
    for j in range(1, k+1):
        for n in range(1, k+1):
            m = math.gcd(i, j)
            cnt += math.gcd(m, n)
            
print(cnt)

Fixed submission:
k = int(input())
cnt = 0
import math
for i in range(1, k+1):
    for j in range(1, k+1):
        for n in range(1, k+1):
            m = math.gcd(i, j)
            cnt += math.gcd(m, n)
            
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r*g*b
for i in range(n-2):
    for j in range(i+1, n-1):
        k = 2j - i
        if k >= n:
            break 
        if s[i]!=s[j] and s[k]!= s[i] and s[j]!=s[k]:
            ans -= 1
print(ans)


Fixed submission:
n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r*g*b
for i in range(n-2):
    for j in range(i+1, n-1):
        k = 2*j - i
        if k >= n:
            break 
        if s[i]!=s[j] and s[k]!= s[i] and s[j]!=s[k]:
            ans -= 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
cnt = 0
for i in range(0, n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if s[i]!=s[j] and s[j]!=s[k] and s[i]!=s[k] and j-i!=k-j:
                cnt += 1
                
print(cnt)

Fixed submission:
n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r*g*b
for i in range(n-2):
    for j in range(i+1, n-1):
        k = 2*j - i
        if k >= n:
            break 
        if s[i]!=s[j] and s[k]!= s[i] and s[j]!=s[k]:
            ans -= 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
cnt = 0
for i in range(0, n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if s[i]!=s[j] and s[j]!=s[k] and s[i]!=s[k] and j-i!=k-j:
                cnt += 1
                
print(cnt)

Fixed submission:
n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r*g*b
for i in range(n-2):
    for j in range(i+1, n-1):
        k = 2*j - i
        if k >= n:
            break 
        if s[i]!=s[j] and s[k]!= s[i] and s[j]!=s[k]:
            ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
ans = 'Yes'
for i in range(0, n, 2):
    if s[i] != 'h':
        ans = 'No'
for j in range(1, n+1, 2):
    if s[j] != 'i':
        ans = 'No'
print(ans)

Fixed submission:
s = input()
if len(s)%2 == 0 and s == 'hi' * (len(s)//2):
    print('Yes')
else :
    print('No')
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
blue='c'*a
red='r'*b
s = str(blue+red)*(100*1000)
ss=s[:n]
print(ss.count('r'))

Fixed submission:
n, a, b = map(int, input().split())
c = n//(a+b)
ans = c*a+min(n%(a+b), a)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
blue='b'*a
red='r'*b
s = str(blue+red)*100
print(s.count('b', 0, n))

Fixed submission:
n, a, b = map(int, input().split())
c = n//(a+b)
ans = c*a+min(n%(a+b), a)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
blue='b'*a
red='r'*b
s = str(blue+red)*100
ss=s[:n]
print(ss.count('b'))

Fixed submission:
n, a, b = map(int, input().split())
c = n//(a+b)
ans = c*a+min(n%(a+b), a)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
blue='b'*a
red='r'*b
s = str(blue+red)*n
ss=s[:n]
print(ss.count('b'))

Fixed submission:
n, a, b = map(int, input().split())
c = n//(a+b)
ans = c*a+min(n%(a+b), a)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
blue='b'*a
red='r'*b
s = str((blue+red)*n)[:n]
print(s.count('b'))

Fixed submission:
n, a, b = map(int, input().split())
c = n//(a+b)
ans = c*a+min(n%(a+b), a)
print(ans)
Buggy python submission (verdict: Runtime Error):
a11, a12, a13 = map(int, input().split())
a21, a22, a23 = map(int, input().split())
a31, a32, a33 = map(int, input().split())
n = int(input())
l = [int(input()) for i in range(n)]
if (a11 and a12 and a13 in l) or (a21 and a22 and a23 in l) or (a31 and a32 and a33 in l) or (a11 and a21 and a31 in l) or (a22 and a12 and a32 in l) or (a13 and a23 and a33 in l) or (a11 and a22 and a33 in l) or (elif a13 and a22 and a31 in l):
    print('Yes')
else :
    print('No')

Fixed submission:
A=[]
flag=0
for i in range(3):
  A.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  s=int(input())
  for k in range(3):
    if s in A[k]:
      A[k][A[k].index(s)]=0

if A[0]==[0,0,0] or A[1]==[0,0,0] or A[2]==[0,0,0]:
  print("Yes")
  flag=1
elif A[1][1]==0 and A[2][2]==0 and A[0][0]==0:
  print("Yes")
  flag=1
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  flag=1
else:
  for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
      print("Yes")
      flag=1
      break
if flag == 0:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(n-1):
  if a[i]==a[i+1]:
    print("NO")
    break
print("YES")


Fixed submission:
s, t = input().split()
a, b = map(int, input().split())
u = input()
if u == s :
    print(a-1, b)
else :
    print(a, b-1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
ls = []
a = 0
for i in l:
    if i not in ls :
        ls.append(i)
        a += 1
    else :
        print('NO')
        break
if a == len(l):
    print('YES')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(n-1):
  if a[i]==a[i+1]:
    print("NO")
    exit()
print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
ls = []
a = 0
for i in l:
    if i not in ls :
        ls.append(i)
        a += 1
    else :
        print('NO')
        break
if a == len(l):
    print('YES')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(n-1):
  if a[i]==a[i+1]:
    print("NO")
    exit()
print("YES")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp_list = []
for i in p:
    expect = (i+1)/2
    exp_list.append(expect)
s = sum(exp_list[0:k])
ans = s
for j in range(n-k):
    s -= s[j]
    s += s[j+k]
    if s > ans :
        ans = s
print(ans)


Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp_list = []
for i in p:
    expect = (i+1)/2
    exp_list.append(expect)
s = sum(exp_list[0:k])
ans = s
for j in range(n-k):
    s -= exp_list[j]
    s += exp_list[j+k]
    if s > ans :
        ans = s
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp_list = []
for i in p:
    expect = (i+1)/2
    exp_list.append(expect)
answer = 0
for j in range(n-k+1):
    ans = 0
    for l in range(j, j+k):
        ans += exp_list[l]
    answer = max(answer, ans)
print(answer)


Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp_list = []
for i in p:
    expect = (i+1)/2
    exp_list.append(expect)
s = sum(exp_list[0:k])
ans = s
for j in range(n-k):
    s -= exp_list[j]
    s += exp_list[j+k]
    if s > ans :
        ans = s
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp_list = []
for i in p:
    prob = 1/i
    expect = 0
    for j in range(1, i+1):
        expect += j * prob 
    exp_list.append(expect)
answer = 0
for j in range(n-k+1):
    ans = 0
    for l in range(j, j+k):
        ans += exp_list[l]
    answer = max(answer, ans)
print(answer)



Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp_list = []
for i in p:
    expect = (i+1)/2
    exp_list.append(expect)
s = sum(exp_list[0:k])
ans = s
for j in range(n-k):
    s -= exp_list[j]
    s += exp_list[j+k]
    if s > ans :
        ans = s
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp_list = []
for i in p:
    prob = 1/i
    expect = 0
    for j in range(1, i+1):
        expect += j * prob 
    exp_list.append(expect)
answer = 0
for j in range(n-k+1):
    ans = 0
    for l in range(j, j+k):
        ans += exp_list[l]
    answer = max(answer, ans)
print(answer)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
exp_list = []
for i in p:
    expect = (i+1)/2
    exp_list.append(expect)
s = sum(exp_list[0:k])
ans = s
for j in range(n-k):
    s -= exp_list[j]
    s += exp_list[j+k]
    if s > ans :
        ans = s
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import deque 
import math
n, d, a = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(n)]
l.sort(key = lambda x:x[0])
cnt = 0
queue = deque()
sum_bomb = 0
for i in range(n):
    while len(queue) != 0 and queue[0][0]<l[i][0]:
        sum_bomb -= queue[0][1] * a
        queue.popleft()
    l[i][1] -= sum_bomb
    if l[i][1] <= 0 :
        continue
    num = math.ceil(l[i][1]/a)
    right = l[i][0] + 2 * d
    queue.append([right, num])
    cnt += num
    sum_bomb += num * a
print(cnt)


Fixed submission:
h, a = map(int, input().split())
print(h//a+1 if h%a!=0 else h//a)