qyliang/CodeNanoFix huggingface dataset:
Buggy code:
T = [int(input()) for _ in range(5)]

lst1 = []
lst2 = []
for i in range(5):
    if T[i]%10 == 0:
        lst1.append([0,T[i]])
    else:
        lst2.append([T[i]%10,T[i]])

lst2 = sorted(lst2, reverse=True)
lst = lst1 + lst2
print(lst)

ans = 0
for i in range(5):
    ans += lst[i][1]
    if lst[i][0] == 0:
        pass
    else:
        ans += 10 - lst[i][0]

ans -= 10 - lst[i][0]

print(ans)


Fixed code:
T = [int(input()) for _ in range(5)]

lst1 = []
lst2 = []
for i in range(5):
    if T[i]%10 == 0:
        lst1.append([0,T[i]])
    else:
        lst2.append([T[i]%10,T[i]])

lst2 = sorted(lst2, reverse=True)
lst = lst1 + lst2

ans = 0
for i in range(5):
    ans += lst[i][1]
    if lst[i][0] == 0:
        pass
    else:
        ans += 10 - lst[i][0]

if lst[i][0] == 0:
    pass
else:
    ans -= 10 - lst[i][0]

print(ans)
Buggy code:
X=[int(input()) for i in range(5)]
Y=[]
for i in X:
  Y.append(-(-x//10)*10)
print(sum(Y)-(max(Y-X)))

Fixed code:
X=[int(input()) for i in range(5)]
Y=[]
for x in X:
  Y.append(-(-x//10)*10-x)
print(sum(X)+sum(Y)-(max(Y)))
Buggy code:
a = []
b = []
min = 10
minutes = 0

for i in range(5):
    a.append(int(input()))
    if 0 < a[i] % 10 < min:
        min = a[i] % 10
        min_index = i
    else:
        min_index = 1

a[4], a[min_index] = a[min_index], a[4]

for i in range(4):
    if a[i] % 10 != 0:
        minutes += (a[i] // 10 + 1) * 10
    else:
        minutes += a[i]

minutes += a[4]

print(minutes)

Fixed code:
a = []
b = []
min = 10
minutes = 0
min_index = 0

for i in range(5):
    a.append(int(input()))
    if 0 < a[i] % 10 < min:
        min = a[i] % 10
        min_index = i

a[4], a[min_index] = a[min_index], a[4]

for i in range(4):
    if a[i] % 10 != 0:
        minutes += (a[i] // 10 + 1) * 10
    else:
        minutes += a[i]

minutes += a[4]

print(minutes)
Buggy code:
K=[int(input()) for _ in range(5)]
ans=0
c=10
for i in range(5):
  c=min(K[i]%10,c)
for k in range(5):
  ans+=(K[k]//10)*10+10
print(ans-10+c)

Fixed code:
K=[int(input()) for _ in range(5)]
ans=0
c=10
for i in range(5):
  r=K[i]%10
  if r==0:
    r=10
  c=min(r,c)
for k in range(5):
  if K[k]%10==0:
    ans+=K[k]
  else:
    ans+=(K[k]//10)*10+10
print(ans-10+c)
Buggy code:
input_li = [int(input()) for _ in range(5)]
rest_li = [_ % 10 for _ in input_li]

min_li = min(rest_li)
del rest_li[rest_li.index(min_li)]
total = 0

for i in  rest_li:
    if i != 0:
        total += 10 - i

print(sum(input_li) + total)

Fixed code:
input_li = [int(input()) for _ in range(5)]
rest_li = [_ % 10 for _ in input_li]
rest_li = [_ for _ in rest_li if _ != 0]

if len(rest_li) != 0:
    min_li = min(rest_li)
    del rest_li[rest_li.index(min_li)]
    total = 0

    for i in  rest_li:
        if i != 0:
            total += 10 - i

    print(sum(input_li) + total)

else:
    print(sum(input_li))
Buggy code:
time=[]
for i in range(5):
  time.append(input())

num=[]
min=10
  
for list in time:
  if list%10==0:
    num.append(list)
  else:
    num.append(list+(10-list%10))
    if min>list%10:
      min=list%10

print(sum(num)-(10-min))
  
  



Fixed code:
time=[]
for i in range(5):
  time.append(int(input()))

num=[]
min=10
  
for list in time:
  if list%10==0:
    num.append(list)
  else:
    num.append(list+(10-list%10))
    if min>list%10:
      min=list%10

print(sum(num)-(10-min))
Buggy code:
B
# -*- coding: utf-8 -*-
box = []
for i in range(0,5):
    box.append(int(input()))
amari = []
for i in range(0,5):
    amari.append(box[i] % 10)
for i in range(0,5):
    if amari[i] ==0:
        amari[i] = 100
    else:
        pass
sumtime = 0
box4 = box[4]
boxmin = box[amari.index(min(amari))]
box[amari.index(min(amari))] = box4 
box[4] = boxmin
for i in range(0,5):
    if i ==4:
        sumtime += box[i]
    elif box[i]%10==0:
        sumtime +=box[i]
    else:
        sumtime += (box[i] // 10)*10+10
print(sumtime)

Fixed code:
# -*- coding: utf-8 -*-
box = []
for i in range(0,5):
    box.append(int(input()))
amari = []
for i in range(0,5):
    amari.append(box[i] % 10)
for i in range(0,5):
    if amari[i] ==0:
        amari[i] = 100
    else:
        pass
sumtime = 0
box4 = box[4]
boxmin = box[amari.index(min(amari))]
box[amari.index(min(amari))] = box4 
box[4] = boxmin
for i in range(0,5):
    if i ==4:
        sumtime += box[i]
    elif box[i]%10==0:
        sumtime +=box[i]
    else:
        sumtime += (box[i] // 10)*10+10
print(sumtime)
Buggy code:
time = []
rem = []
for _ in range(5):
    n = int(input())
    time.append(n)
    if n % 10 != 0:
        rem.append(10 - n % 10)

rem.sort()
ans = sum(time) + sum(rem[:4])
# print(time, rem)
print(ans)


Fixed code:
time = []
rem = []
for _ in range(5):
    n = int(input())
    time.append(n)
    if n % 10 != 0:
        rem.append(10 - n % 10)

rem.sort()
ans = sum(time) + sum(rem[:len(rem)-1])
# print(time, rem)
print(ans)
Buggy code:
List= [int(input()) for i in range(5)]
amari =9
time = 0
flag = False;
for i in List:
    if(i%10 != 0):
        time += 10 - i%10
        amari = min(amari,i%10)
        flag = True
output = sum(List) + time
if(flag):
    output += amari
print(output)

Fixed code:
List= [int(input()) for i in range(5)]
amari =9
time = 0
flag = False;
for i in List:
    if(i%10 != 0):
        time += 10 - i%10
        amari = min(amari,i%10)
        flag = True
output = sum(List) + time
if(flag):
    output -= 10 - amari
print(output)
Buggy code:
list = [int(input()) for i in range(5)]
list_amari = [(i-1) % 10 +1 for i in list]
min = min(list_amari)
for i in range(5):
  min += list[i] - list_amari[i] +10
  
print(min)

Fixed code:
list = [int(input()) for i in range(5)]
list_amari = [(i-1) % 10 +1 for i in list]
min = min(list_amari)
for i in range(5):
  min += list[i] - list_amari[i] +10
  
print(min-10)
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
l=[a,b,c,d,e]
p=10
ix=0
for i in range(len(l)):
  x=l[i]
  q=x%10
  if q!=0 and q<p:
    p=q
    ix=i
r=l[ix]
l.remove(r)
s=0
for x in l:
  s+=x
  if x%10!=0:
    s+=10-(x%10)
  print(s)
print(s+r)

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
l=[a,b,c,d,e]
p=10
ix=0
for i in range(len(l)):
  x=l[i]
  q=x%10
  if q!=0 and q<p:
    p=q
    ix=i
r=l[ix]
l.remove(r)
s=0
for x in l:
  s+=x
  if x%10!=0:
    s+=10-(x%10)
print(s+r)
Buggy code:

sum=0
m=9
for i in range(5):
  dish=int(input())
  if dish%10==0:
    sum+=dish
  else:
    sum+=dish+10-dish%10
    m=min(m,dish%10)
print(sum-10+dish%10)
  


Fixed code:

sum=0
m=10
for i in range(5):
  dish=int(input())
  if dish%10==0:
    sum+=dish
  else:
    sum+=dish+10-dish%10
    m=min(m,dish%10)
    
print(sum-10+m)
Buggy code:
a = list(map(int, [input() for i in range(5)]))
b = [math.ceil(b / 10) * 10 for b in a]

c1 = b[0] + b[1] + b[2] + b[3] + a[4]
c2 = b[0] + b[1] + b[2] + a[3] + b[4]
c3 = b[0] + b[1] + a[2] + b[3] + b[4]
c4 = b[0] + a[1] + b[2] + b[3] + b[4]
c5 = a[0] + b[1] + b[2] + b[3] + b[4]

print(min([c1, c2, c3, c4, c5]))

Fixed code:
import math

a = list(map(int, [input() for i in range(5)]))
b = [math.ceil(b/10)*10 for b in a]

c1 = b[0] + b[1] + b[2] + b[3] + a[4]
c2 = b[0] + b[1] + b[2] + a[3] + b[4]
c3 = b[0] + b[1] + a[2] + b[3] + b[4]
c4 = b[0] + a[1] + b[2] + b[3] + b[4]
c5 = a[0] + b[1] + b[2] + b[3] + b[4]

print(min([c1,c2,c3,c4,c5]))
Buggy code:
AE = []
for i in range(5):
    AE.append(int(input()))

ans = 0
mini = []
for i in AE:
    ans += (i//10 + 1)*10
    mini.append(i%10)
print(ans + min(mini) - 10)
    

Fixed code:
AE = []
for i in range(5):
    AE.append(int(input()))

ans = 0
mini = []
for i in AE:
    if(i%10 == 0):
        ans += i
    else:
        ans += (i//10 + 1)*10
        mini.append(i%10)
if(mini != []):
    print(ans + min(mini) - 10)
else:
    print(ans)
Buggy code:
import math
a = [int(input()) for i in range(5)]
sum = 0
r =[]
for i in range(5):
  if a[i] % 10 =0:
    sum+=a[i]
  elif a[i] % 10 !=0:
    r.append(a[i]%10)
    sum+= (math.ceil(a[i]/10)*10)
print(sum-10+min(r))

Fixed code:
import math
a = []
for i in range(5):
    a.append(int(input()))
sum = 0
r =10
for i in range(5):
  if a[i] % 10 ==0:
    sum+=a[i]
  elif a[i] % 10 !=0:
    r = min(r,a[i]%10)
    sum+= (10*math.ceil(a[i]/10))
print(sum-10+r)
Buggy code:
a=[int(input()) for i in range(5)]
result=0
ans=0
x=9
for i in a:
    if i%10!=0:
        result+=(i//10+1)*10
    else:
        result+=i
for i in a:
    if i%10!=0:
        ans=i%10
        if ans<x:
            x=ans
print(result-x)


Fixed code:
a=[int(input()) for i in range(5)]
result=0
ans=0
x=10
for i in a:
    if i%10!=0:
        result+=(i//10+1)*10
    else:
        result+=i
for i in a:
    if i%10!=0:
        ans=i%10
        if ans<x:
            x=ans
print(result+x-10)
Buggy code:
l=[input() for _ in range(5)]
l_1=[]
for i in l:
  if i%10!=0:
    l_1.append(((i+9)//10)*10)
  else:l_1.append(i)
nnn=9999999    
for i in range(5):
  num_1=0
  for j in range(5):
    if i==j:
      num_1+=l[j]
    else:num_1+=l_1[j]
  nnn=min(nnn,num_1)
print(nnn)

Fixed code:
l=[int(input()) for _ in range(5)]
l_1=[]
for i in l:
  if i%10!=0:
    l_1.append(((i+9)//10)*10)
  else:l_1.append(i)
nnn=9999999    
for i in range(5):
  num_1=0
  for j in range(5):
    if i==j:
      num_1+=l[j]
    else:num_1+=l_1[j]
  nnn=min(nnn,num_1)
print(nnn)
Buggy code:
t=[int(input()) for _ in range(5)]
s=[]
for i in range(5):
    s.append(t[i]%10)
    t[i]=-(-t[i]//10)*10
S=sorted(s)[-5+s.count(0)]
if S==0:
    print(sum(t))
else:print(sum(t-10+S))

Fixed code:
t=[int(input()) for _ in range(5)]
s=[]
for i in range(5):
    s.append(t[i]%10)
    t[i]=-(-t[i]//10)*10
S=sorted(s)[-5+s.count(0)]
if S==0:
    print(sum(t))
else:print(sum(t)-10+S)
Buggy code:
a=[]
for i in range(5):
    a.append(int(input()))

zako=9
switch=0
for i in range(5):
    b=a[i]%10
    if b<=zako and b!=0:
        zako=b
        memory=i
        switch=1

if switch=0:
    memory=1
x=a.pop(memory)

lst=[]

for i in range(4):
    c=a[i]//10
    c=c*10
    if a[i]%10!=0:
        c+=10
    lst.append(c)

print(x+sum(lst))

Fixed code:
a=[]
for i in range(5):
    a.append(int(input()))

zako=9
switch=0
for i in range(5):
    b=a[i]%10
    if b<=zako and b!=0:
        zako=b
        memory=i
        switch=1

if switch==0:
    memory=1
x=a.pop(memory)

lst=[]

for i in range(4):
    c=a[i]//10
    c=c*10
    if a[i]%10!=0:
        c+=10
    lst.append(c)

print(x+sum(lst))
Buggy code:
L=[int(input()) for _ in range(5)]
sum=0
modL=[(L[i]-1)%10 for i in range(5)]
last = modL.index(min(modL))
for i in range(5):
    if L[i]%10==0:
        sum += L[i]
    else:
        sum += (int(L[i]//10)+1)*10
if last%10!=0:
    sum -= 10 - L[last]%10
print(sum)

Fixed code:
L=[int(input()) for _ in range(5)]
sum=0
modL=[(L[i]-1)%10 for i in range(5)]
last = modL.index(min(modL))
for i in range(5):
    if L[i]%10==0:
        sum += L[i]
    else:
        sum += (int(L[i]//10)+1)*10
if L[last]%10!=0:
    sum -= 10 - L[last]%10
print(sum)
Buggy code:
import sys

lines = [int(input()) for i in range(5)]

time = 0
count = 0

for i,item in enumerate(lines):
	if item%10 == 0:
		time += item
		lines[i] = 0
		count += 1
		print(item)

for i in reversed(range(9)):
	print("#",i)
	for j,item in enumerate(lines):
		if item%10 == i+1:
			time += item
			lines[j] = 0
			count += 1
			if count != 5:
				time += (10 - (i+1))
			print(item,time)

print(time)



Fixed code:
import sys

lines = [int(input()) for i in range(5)]

time = 0
count = 0

for i,item in enumerate(lines):
	if item%10 == 0:
		time += item
		lines[i] = 0
		count += 1
		#print(item)

for i in reversed(range(9)):
	#print("#",i)
	for j,item in enumerate(lines):
		if item%10 == i+1:
			time += item
			lines[j] = 0
			count += 1
			if count != 5:
				time += (10 - (i+1))
			#print(item,time)

print(time)
Buggy code:
# 2019/04/06
# AtCoder Beginner Contest 123 - B

# Input
sum = 0
cl = list()
hmin = 99
minidx = -1

for i in range(5):
    wt = int(input())
    t = int((wt + 9) / 10) * 10
    sum += t
    cl.append(wt)
    wh = wt % 10
    if wh > 0 and wh < hmin:
        hmin = wt % 10
        minidx = i

print(hmin)
if hmin < 99:
    sum = sum - (10 - hmin)

# Output
print(sum)


Fixed code:
# 2019/04/06
# AtCoder Beginner Contest 123 - B

# Input
sum = 0
cl = list()
hmin = 99
minidx = -1

for i in range(5):
    wt = int(input())
    t = int((wt + 9) / 10) * 10
    sum += t
    cl.append(wt)
    wh = wt % 10
    if wh > 0 and wh < hmin:
        hmin = wt % 10
        minidx = i

if hmin < 99:
    sum = sum - (10 - hmin)

# Output
print(sum)
Buggy code:
import itertools

times = [int(input()) for _ in range(5)]

p = itertools.permutations([0, 1, 2, 3, 4])

min_time = 10e9
for orders in p:
    current_time = 0
    orders = [0, 1, 2, 4, 3]
    for idx, order in enumerate(orders):
        t = times[order]
        current_time += t
        if idx < 4 and current_time % 10 != 0:
            current_time += 10 - current_time % 10

    min_time = min(min_time, current_time)

print(min_time)


Fixed code:
import itertools

times = [int(input()) for _ in range(5)]

p = itertools.permutations([0, 1, 2, 3, 4])

min_time = 10e9
for orders in p:
    current_time = 0
    for idx, order in enumerate(orders):
        t = times[order]
        current_time += t
        if idx < 4 and current_time % 10 != 0:
            current_time += 10 - current_time % 10

    min_time = min(min_time, current_time)

print(min_time)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
p = [a, b, c, d, e]

mi = [a%10,b%10,c%10,d%10,e%10]
mm = [i for i in mi if i != 0]
mm.sort()
sum = 0
for i in range(5):
	if p[i]%10 != 0:
		sum += (p[i]//10+1)*10
	else:
		sum += p[i]//10*10
if (mm):
	sum -= mm[0]
else:
	sum = 0
print (sum)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
p = [a, b, c, d, e]

mi = [a%10,b%10,c%10,d%10,e%10]
mm = [i for i in mi if i != 0]
mm.sort()
sum = 0
for i in range(5):
	if p[i]%10 != 0:
		sum += (p[i]//10+1)*10
	else:
		sum += p[i]//10*10
if (mm):
	sum -= 10- mm[0]
print (sum)
Buggy code:
#125 b
def age(x):
    if x%10==0:
        return x
    else:
        return x+10-x%10

r=[]
amari=[]
amari_min=10
ans=0
for i in range(5):
    d=int(input())
    amari.append(d%10)
    r.append(age(d))

for x in range(5):
    if x!=0 and amari_min>x:
        amari_min=x
ans+=sum(r)


for x in amari:
    if x==0:
        amari.pop()
if amari:
    amari_min=min(amari)
    ans-=10-amari_min


print(ans)

Fixed code:
#125 b
def age(x):
    if x%10==0:
        return x
    else:
        return x+10-x%10

r=[]
amari=[]
amari_new=[]
amari_min=10
ans=0
for i in range(5):
    d=int(input())
    amari.append(d%10)
    r.append(age(d))

for x in range(5):
    if x!=0 and amari_min>x:
        amari_min=x
ans+=sum(r)


for x in amari:
    if x!=0:
        amari_new.append(x)

if amari_new:
    amari_min=min(amari_new)
    ans-=10-amari_min

print(ans)
Buggy code:
m = 10

wa = 0

for i in range(5):
  n = int(input())
  if n%10 is 0:
    wa += n
  elif n%10 < m:
    m = n%10
    wa += n- n%10 +10
    
print(wa-10+m)




Fixed code:
m = 10
 
wa = 0
 
for i in range(5):
  n = int(input())
  if n%10 is 0:
    wa += n
    continue
  if n%10 < m:
    m = n%10
  wa += n- n%10 +10
    
print(wa-10+m)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = 0
g = 0
h = 0
i = 0
j = 0
for k in range(9):
    if (a + f) % 10 != 0:
        f += 1
    if (b + g) % 10 != 0:
        g += 1
    if (c + h) % 10 != 0:
        h += 1
    if (d + i) % 10 != 0:
        i += 1
    if (e + j) % 10 != 0:
        j += 1
print(a+b+c+d+e+f+g+h+i+j-max(f,g,h,i,j))
print(f,g,h,i,j) 

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = 0
g = 0
h = 0
i = 0
j = 0
for k in range(9):
    if (a + f) % 10 != 0:
        f += 1
    if (b + g) % 10 != 0:
        g += 1
    if (c + h) % 10 != 0:
        h += 1
    if (d + i) % 10 != 0:
        i += 1
    if (e + j) % 10 != 0:
        j += 1
print(a+b+c+d+e+f+g+h+i+j-max(f,g,h,i,j))
Buggy code:
a = [int(input()) for i in range(5)]
b = 4
c = 0
ans = 0
for i in a:
  if i % 10 == 0:
    if b > 0:
      b -= 1 
  else:
    if c == 0:
      c = i
    else:
      c = min(c,i % 10)
for i in a:
  ans += (i // 10) * 10
ans = ans + b * 10 + c
print(ans)
    
    


Fixed code:
a = [int(input()) for i in range(5)]
b = 4
c = 0
ans = 0
for i in a:
  if i % 10 == 0:
    if b > 0:
      b -= 1 
  else:
    if c == 0:
      c = i % 10
    else:
      c = min(c,i % 10)
for i in a:
  ans += (i // 10) * 10
ans = ans + b * 10 + c
print(ans)
Buggy code:
li = []
for i in range(5):
  li.append(int(input()))
mi = 1e10
ans = 0
for i in range(5):
  ans+=(li[i]//10)*(10+(li[i]%10!=0))
  if li[i]%10 != 0:
    mi = min(mi,li[i]%10)
print(ans - 10 + mi)

Fixed code:
li = []
for i in range(5):
  li.append(int(input()))
mi = 1e10
ans = 0
for i in range(5):
  ans+=(li[i]//10+(li[i]%10!=0))*(10)
  mi = min(mi,li[i]%10+(li[i]%10==0)*10)
print(ans - 10 + mi)
Buggy code:
a=[0]*5
b=[10]*5
for i in range(5):
    a[i]=int(input())
    if a[i]%10!=0:
        b[i]=a[i]%10
    a[i]=int((a[i]/10)+1)*10
ans=sum(a)+min(b)-10
print(ans)

Fixed code:
a=[0]*5
b=[10]*5
for i in range(5):
    a[i]=int(input())
    if a[i]%10!=0:
        b[i]=a[i]%10
        a[i]=int((a[i]/10)+1)*10
ans=sum(a)+min(b)-10
print(ans)
Buggy code:
dish=[int(input()) for i in range(5)]
remain=[(dish[i]-1)%10 for i in range(5)]
divide=[(dish[i]-1)//10+1 for i in range(5)]
a=sorted(remain)[0]
print(a)
print(sum(divide)*10-9+a)
print(sum(divide))

Fixed code:
dish=[int(input()) for i in range(5)]
remain=[(dish[i]-1)%10 for i in range(5)]
divide=[(dish[i]-1)//10+1 for i in range(5)]
a=sorted(remain)[0]
print(sum(divide)*10-9+a)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
cook_time = [A,B,C,D,E]
muda = [10-i%10 for i in cook_time]
cook_time_muda = list(zip(cook_time,muda))
cook_time_muda.sort(key=lambda x:x[1])
time = 0
for i in cook_time_muda:
    time = time + i[0]+i[1]
time = time - i[1]
print(time)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
cook_time = [A,B,C,D,E]
muda = [10-i%10 if i%10!=0 else 0 for i in cook_time]
cook_time_muda = list(zip(cook_time,muda))
cook_time_muda.sort(key=lambda x:x[1])
time = 0
for i in cook_time_muda:
    time = time + i[0]+i[1]
time = time - i[1]
print(time)
Buggy code:
# -*- coding: utf-8 -*-

import math


order = []

for _ in range(5):
    order.append(int(input()))

sorted_order = sorted(order, key=lambda x: (x - 1) % 10, reverse=True)

print(sorted_order)

t = 0
for i, n in enumerate(sorted_order):
    if i == len(sorted_order) - 1:
        t += n
    else:
        t += math.ceil(n / 10) * 10

print(int(t))


Fixed code:
# -*- coding: utf-8 -*-

import math


order = []

for _ in range(5):
    order.append(int(input()))

sorted_order = sorted(order, key=lambda x: (x - 1) % 10, reverse=True)

t = 0
for i, n in enumerate(sorted_order):
    if i == len(sorted_order) - 1:
        t += n
    else:
        t += math.ceil(n / 10) * 10

print(int(t))
Buggy code:
A,B,C,D,E=int(input()),int(input()),int(input()),int(input()),int(input())
orders = {'A': A, 'B': B, 'C': C, 'D': D, 'E': E}
orders = sorted(orders.items(), key=lambda item: item[1] % 10, reverse=True)
res = 0
while orders:
  if res % 10 != 0:
    res += (10 - res % 10)
  order = orders.pop(0)
  res += order
print(res)


Fixed code:
A,B,C,D,E=int(input()),int(input()),int(input()),int(input()),int(input())
orders = {'A': A, 'B': B, 'C': C, 'D': D, 'E': E}
orders = sorted(orders.items(), key=lambda item: (10 if item[1] % 10 == 0 else item[1] % 10), reverse=True)
res = 0
while orders:
  if res % 10 != 0:
    res += (10 - res % 10)
  order = orders.pop(0)
  res += order[1]
print(res)
Buggy code:
l = list([int(input()) for _ in range(5)])

ans = 0

for i in range(len(l)):
  if ans % 10 == 0:
    pass
  else:
    ans += 10 - (ans % 10)
  ans += l[i]
  
ml = []
for i in range(len(l)):
  ml.append(l[i] % 10)
  if ml[i] == 0:
    ml[i] = 10
  
ans -= min(ml)
print(ans)

Fixed code:
l = list([int(input()) for _ in range(5)])
 
ans = 0
ml = []
 
for i in range(len(l)):
  ans += l[i]
  if ans % 10 == 0:
    pass
  else:
    ans += 10 - (ans % 10)

for i in range(len(l)):
  ml.append(l[i] % 10)
  if ml[i] == 0:
    ml[i] = 10
  
ans -= 10 - min(ml)
print(ans)
Buggy code:
times = list()
dish_num = 5
for i in range(dish_num):
    times.append(int(input()))

last = 0
for i in range(1, dish_num):
    if ((times[last]+9) % 10) > ((times[i]+9) % 10):
        last = i

for i in range(dish_num):
    if i != last:
        times[i] += (10 - times[i] % 10) % 10

result = 0
for t in times:
    result += t

print(times)
print(result)

Fixed code:
times = list()
dish_num = 5
for i in range(dish_num):
    times.append(int(input()))

last = 0
for i in range(1, dish_num):
    if ((times[last]+9) % 10) > ((times[i]+9) % 10):
        last = i

for i in range(dish_num):
    if i != last:
        times[i] += (10 - times[i] % 10) % 10

result = 0
for t in times:
    result += t

print(result)
Buggy code:
t = []
ans = 0
for i in range(5):
    a = int(input())
    if a%10 == 0:
        ans += a
    
    else:
         x = 10-a%10
         ans += a + (x)
         t.append(x)
    
print(t)
ans -= max(t)
print(ans)

Fixed code:
t = []
ans = 0
for i in range(5):
    a = int(input())
    if a%10 == 0:
        ans += a
        t.append(0)
    
    else:
        x = 10-a%10
        ans += a + x
        t.append(x)
    
ans -= max(t)
print(ans)
Buggy code:
list = [int(input()) for i in range(5)]
t = 0
cnt_l = []
for i in range(5):
    cnt = 0
    while list[i] % 10 != 0:
        list[i] += 1
        cnt += 1
    t += list[i]
    if cnt != 0:
        cnt_l.append(cnt)
if not cnt:
    cnt.append(0)
print(t - max(cnt_l))

Fixed code:
list = [int(input()) for i in range(5)]
t = 0
cnt_l = []
for i in range(5):
    cnt = 0
    while list[i] % 10 != 0:
        list[i] += 1
        cnt += 1
    t += list[i]
    if cnt != 0:
        cnt_l.append(cnt)
if not cnt_l:
    cnt_l.append(0)
print(t - max(cnt_l))
Buggy code:
def f(x):
    return x + 10 - (x%10)

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

res = f(a) + f(b) + f(c) + f(d) + f(e)

l = [a, b, c, d, e]
l = list(map(lambda x: (x-1)%10, l))
res -= (10-(min(l)+1))
print(res)


Fixed code:
def f(x):
    if x%10 == 0: return x
    return x + 10 - (x%10)

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

res = f(a) + f(b) + f(c) + f(d) + f(e)

l = [a, b, c, d, e]
l = list(map(lambda x: (x-1)%10, l))
res -= (10-(min(l)+1))
print(res)
Buggy code:
from math import ceil as c;a=[int(input())for i in range(5)];sum([c(i/10)for i in a])*10-max([c(i/10)*10-i for i in a])

Fixed code:
from math import ceil as c;a=[int(input())for i in range(5)];print(sum([c(i/10)for i in a])*10-max([c(i/10)*10-i for i in a]))
Buggy code:
a=[]
for i in range(5):
  a.append(input())
b=[]
for j in range(5):
  if a[j]%10==0:
    b.append(10)
  else:
    b.append(a[j]%10)
idx=b.index(min(b))
cnt=a[idx]
del a[idx]
for k in range(4):
  if a[k]%10==0:
    cnt+=a[k]
  else:
    cnt+=a[k]+10-(a[k]%10)
print(cnt)
  




Fixed code:
a=[]
for i in range(5):
  a.append(int(input()))
b=[]
for j in range(5):
  if a[j]%10==0:
    b.append(10)
  else:
    b.append(a[j]%10)
idx=b.index(min(b))
cnt=a[idx]
del a[idx]
for k in range(4):
  if a[k]%10==0:
    cnt+=a[k]
  else:
    cnt+=a[k]+10-(a[k]%10)
print(cnt)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
ans = 0
List = [a,b,c,d,e]
wait = []
for i in List:
    tmp = 10-i%10
    if tmp ==10:
        tmp = 0
    wait.append(tmp)
print(wait)
for i in range(5):
    ans += List[i]+wait[i]
print(ans-max(wait))

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
ans = 0
List = [a,b,c,d,e]
wait = []
for i in List:
    tmp = 10-i%10
    if tmp ==10:
        tmp = 0
    wait.append(tmp)

for i in range(5):
    ans += List[i]+wait[i]
print(ans-max(wait))