Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,k=int(input()).split()
h=list(map(int,input().split(' ')))
h.sort()
if(k!=0):
  print(sum(h[:-k]))
else:
  print(sum(h))

Fixed submission:
n,k=list(map(int,input().strip().split(' ')))
h=list(map(int,input().strip().split(' ')))
h.sort()
if(k!=0): print(sum(h[:-k]))
else: print(sum(h))

Buggy python submission (verdict: Runtime Error):
n,k=int(input()).split()
a=list(input().split())
a.sort()
if(k!=0):
  print(sum(a[:-k]))
else:
  print(sum(a))

Fixed submission:
n,k=list(map(int,input().strip().split(' ')))
h=list(map(int,input().strip().split(' ')))
h.sort()
if(k!=0): print(sum(h[:-k]))
else: print(sum(h))

Buggy python submission (verdict: Runtime Error):
n,k=int(input()).split()
a=list(input().split())
for i in range(k):
  a.remove(max(a))
print(sum(a))

Fixed submission:
n,k=list(map(int,input().strip().split(' ')))
h=list(map(int,input().strip().split(' ')))
h.sort()
if(k!=0): print(sum(h[:-k]))
else: print(sum(h))
Buggy python submission (verdict: Runtime Error):
n,m =int(input()).split(' ')
if(n==m):
  print("Yes")
else:
  print("No")

Fixed submission:
n,m=input().split()
if(n==m):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n,m=int(input())
if(n==m):
  print("Yes")
else:
  print("No")

Fixed submission:
n,m=input().split()
if(n==m):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n,m=input().split()
if(n>m):
  print(n*str(m))

Fixed submission:
x, y = map(int, input().split())
if(x>y):
  print(x*str(y))
else:
  print(y*str(x))

Buggy python submission (verdict: Runtime Error):
n,m=input().split()
if(n>m):
  print(n*str(m))

Fixed submission:
x, y = map(int, input().split())
if(x>y):
  print(x*str(y))
else:
  print(y*str(x))

Buggy python submission (verdict: Runtime Error):
n,m =int(input()).strip().split()
if(n>m):
  print(m*(str(n)))

Fixed submission:
x, y = map(int, input().split())
if(x>y):
  print(x*str(y))
else:
  print(y*str(x))
Buggy python submission (verdict: Runtime Error):
a=input()
s=input()
if(a>=3200):
  print(s)
else:
  print('red')

Fixed submission:
a = int(input())
s = input()
print(s if a >= 3200 else 'red')

Buggy python submission (verdict: Runtime Error):
a = input()
if(a<3200):
  print('red')
else:
  print 'pink'

Fixed submission:
a = int(input())
s = input()
print(s if a >= 3200 else 'red')
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

gusu, kisu = input().split()
gusu = int(gusu) # 個数
kisu = int(kisu) # 個数
gusu_num = comb(gusu, 2, exact=True)
kisu_num = comb(kisu, 2, exact=True)
print(gusu_num + kisu_num)

Fixed submission:
from scipy.misc import comb
gusu, kisu = input().split()
gusu = int(gusu) # 個数
kisu = int(kisu) # 個数
gusu_num = comb(gusu, 2, exact=True)
kisu_num = comb(kisu, 2, exact=True)
print(gusu_num + kisu_num)
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

gusu, kisu = input().split()
gusu = int(gusu) # 個数
kisu = int(kisu) # 個数
gusu_num = comb(gusu, 2, exact=True)
kisu_num = comb(kisu, 2, exact=True)
print(gusu_num + kisu_num)

Fixed submission:
seq = input()
if seq == seq[::-1]:
    if seq[:int((len(seq) - 1) / 2)] == seq[:int((len(seq) - 1) / 2)][::-1]:
        if seq[int((len(seq) + 3) / 2) - 1:] == seq[int((len(seq) + 3) / 2) - 1:][::-1]:
            # print(seq[int((len(seq) + 3) / 2) - 1:])
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
L = input()
LL = L / 3
print(LL ** 3)

Fixed submission:
L = input()
LL = float(L) / 3
print(LL ** 3)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = input()

num_paper = int(N) / 2
if (N % 2) > 0:
  num_paper += 1
else:
  pass

print(num_paper)


Fixed submission:
N = input()
N = int(N)
num_paper = int(N / 2)
if (N % 2) > 0:
  num_paper += 1
else:
  pass

print(num_paper)

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

N = input()

num_paper = N / 2
if (N % 2) > 0:
  num_paper += 1
else:
  pass

print(num_paper)

Fixed submission:
N = input()
N = int(N)
num_paper = int(N / 2)
if (N % 2) > 0:
  num_paper += 1
