Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    x, n = map(int, input().split())
    p = list(map(int, input().split()))

    min = 1000

    for i in range(1, 101):

        if i in p:
            continue

        elif min > abs(x - i):
            result = i
            min = abs(x - i)

    print(result)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    x, n = map(int, input().split())
    p = list(map(int, input().split()))

    min = 1000

    for i in range(-50, 150):

        if i in p:
            continue

        elif min > abs(x - i):
            result = i
            min = abs(x - i)

    print(result)


if __name__ == "__main__":
    main()

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

    min = 1000

    for i in range(1, 101):

        if i in p:
            continue

        elif min > abs(x - i):
            result = i
            min = abs(x - i)

    print(result)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    x, n = map(int, input().split())
    p = list(map(int, input().split()))

    min = 1000

    for i in range(-50, 150):

        if i in p:
            continue

        elif min > abs(x - i):
            result = i
            min = abs(x - i)

    print(result)


if __name__ == "__main__":
    main()

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

    min = 100000

    for i in range(1, 101):

        if i in p:
            continue

        if min > abs(x - i):
            result = i
            min = x - i

    print(result)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    x, n = map(int, input().split())
    p = list(map(int, input().split()))

    min = 1000

    for i in range(-50, 150):

        if i in p:
            continue

        elif min > abs(x - i):
            result = i
            min = abs(x - i)

    print(result)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):

def main():

    MAX_VALUE = 10**6 + 5

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

    cnt = [0] * MAX_VALUE

    ans = 0

    for x in a:

        for i in range(x, MAX_VALUE, x):
            cnt[i] += 1

    for x in a:
        if cnt[x] == 1:
            ans += 1 

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:

def main():

    MAX_VALUE = 10**6 + 5

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

    cnt = [0] * MAX_VALUE

    ans = 0

    for x in a:

        if cnt[x] != 0:
            cnt[x] = 2
            continue

        for i in range(x, MAX_VALUE, x):
            cnt[i]+=1

    for x in a:
        if cnt[x] == 1:
            ans += 1 

    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = list(map(int, input().split()) for _ in range(N))

    for e in A:
        if e % 2 == 0 and e % 3 != 0 and e % 5 != 0:
            print("DENIED")
            exit(0)

    print("APPROVED")


if __name__ == "__main__":
    main()


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

    even = []

    for e in A:
        if e % 2 == 0:
            even.append(e)


    for e in even:
        if e % 3 != 0 and e % 5 != 0:
            print("DENIED")
            exit(0)

    print("APPROVED")


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():

    A, B, K = map(int, input().split())

    for i in range(K):
        if A >= 1:
            A -= 1
        elif B >= 1:
            B -= 1

    print(str(A) + " " + str(B))


if __name__ == "__main__":
    main()


Fixed submission:
def main():

    A, B, K = map(int, input().split())

    if A > K:
        A -= K
    else:

        K -= A
        A = 0
        B -= K
        if B <= 0:
            print("0 0")
            exit(0)

    print(str(A) + " " + str(B))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
List=list(map(int,input().split()))

pro=1
for i in range(n):
    pro *=List[i]

if pro > 10**18 :
    print("-1")
else:
    print(pro)

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

pro=1
List.sort()
for i in range(n):
    pro *=List[i]
    if pro > 10**18 :
        print("-1")
        exit()

print(pro)
Buggy python submission (verdict: Time Limit Exceeded):
def calc(n):
    A=[]
    while n%2==0:
        n//=2
        A.append(2)
    x=3
    while n!=1:
        if n%x==0:
            n//=x
            A.append(x)
        else:
            x +=2
    return A

number=int(input())
consequence=calc(number)
c=list(set(consequence))

ans=0

for i in range(len(c)):
    Count=consequence.count(c[i])
    d=f=1
    while Count >= d:
        f +=1
        d +=f
        ans +=1

print(ans)

Fixed submission:
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

number=int(input())
consequence=factorize(number)
c=list(set(consequence))

ans=0

for i in range(len(c)):
    Count=consequence.count(c[i])
    d=f=1
    while Count >= d:
        f +=1
        d +=f
        ans +=1

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

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
count=[0]*n
for i in a:
    count[i-1]+=1
for j in count:
    print(j)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=list(map(int,input().split()))