else:
  pass

print(num_paper)
Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())

flag = False

for i in range(N+1):
    for j in range(M+1):
        if flag:
            break
        if M*i+N*j-i*j*2==K:
            flag = True
    if flag:
        break

if flag:
    print("Yes")
else:
    print("No")


Fixed submission:
s = input()
if s.find("YAKI")==0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
k = int(input())
a,b = map(int,input().split())1
for i in range(a,b+1):
  if i%k == 0:
    print('OK')
    break
  if i == b:
    print('NG')

Fixed submission:
k = int(input())
a,b = map(int,input().split())
for i in range(a,b+1):
  if i%k == 0:
    print('OK')
    break
  if i == b:
    print('NG')
Buggy python submission (verdict: Runtime Error):
s = input()
ans = 0
for j in range(len(s)):
  for i in range(j):
    if int(s[i:j+1])%2019 == 0:
      ans+=1
print(ans)

Fixed submission:
s,w = map(int,input().split())
if s<=w:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a>=13:
  print(b)
elif a>=6 and a<=12
  print(int(b/2))
else 
  print(0)
    


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

if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a>=13:
  print(b)
elif a>=6 and a<=12
  print(b/2)
else 
  print(0)
    

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

if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a>=13:
  print(b)
elif 6<=a and a<=13
  print(b/2)
else 
  print(0)
    

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

if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
x=input()
  if x=="A":
    print("T")
  elif x=="T":
    print("A")
  elif x=="C":
    print("G")
  else:
    print("C")


Fixed submission:
x=input()

if x=="A":
  print("T")
elif x=="T":
  print("A")
elif x=="C":
  print("G")
else:
  print("C")

Buggy python submission (verdict: Runtime Error):
x=str(input())
  if x=="A":
    print("T")
  elif x=="T":
    print("A")
  elif x=="C":
    print("G")
  elif x=="G":
    print("C")


Fixed submission:
x=input()

if x=="A":
  print("T")
elif x=="T":
  print("A")
elif x=="C":
  print("G")
else:
  print("C")

Buggy python submission (verdict: Runtime Error):
x=str(input())
if x=="A":
   print("T")
  else if x=="T":
    print("A")
  else if x=="C":
    print("G")
  else if x=="G":
    print("C")

Fixed submission:
x=input()

if x=="A":
  print("T")
elif x=="T":
  print("A")
elif x=="C":
  print("G")
else:
  print("C")
Buggy python submission (verdict: Runtime Error):
if n%2==0:
  print(n)
else:
  print(n*2)

Fixed submission:
n = int(input())
if n%2==0:
  print(n)
else:
  print(n*2)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
print(int(2 * n / gcd(2, n)))

Fixed submission:
n = int(input())
if n%2==0:
  print(n)
else:
  print(n*2)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

table = defaultdict(lambda: 0)

n = int(input())
xylist = []
for _ in range(n):
    x, y = map(int, input().split())
    xylist += [[x, y]]

xylist.sort()

for i in range(n):
    for j in range(0, i):
        x = xylist[i][0] - xylist[j][0]
        y = xylist[i][1] - xylist[j][1]
        table[x+y*10**10] += 1

max_v = max(table.values())
print(n-max_v)

Fixed submission:
from collections import defaultdict

table = defaultdict(lambda: 0)

n = int(input())
if (n==1):
    print(1)
elif n == 2:
    print(1)
else:
    xylist = []
    for _ in range(n):
        x, y = map(int, input().split())
        xylist += [[x, y]]

    xylist.sort()

    for i in range(n):
        for j in range(0, i):
            x = xylist[i][0] - xylist[j][0]
            y = xylist[i][1] - xylist[j][1]
            table[x+y*10**10] += 1

    max_v = max(table.values())
    print(n-max_v)
Buggy python submission (verdict: Time Limit Exceeded):
def solve(n, m, a, c, b):
    list1 = a
    for i in range(m):
        list1 += [c[i] for _ in range(b[i])]
    list1.sort(reverse=True)
    return sum(list1[:n])

n, m = map(int, input().split())
a = list(map(int, input().split()))
b = []
c = []
for _ in range(m):
    d = list(map(int, input().split()))
    b += [d[0]]
    c += [d[1]]
print(solve(n, m, a, c, b))

Fixed submission:
def solve(n, m, a, d):
    a.sort(reverse=True)
    d.sort(key = lambda x:(x[1]), reverse=True)
    list1 = []
    index = 0
    for i in range(m):
        list1 += [d[i][1] for _ in range(min(d[i][0], n-index))]
        index += d[i][0]
        if index >= n:
            break
    if len(list1) < n:
        list1 += [0 for _ in range(n-index)]
    for i in range(n):
        if a[i] > list1[n-1-i]:
            list1[n-1-i] = a[i]
        else:
            break
    return sum(list1)