required=sum(c)/(4*b)
count=0
for d in ｃ:
    if d>=required:
        count+=1
    else:
        break
print("YNeos"[count<b::2])

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

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=list(map(int,input().split()))
required=sum(c)/(4*b)
count=0
for d in sorted(c,reverse=True):
  if d>=required:
      count+=1
  else:
      break
print("YNeos"[count<b::2])

Fixed submission:
a,b,c=map(int,input().split())
print(c,a,b)
Buggy python submission (verdict: Runtime Error):
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    try:
        break

if f >= c:
    print("Yes")
else :
    print("No")

Fixed submission:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    if -e>b:
        break

if f >= c:
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    try:
        continue

if f >= c:
    print("Yes")
else :
    print("No")

Fixed submission:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    if -e>b:
        break

if f >= c:
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1

if f >= c:
    print("Yes")
else :
    print("No")

Fixed submission:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    if -e>b:
        break

if f >= c:
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c
while new_a[e] >= d/g:
    e=e-1
    f=f+1
if f >= c:
    print("Yes")
else :
    print("No")

Fixed submission:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    if -e>b:
        break

if f >= c:
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c
while new_a[e] >= d/g:
    e=e-1
    f=f+1
if f = c:
    print("Yes")
else :
    print("No")

Fixed submission:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    if -e>b:
        break

if f >= c:
    print("Yes")
else :
    print("No")

Buggy python submission (verdict: Runtime Error):
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c
while new_a[e] >= d/g:
    e=e-1
    f=f+1
if f >= c:
    print("Yes")
else :
    print("No")

Fixed submission:
b,c=map(int,input().split())
a=list(map(int,input().split()))
d=sum(a)
new_a=sorted(a)
e=-1
f=0
g=4*c

while new_a[e] >= d/g:
    e=e-1
    f=f+1
    if -e>b:
        break