n, m = map(int, input().split())
a = list(map(int, input().split()))
d = []
for _ in range(m):
    d += [list(map(int, input().split()))]
print(solve(n, m, a, d))
Buggy python submission (verdict: Runtime Error):
n = int(input())

s = 0
for r in range(1, int((n-1)**0.5)+5):
    if n % r == 0:
        m = n//r-1
        if n//m == n%m:
            s += m
print(s)


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

print(n-k+1)
Buggy python submission (verdict: Time Limit Exceeded):
r, g, b, n = map(int, input().split())

m1 = max(r, g, b)
m3 = min(r, g, b)
m2 = r+g+b-(m1+m3)

l1 = [m1*i for i in range(0, n//m1+1)]
cnt = 0

i = 0
while i*m1 <= n:
    j = 0
    while i*m1 + j*m2 <= n:
        if (n - (i*m1 + j*m2))%m3 == 0:
            cnt += 1
        j += 1
    i += 1
    
print(cnt)

Fixed submission:
r, g, b, n = map(int, input().split())

m1 = max(r, g, b)
m3 = min(r, g, b)
m2 = r+g+b-(m1+m3)

l1 = [m1*i for i in range(0, n//m1+1)]
cnt = 0

i = 0
while i*m1 <= n:
    j = 0
    while i*m1 + j*m2 <= n:
        if (n - (i*m1 + j*m2))%m3 == 0:
            cnt += 1
        j += 1
    i += 1
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
e = 0
i = 0
while i < len(a):
    c += 1
    cai = 1
    while a[i] == a[i + 1]:
        cai += 1
        i += 1
    if cai % 2 == 0:
        e += 1
    i += 1
ans = c - (e % 2)
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
e = 0
i = 0
while True:
    c += 1
    cai = 1
    while i != n - 1 and a[i] == a[i + 1]:
        cai += 1
        if i != n - 1:
            i += 1
        else:
            break
    if cai % 2 == 0:
        e += 1
    if i != n - 1:
        i += 1
    else:
        break
ans = c - (e % 2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
e = 0
i = 0
while i < len(a):
    c += 1
    ca = a.count(a[i])
    if ca % 2 == 0:
        e += 1
    i += ca
ans = c - (e % 2)
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
e = 0
i = 0
while True:
    c += 1
    cai = 1
    while i != n - 1 and a[i] == a[i + 1]:
        cai += 1
        if i != n - 1:
            i += 1
        else:
            break
    if cai % 2 == 0:
        e += 1
    if i != n - 1:
        i += 1
    else:
        break
ans = c - (e % 2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
done = []
e = 0
for ai in a:
    if ai not in done:
        if a.count(ai) % 2 == 0:
            e += 1
        done.append(ai)
ans = len(done) - (e % 2)
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
e = 0
i = 0
while True:
    c += 1
    cai = 1
    while i != n - 1 and a[i] == a[i + 1]:
        cai += 1
        if i != n - 1:
            i += 1
        else:
            break
    if cai % 2 == 0:
        e += 1
    if i != n - 1:
        i += 1
    else:
        break
ans = c - (e % 2)
print(ans)
Buggy python submission (verdict: Runtime Error):
w, h, n = list(map(int, input().split()))
xya = []
for i in range(n):
    xya.append(list(map(int, input().split())))

min_x_1 = w
max_x_2 = 0
min_y_3 = h
max_y_4 = 0
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] < min_x_1:
            min_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] > max_x_2:
            max_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] < min_y_3:
            min_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] > max_y_4:
            max_y_4 = xya[i][1]

x = min_x_1 - max_x_2
if x <= 0:
    print("0")
else:
    y = min_y_3 - max_y_4
    if y <= 0:
        print("0")
    else:
        print(str(x * y))


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

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

min_x_1 = w
max_x_2 = 0
min_y_3 = h
max_y_4 = 0
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] < min_x_1:
            min_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] > max_x_2:
            max_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] < min_y_3:
            min_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] > max_y_4:
            max_y_4 = xya[i][1]

x = max_x_2 - min_x_1
if x <= 0:
    print("0")
else:
    y = max_y_4 - min_y_3
    if y <= 0:
        print("0")
    else:
        print(str(x * y))


Fixed submission:
a, b, c = list(map(int, input().split()))
if (a + b == c) or (b + c == a) or (c + a == b):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
w, h, n = list(map(int, input().split()))
xya = []
for i in range(n):
    xya.append(list(map(int, input().split())))