if f >= c:
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Runtime Error):
number=int(input())
print(number//2 if number%2==0 (number//2)+1 else number%2==1)

Fixed submission:
number=int(input())
print(number//2 if number%2==0 else (number//2)+1)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
import math

num = int(input())
sum = 0

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

for a in range(1, num + 1):
  for b in range(1, num + 1):
    for c in range(1, num + 1):
      sum += gcd(a, b, c)

print(sum)

Fixed submission:
import math

num = int(input())
sum = 0

for a in range(1, num + 1):
  for b in range(1, num + 1):
    gcd_ab = math.gcd(a, b)
    for c in range(1, num + 1):
      sum += math.gcd(gcd_ab, c)

print(sum)

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

num = int(input())
a = 1
sum = 0

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

def loopC(a, b, num):
  sum = 0
  for c in range(1, num + 1):
      ans = gcd(a, b, c)
      sum += ans
  return sum

def loopB(a, num):
  sum = 0
  for b in range(1, num + 1):
    ans = loopC(a, b, num)
    sum += ans
  return sum

for a in range(1, num + 1):
  ans = loopB(a, num)
  sum += ans

print(sum)

Fixed submission:
import math

num = int(input())
sum = 0

for a in range(1, num + 1):
  for b in range(1, num + 1):
    gcd_ab = math.gcd(a, b)
    for c in range(1, num + 1):
      sum += math.gcd(gcd_ab, c)

print(sum)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

num = int(input())
a = 1
sum = 0

def gcd(a, b, c):
  num = np.array([a, b, c])
  return np.gcd(np.gcd.reduce(num))

def loopC(a, b, num):
  c = 1
  sum = 0
  while c <= num:
      ans = gcd(a, b, c)
      sum += ans
      c += 1
  return sum

def loopB(a, num):
  b = 1
  sum = 0
  while b <= num:
    ans = loopC(a, b, num)
    b += 1
    sum += ans
  return sum

while a <= num:
  ans = loopB(a, num)
  sum += ans
  a += 1

print(sum)

Fixed submission:
import math

num = int(input())
sum = 0

for a in range(1, num + 1):
  for b in range(1, num + 1):
    gcd_ab = math.gcd(a, b)
    for c in range(1, num + 1):
      sum += math.gcd(gcd_ab, c)

print(sum)

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

num = int(input())
a = 1
sum = 0

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

def loopC(a, b, num):
  c = 1
  sum = 0
  while c <= num:
      ans = gcd(a, b, c)
      # print(a, b, c, ans)
      sum += ans
      c += 1
  return sum

def loopB(a, num):
  b = 1
  sum = 0
  while b <= num:
    ans = loopC(a, b, num)
    b += 1
    sum += ans
  return sum

while a <= num:
  ans = loopB(a, num)
  sum += ans
  a += 1

print(sum)

Fixed submission:
import math

num = int(input())
sum = 0

for a in range(1, num + 1):
  for b in range(1, num + 1):
    gcd_ab = math.gcd(a, b)
    for c in range(1, num + 1):
      sum += math.gcd(gcd_ab, c)

print(sum)
Buggy python submission (verdict: Runtime Error):
num = list(map(int, input().split()))

grid = []
del_i = []
del_n = []

for i in range(num[0]):
  grid.append(list(input()))

  if "#" in grid[i] and "." in grid[i]:
    continue
  else:
    del_i.append(i)

check_1, check_2 = 0, 0

for n in range(num[1]):
  check_1, check_2 = 0, 0
  for i in range(num[0]):
    if grid[i][n] == "#":
      check_1 += 1
      if check_2 > 0:
        break
      if check_1 == num[0]:
        del_n.append(n)
    else:
      check_2 += 1
      if check_1 > 0:
        break
      if check_2 == num[0]:
        del_n.append(n)

for i in range(num[0]):
  if i in del_i:
    continue
  else:
    for n in del_n:
      del grid[i][n]
    print(''.join(grid[i]))

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

grid = []
del_i = []
del_n = []

for i in range(num[0]):
  grid.append(list(input()))

  if "#" in grid[i] and "." in grid[i]:
    continue
  elif "#" in grid[i]:
    continue
  else:
    del_i.append(i)

check_1, check_2 = 0, 0

for n in range(num[1]):
  check_1, check_2 = 0, 0
  for i in range(num[0]):
    if grid[i][n] == "#":
      check_1 += 1
      if check_2 > 0:
        break
      # if check_1 == num[0]:
      #   del_n.append(n)
    else:
      check_2 += 1
      if check_1 > 0:
        break
      if check_2 == num[0]:
        del_n.append(n)

for i in range(num[0]):
  if i in del_i:
    continue
  else:
    m = 0
    for n in del_n:
      n = n - m
      del grid[i][n]
      m += 1
    print(''.join(grid[i]))

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

grid = []
del_i = []
del_n = []

for i in range(num[0]):
  grid.append(list(input()))

  if "#" in grid[i] and "." in grid[i]:
    continue
  else:
    del_i.append(i)

check_1, check_2 = 0, 0

for n in range(num[1]):
  check_1, check_2 = 0, 0
  for i in range(num[0]):
    if grid[i][n] == "#":
      check_1 += 1
      if check_2 > 0:
        break
      if check_1 == num[0]:
        del_n.append(n)
    else:
      check_2 += 1
      if check_1 > 0:
        break
      if check_2 == num[0]:
        del_n.append(n)

for i in range(num[0]):
  if i in del_i:
    continue
  else:
    for n in del_n:
      del grid[i][n]
      print(''.join(grid[i]))

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

grid = []
del_i = []
del_n = []

for i in range(num[0]):
  grid.append(list(input()))

  if "#" in grid[i] and "." in grid[i]:
    continue
  elif "#" in grid[i]:
    continue
  else:
    del_i.append(i)

check_1, check_2 = 0, 0

for n in range(num[1]):
  check_1, check_2 = 0, 0
  for i in range(num[0]):
    if grid[i][n] == "#":
      check_1 += 1
      if check_2 > 0:
        break
      # if check_1 == num[0]:
      #   del_n.append(n)
    else:
      check_2 += 1
      if check_1 > 0:
        break
      if check_2 == num[0]:
        del_n.append(n)

for i in range(num[0]):
  if i in del_i:
    continue
  else:
    m = 0
    for n in del_n:
      n = n - m
      del grid[i][n]
      m += 1
    print(''.join(grid[i]))
Buggy python submission (verdict: Runtime Error):
import numpy as np

x,n = [int(i) for i in input().split()]
if n >0:
  table = [int(i) for i in input().split()]
  min = min(table)
  b = table
  a = np.array(table)
  a = a - x
  a = np.abs(a)
  a = np.sort(a)
    #print(a)

  for i in range(n):
    if a[0] > 0:
      print(x)
      break
    elif a[i+1]-a[i]>1 and i < n:
      if i == 0:
        if x-a[i]-1 in b or x-a[i]-1 < min:
          print(x+a[i]+1)
          break
        else:
          print(x-a[i]-1)
          break
      elif i > 0 and a[i] == a[i-1]:
        if x-a[i]-1 in b or x-a[i]-1 < min:
          print(x+a[i]+1)
          break
        else:
          print(x-a[i]-1)
          break
      else:
        if x-a[i] in b or x-a[i] < min:
          print(x+a[i])
          break
        else:
          print(x+a[i])
          break
else:
  print(x)


      
    




Fixed submission:
def main():
  x,n = [int(i) for i in input().split()]
  table = list(map(int, input().split()))
  
  for i in range(101):
    if x - i not in table:
      print(x-i)
      exit()
    elif x + i not in table:
      print(x+i)
      exit()
    	
if __name__ == "__main__":
  main()

Buggy python submission (verdict: Runtime Error):
import numpy as np

x,n = [int(i) for i in input().split()]
table = [int(i) for i in input().split()]
table.sort()
min = min(table)

a = np.array(table)
a = a - x
a = np.abs(a)
a = np.sort(a)
#print(a)

for i in range(n):
  if a[0] > 0:
    print(x)
    break
  elif a[i+1]-a[i]>1 and i>0:
    if a[i] > 0 and a[i] == a[i-1]:
      if x-a[i]-1 in b or x-a[i]-1 < min:
        print(x+a[i]+1)
        break
      else:
        print(x-a[i]-1)
        break
    else:
      if x-a[i] in b or x-a[i] < min:
        print(x+a[i])
        break
      else:
        print(x+a[i])
        break
      
    




Fixed submission:
def main():
  x,n = [int(i) for i in input().split()]
  table = list(map(int, input().split()))
  
  for i in range(101):
    if x - i not in table:
      print(x-i)
      exit()
    elif x + i not in table:
      print(x+i)
      exit()
    	
if __name__ == "__main__":
  main()
Buggy python submission (verdict: Runtime Error):
t = list(input())
 
i = 0
for i in len(t):
  if t[i] == '?':
    t[i] == 'D'
    
print(t)

Fixed submission:
t = list(input())
 

for i in range(len(t)):
  if t[i] == '?':
    t[i] = 'D'
    i +=1

t = ''.join(t)
# out = []
# for i in range(len(t)):
#   out += t[i]

print(t)

Buggy python submission (verdict: Runtime Error):
t = list(input())

i = 0
for i in size(t):
  if t[i] == '?':
    t[i] == 'D'
    
print(t)
  

Fixed submission:
t = list(input())
 

for i in range(len(t)):
  if t[i] == '?':
    t[i] = 'D'
    i +=1

t = ''.join(t)
# out = []
# for i in range(len(t)):
#   out += t[i]

print(t)
Buggy python submission (verdict: Time Limit Exceeded):
def CalAbs(a, b):
    sol=a-b
    if sol<0:
        sol=sol*(-1)
    return sol

input_line = input().split(" ")
N=int(input_line[0])
K=int(input_line[1])

rec=10**18+1
i=0

while i<10**19:
    if rec>N:
        rec=N
    N=CalAbs(N,K)
    i=i+1
print(rec)


Fixed submission:
#絶対値を求める関数
def CalAbs(a, b):
    sol=a-b
    if sol<0:
        sol=sol*(-1)
    return sol
    
#桁数を求める関数    
def CalDigi(a):    
    digi=1
    flag=0
    while flag==0:
        a=a/10
        if a>=1:
            digi=digi+1
        else:
            flag=1
    return digi
    
#標準入力
input_line = input().split(" ")
N=int(input_line[0])
K=int(input_line[1])

rec=10**18+1

#Nが大きすぎる時、Kの倍数でそぎ落とす
N=N%K+K


i=0
times=100
count=0
while i<=times:
    if rec>N:
        rec=N
    N=CalAbs(N,K)
    if i==times:
     lastN=N
    i=i+1
if rec>N:
    rec=N
    

    

print(rec)
Buggy python submission (verdict: Runtime Error):
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")
cumsum=[0]
tol=0
for i in range(N):
    P[i]=(int(P[i])+1)/2
    tol=tol+P[i]
    cumsum.append(tol)
    
k_sum=[]

for i in range(K):
  k_sum.append(cumsum[i+K]-cumsum[i])  

ans=max(k_sum)
print(ans)

Fixed submission:
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")
cumsum=[0]
tol=0
for i in range(N):
    P[i]=(int(P[i])+1)/2
    tol=tol+P[i]
    cumsum.append(tol)
    
k_sum=[]

for i in range(N-K+1):
  k_sum.append(cumsum[i+K]-cumsum[i])  

ans=max(k_sum)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")

for i in range(N):
    P[i]=int(P[i])

new_total_box=[]
for j in range(N-K+1):
    total=0
    for i in range(j,K+j):
        total=total+P[i]+1
    new_total_box.append(total)
    
max_value = max(new_total_box)


sol=max_value/2
    
print(sol)
    

Fixed submission:
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")
cumsum=[0]
tol=0
for i in range(N):
    P[i]=(int(P[i])+1)/2
    tol=tol+P[i]
    cumsum.append(tol)
    
k_sum=[]

for i in range(N-K+1):
  k_sum.append(cumsum[i+K]-cumsum[i])  

ans=max(k_sum)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")

for i in range(N):
    P[i]=int(P[i])



new_total_box=[]
for j in range(N-K+1):
    total=0
    for i in range(j,K+j):
        total=total+P[i]
    new_total_box.append(total)
    
max_value = max(new_total_box)
max_index = new_total_box.index(max_value)


total_box=[]
total=0
for i in range(max_index,max_index+K):
    total=total+(P[i]+1)/2
    
print(total)
    

Fixed submission:
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")
cumsum=[0]
tol=0
for i in range(N):
    P[i]=(int(P[i])+1)/2
    tol=tol+P[i]
    cumsum.append(tol)
    
k_sum=[]

for i in range(N-K+1):
  k_sum.append(cumsum[i+K]-cumsum[i])  

ans=max(k_sum)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")

for i in range(N):
    P[i]=int(P[i])
expect=[]
for i in range(N):
    expect.append((P[i]+1)/2)

total_box=[]
for j in range(N-K+1):
    total=0
    for i in range(j,K+j):
        total=total+expect[i]
    total_box.append(total)
    
max_value = max(total_box)
max_index = total_box.index(max_value)
print(max_value)

Fixed submission:
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")
cumsum=[0]
tol=0
for i in range(N):
    P[i]=(int(P[i])+1)/2
    tol=tol+P[i]
    cumsum.append(tol)
    
k_sum=[]

for i in range(N-K+1):
  k_sum.append(cumsum[i+K]-cumsum[i])  

ans=max(k_sum)
print(ans)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split(' '))
P = list(map(int,input().spllit(' ')))
if(k==1):
  print(min(P))
else:
  res=[]
  for i in range(K):
    res[i].append(min(P))
    P.remove(min(P))
  print(sum(res)) 

Fixed submission:
N,K = map(int,input().split(' '))
P = list(map(int,input().split(' ')))
if(K==1):
  print(min(P))
else:
  res=[]
  for i in range(K):
    res.append(min(P))
    P.remove(min(P))
  print(sum(res))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62


def solve(N: int):
    base = 26
    # z 26
    # aa 27
    # ab 28
    if N == 1:
        print("a")
        return
    N -= 1
    rans = []
    for i in range(100000):
        if N == 0:
            break
        if i == 0:
            rans.append(chr(N % base + ord('a')))
            N = N // base
        else:
            rans.append(chr((N-1) % base + ord('a')))
            N = N// base
    print("".join(reversed(rans)))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62




if __name__ == '__main__':
    a = input()
    if a.islower():
        print("a")
    else:
        print("A")
Buggy python submission (verdict: Runtime Error):
print(int(input()*int(input()))

Fixed submission:
#!/usr/bin/env python3
import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62



def solve(A: int, B: int):
    print(A*B)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()