min_x_1 = w
max_x_2 = 0
min_y_3 = h
max_y_4 = 0
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] < min_x_1:
            min_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] > max_x_2:
            max_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] < min_y_3:
            min_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] > max_y_4:
            max_y_4 = xya[i][1]

x = min_x_1 - max_x_2
if x <= 0:
    print("0")
else:
    y = min_y_3 - max_y_4
    if y <= 0:
        print("0")
    else:
        print(str(x * y))
return 0


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

max_x_1 = 0
min_x_2 = w
max_y_3 = 0
min_y_4 = h
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] > max_x_1:
            max_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] < min_x_2:
            min_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] > max_y_3:
            max_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] < min_y_4:
            min_y_4 = xya[i][1]

x = min_x_2 - max_x_1
if x <= 0:
    print("0")
else:
    y = min_y_4 - max_y_3
    if y <= 0:
        print("0")
    else:
        print(x * y)
Buggy python submission (verdict: Runtime Error):
def __main__():
    h, w, n = list(map(int, input().split()))
    grid = []
    for i in range(h):
        row = []
        for j in range(w):
            row.append(0)
        grid.append(row)
    for i in range(n):
        ai, bi = list(map(int, input().split()))
        grid[ai - 1][bi - 1] = 1
    
    result = [0] * 10
    for i in range(h - 2):
        for j in range(w - 2):
            black = 0
            for i2 in range(3):
                for j2 in range(3):
                    if grid[i + i2][j + j2] == 1: black += 1 
            result[black] += 1
            
    for i in range(9):
        print(result[i])

__main__()

Fixed submission:
def __main__():
    s = input()
    result = cal(s)
    print(result[0])

# return (下階層の和の合計, 下階層の和のパターン数)
def cal(s):
    if len(s) == 0:
        return(0, 1)
    elif len(s) == 1:
        return (int(s), 1)
    else:
        sum, times = 0, 0
        for i in range(len(s)):
            num = int(s[0:(i + 1)])
            result = cal(s[(i + 1):len(s)])
            sum += num * result[1] + result[0]
            times += result[1]
        return (sum, times)
            
__main__()
Buggy python submission (verdict: Time Limit Exceeded):
import math

n = int(input())
sum = 0
for i in range(1,n+1):
  for j in range(1,n+1):
    for k in range(1,n+1):
      sum += math.gcd(math.gcd(i,j),k)

print(sum)

Fixed submission:
import math

n = int(input())
sum = 0
for i in range(1,n+1):
  for j in range(1,n+1):
    a = math.gcd(i,j)
    for k in range(1,n+1):
      sum += math.gcd(a,k)

print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
moto = [int(i) for i in input().split()]
 
array=[0]*n
 
for i in reversed(range(1,n+1)):
  if sum(array[i-1::i])%2 != moto[i-1]:
    array[i-1] = 1
    
m = array.count(1)
ans = ""
for i in range(n):
  if array[i] == 1:
    ans = ans + str(i+1) + " "
print(m)
if ans != "":
  print(ans[:-1])

Fixed submission:
n = int(input())
moto = [int(i) for i in input().split()]
 
array=[0]*n
 
for i in reversed(range(1,n+1)):
  if sum(array[i-1::i])%2 != moto[i-1]:
    array[i-1] = 1
    
m = sum(array)
print(m)
ans = ""
for i in range(n):
  if array[i] == 1:
    print(i+1, end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
moto = [int(i) for i in input().split()]
 
array=[0]*n
 
for i in reversed(range(1,n+1)):
  sum = 0
  for j in range(i,n+1,i):
    sum += array[j-1]
  if array[i-1] != (sum-moto[i-1])%2:
    array[i-1] = 1
    
m = array.count(1)
ans = ""
for i in range(n):
  if array[i] == 1:
    ans = ans + str(i+1) + " "
print(m)
if ans != "":
  print(ans[:-1])

Fixed submission:
n = int(input())
moto = [int(i) for i in input().split()]
 
array=[0]*n
 
for i in reversed(range(1,n+1)):
  if sum(array[i-1::i])%2 != moto[i-1]:
    array[i-1] = 1
    
m = sum(array)
print(m)
ans = ""
for i in range(n):
  if array[i] == 1:
    print(i+1, end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
moto = [int(i) for i in input().split()]

array=[0]*n

for i in reversed(range(1,n+1)):
  sum = 0
  for j in range(i,n+1,i):
    sum += array[j-1]
  if array[i-1] != (sum-moto[i-1])%2:
    array[i-1] = 1

m = array.count(1)
ans = ""
cnt = 0
for a in array:
  cnt += 1
  if a == 1:
    ans = ans + str(cnt) + " "
print(m)
if ans != "":
  print(ans[:-1])


Fixed submission:
n = int(input())
moto = [int(i) for i in input().split()]
 
array=[0]*n
 
for i in reversed(range(1,n+1)):
  if sum(array[i-1::i])%2 != moto[i-1]:
    array[i-1] = 1
    
m = sum(array)
print(m)
ans = ""
for i in range(n):
  if array[i] == 1:
    print(i+1, end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
moto = [int(i) for i in input().split()]

array=[0]*n

for i in reversed(range(1,n+1)):
  sum = 0
  for j in range(i,n+1,i):
    sum += array[j-1]
  if array[i-1] != (sum-moto[i-1])%2:
    array[i-1] = 1

m = array.count(1)
ans = ""
for i in range(n):
  if array[i] == 1:
    ans = ans + str(i+1) + " "
print(m)
if ans != "":
  print(ans[:-1])



Fixed submission:
n = int(input())
moto = [int(i) for i in input().split()]
 
array=[0]*n
 
for i in reversed(range(1,n+1)):
  if sum(array[i-1::i])%2 != moto[i-1]:
    array[i-1] = 1
    
m = sum(array)
print(m)
ans = ""
for i in range(n):
  if array[i] == 1:
    print(i+1, end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
n, m = [int(i) for i in input().split()]
obs = []
idou = []

for i in range(m):
  obs.append(int(input()))
  
#i段目にいる確率
for i in range(n+1):
  if i==0:
    idou.append(1)
  elif i==1 and not(i in obs):
    idou.append(1)
  elif i in obs:
    idou.append(0)
  else:
    tasu = idou[-1] + idou[-2]
    tasu = tasu%1000000007
    idou.append(tasu)
    
print(idou[-1])

Fixed submission:
n, m = [int(i) for i in input().split()]
obs = []
idou = []
 
for i in range(m):
  obs.append(int(input()))
  
obs = set(obs)
  
#i段目にいる確率
for i in range(n+1):
  if i==0:
    idou.append(1)
  elif i==1 and not(i in obs):
    idou.append(1)
  elif i in obs:
    idou.append(0)
  else:
    tasu = idou[-1] + idou[-2]
    tasu = tasu%1000000007
    idou.append(tasu)
    
print(idou[-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
framelist = [int(i) for i in input().split()]

sum = 0


for i in range(n):
  sum += framelist[i]

avg = sum /n

min = avg

for i in range(n):
  difference = abs(framelist[i]-avg)
  if min>difference:
    min = difference
    
print(framelist.index(difference))

Fixed submission:
n = int(input())
framelist = [int(i) for i in input().split()]

sum = 0


for i in range(n):
  sum += framelist[i]

avg = sum /n

min = avg
value = 0

for i in range(n):
  difference = abs(framelist[i]-avg)
  if min>difference:
    min = difference
    value = framelist[i]
    
print(framelist.index(value))
Buggy python submission (verdict: Runtime Error):
n = int(input)

if n>888:
  print(999)
elif n>777:
  print(888)
elif n>666:
  print(777)
elif n>555:
  print(666)
elif n>444:
  print(555)
elif n>333:
  print(444)
elif n>222:
  print(333)
elif n>111:
  print(222)
else:
  print(111)

  


Fixed submission:
n = int(input())
 
if n>888:
  print(999)
elif n>777:
  print(888)
elif n>666:
  print(777)
elif n>555:
  print(666)
elif n>444:
  print(555)
elif n>333:
  print(444)
elif n>222:
  print(333)
elif n>111:
  print(222)
else:
  print(111)
Buggy python submission (verdict: Runtime Error):
n = int(input())
keep = n

sn = 0
for i in range(9):
  sn += n%10
  n = n//10
  
if keep%sn == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
n = int(input())
keep = n
 
sn = 0
for i in range(10):
  sn += n%10
  n = n//10
  
if keep%sn == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())

print(max[a+b,a-b,a*b])

Fixed submission:
a, b = map(int,input().split())
 
print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1)
    

Fixed submission:
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1
for i in range(a,b+1):
  if i<=jougen or kagen<=i:
    print(i)

Fixed submission:
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = [int(i) for i in input().split()]
 
for i in range(a,b+1):
  if abs(a-i)<k or abs(b-i)<k:
    print(i)

Fixed submission:
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = [int(i) for i in input().split()]

for i in range(a,b+1):
  if abs(a-i)<k or abs(b-i)<k:
    print(i)
    
 

Fixed submission:
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1):
    print(i)