qyliang/CodeNanoFix huggingface dataset:
Buggy code:
ss = [int(input()) for i in range(5)]
import itertools
mm = list(itertools.permutations(ss))
ans = 0
anss = 10**9
for sc in mm:
    ans = 0
    for i in range(len(sc)):
        if i == 4:
            ans += sc[i]
        else:
            ans += round(sc[i],-1)
    anss = min(anss , ans)
print(anss)

Fixed code:
import itertools
ss = [int(input()) for i in range(5)]
mm = list(itertools.permutations(ss))
ans = 0
anss = 10**9
for sc in mm:
    ans = 0
    for i in range(len(sc)):
        if i == 4:
            ans += sc[i]
        else:
            ans += -(-sc[i]//10)*10
    anss = min(anss , ans)
print(anss)
Buggy code:
array1 = [int(input()) for i in range(5)]
array2 = [i % 10 for i in array1]
array3 = [i for i in array2 if i != 0]
idx = array3.index(min(array3))
sum1 = 0
sum2 = sum(array2)
for k, i in enumerate(array3):
  if (k == idx):
    sum1 += i
  else:
    sum1 += i + (10 - i % 10)
print(sum1 + sum2)

Fixed code:
array1 = [int(input()) for i in range(5)]
array2 = [i for i in array1 if i % 10 == 0]
array3 = [i for i in array1 if i % 10 != 0]
array4 = [i % 10 for i in array3]
sum1 = 0
sum2 = sum(array2)
if (len(array3) != 0):
  idx = array4.index(min(array4))
  for k, i in enumerate(array3):
    if (k == idx):
      sum1 += i
    else:
      sum1 += i + (10 - i % 10)
print(sum1 + sum2)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
count = 10
num = 0
num1 = 0


def f(x):
    return x +10 - (x%10)


list1 = [a,b,c,d,e]
for i in range(5):
    if count > list1[i] % 10 and list1[i]%10!=0:
        count = list1[i]%10
        num = i

for j in range(5):
    if j ==num:
        num1 += list1[j]
    else:
        num1 += f(list1[j])
    
print(num1)
 
 



Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
count = 10
num = 0
num1 = 0


def f(x):
    return x + 10 - (x%10)


list1 = [a,b,c,d,e]
for i in range(len(list1)):
    if count > list1[i] % 10 and list1[i]%10 != 0:
        count = list1[i]%10
        num = i

for j in range(len(list1)):
    if j == num:
        num1 += list1[j]
    elif list1[j]%10==0:
        num1 += list1[j]        
    else:
        num1 += f(list1[j])
    
print(num1)
Buggy code:
import math
fp = 10
ans = 0
for i in range(5):
    a = int(input())
    ans+= math.ceil(a/10)*10
    if a%10!=0:
    fp =  min(fp, a%10)
print(ans+fp-10 if fp@!=10 else ans )

Fixed code:
import math
fp = 10
ans = 0
for i in range(5):
    a = int(input())
    ans+= math.ceil(a/10)*10
    if a%10!=0:
        fp =  min(fp, a%10)
print(ans+fp -10 if fp!=10 else ans )
Buggy code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

MIN = 0
ans = 0
for i in (A,B,C,D,E):
    if i % 10 != 0:
        MIN = min(MIN, i % 10)
        ans += i - i % 10 + 10
    else:
        ans += i
ans -= MIN
print(ans)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

MIN = 10
ans = 0
for i in (A,B,C,D,E):
    if i % 10 != 0:
        MIN = min(MIN, i % 10)
        ans += i - i % 10 + 10
    else:
        ans += i
ans -= 10 - MIN
print(ans)
Buggy code:
l = []
for _ in range(5):
    l.append(int(input()))

a = sum(list(map(lambda x: ((x-1)//10)*10+10, l)))

b = min(list(map(lambda x: (x-1)%10, l)))+1

print(a - b)

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

a = sum(list(map(lambda x: ((x-1)//10)*10+10, l)))

b = min(list(map(lambda x: (x-1)%10, l)))+1

print(a + b - 10)
Buggy code:
a = int(input())
b= int(input())
c = int(input())
d = int(input())
e = int(input())
l = [] 
for i in [a,b,c,d,e]:
    if i % 10 != 0: 
        l.append(i//10*10+10-i)
print(sum([a,b,c,d,e])+sum(sorted(l):-1]))

Fixed code:
a = int(input())
b= int(input())
c = int(input())
d = int(input())
e = int(input())
l = [] 
for i in [a,b,c,d,e]:
    if i % 10 != 0: 
        l.append(i//10*10+10-i)
print(sum([a,b,c,d,e])+sum(sorted(l)[:-1]))
Buggy code:
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = miin(m % 10 for m in [a,b,c,d,e] if m % 10 != 0)
time = 10 * (ceil(a / 10) + ceil(b / 10)+ ceil(c / 10)+ ceil(d / 10)+ ceil(e / 10)) - (10 - sub)
print(int(time))



Fixed code:
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sub = min([m % 10 for m in [a,b,c,d,e] if m % 10 != 0] + [10])
time = 10 * (math.ceil(a / 10) + math.ceil(b / 10)+ math.ceil(c / 10)+ math.ceil(d / 10)+ math.ceil(e / 10)) - (10 - sub)
print(int(time))
Buggy code:
l = [ int(input()) for _ in range(5) ]
r = sorted([ 10-((10-i)%10) for i in l ])
print()
u = [ -(-i//10) for i in l ]
print(sum(u)-(10-r[0]))

Fixed code:
l = [ int(input()) for _ in range(5) ]
r = sorted([ 10-((10-i)%10) for i in l ])
u = [ -(-i//10)*10 for i in l ]
print(sum(u)-(10-r[0]))
Buggy code:
from itertools import permutations
from math import ceil
    
  
time_list = []
for i in range(5):
    time_list.append(int(input()))


min_time = float('inf')


for order in list(permutations([0,1,2,3,4])):
    total = 0
    for i in range(5):
        total += time_list[order[i]]
        if i!=4:
            total = ceil(total / 10) * 10
        print(total)
    min_time = min(min_time, total)
   
  
print(min_time)

Fixed code:
from itertools import permutations
from math import ceil
    

time_list = []
for i in range(5):
    time_list.append(int(input()))
    

min_time = float('inf')


for order in list(permutations([0,1,2,3,4])):
    total = 0
    for i in range(5):
        total += time_list[order[i]]
        if i!=4:
            total = ceil(total / 10) * 10
    min_time = min(min_time, total)
   
  
print(min_time)
Buggy code:
l=sorted(list(map(int,open(0))),key=lambda x:x%10)
print(sum([i+10-i%10 for i in l])-l[-1]%10)

Fixed code:
l=sorted(list(map(int,open(0))),key=lambda x:-x%10)
print(sum([i+(-i%10) for i in l[:4]])+l[4])
Buggy code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

dish = [a,b,c,d,e]
result=0

mx=-1

for dd in dish:
    for i in range(1,10):
        if (dd+i) % 10 == 0:
            tmp=i
            break
    if tmp >= mx:
        mx = tmp
        buf=dd

dish.remove(buf)

for i in range(4):
    result+=dish[i]
    for j in range(1,10):
        if result % 10 ==0:
            break
        result+=1

print(result+buf)

Fixed code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

dish = [a,b,c,d,e]
result=0

mx=-1

for dd in dish:
    for i in range(0,10):
        if (dd+i) % 10 == 0:
            tmp=i
            break
    if tmp > mx:
        mx = tmp
        buf=dd

dish.remove(buf)

for dd in dish:
    result+=dd
    for i in range(1,10):
        if result % 10 == 0:
            break
        result+=1
        
print(result+buf)
Buggy code:
order = [int(input()) for i in range(5)]
diff = (sorted(map(lambda x: (x % 10), order)))
diff = [i for i in diff if i != 0]

sum_order = sum(list(map(lambda x: -(-x //10), order))) * 10

if diff != []:
    sum_order += diff[0]
    
print (sum_order)

Fixed code:
order = [int(input()) for i in range(5)]
diff = (sorted(map(lambda x: (x % 10), order)))
diff = [i for i in diff if i != 0]

sum_order = sum(list(map(lambda x: -(-x //10), order))) * 10

if diff != []:
    sum_order += (-10 + diff[0])
    
print (sum_order)
Buggy code:
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a = ni()
b = ni()
c = ni()
d = ni()
e = ni()

f = min(a%10,b%10,c%10,d%10,e%10)

ans = (a+9)//10+(b+9)//10+(c+9)//10+(d+9)//10+(e+9)//10

print(ans*10+f-10)

Fixed code:
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a = ni()
b = ni()
c = ni()
d = ni()
e = ni()

f = min((a-1)%10,(b-1)%10,(c-1)%10,(d-1)%10,(e-1)%10)

ans = (a+9)//10+(b+9)//10+(c+9)//10+(d+9)//10+(e+9)//10

print(ans*10+f-9)
Buggy code:
ans=0
t=[]
tmp=10
for i in range(5):
    t.append(int(input()))
    if t[i]%10!=0 and t[i]%10<tmp:
        tmp=t[i]%10
print(tmp)
flg=0
for i in range(5):
    if (t[i]%10!=tmp or flg==1) and t[i]%10==0:
        ans+=t[i]
    elif (t[i]%10!=tmp or flg==1) and t[i]%10!=0:
        ans+=(t[i]//10+1)*10
    elif t[i]%10==tmp and flg==0:
        ans+=t[i]
        flg=1
print(ans)


Fixed code:
ans=0
t=[]
tmp=10
for i in range(5):
    t.append(int(input()))
    if t[i]%10!=0 and t[i]%10<tmp:
        tmp=t[i]%10
#print(tmp)
flg=0
for i in range(5):
    if (t[i]%10!=tmp or flg==1) and t[i]%10==0:
        ans+=t[i]
    elif (t[i]%10!=tmp or flg==1) and t[i]%10!=0:
        ans+=(t[i]//10+1)*10
    elif t[i]%10==tmp and flg==0:
        ans+=t[i]
        flg=1
print(ans)
Buggy code:
import math

list = []
for i in range(5):
    a = int(input())
    list.append(a)
sum = 0
zeroList = [list[i] for i in range(len(list)) if list[i]%10 == 0]
otherList = [list[i] for i in range(len(list)) if not list[i]%10 == 0]
def func(x):
    return x % 10
otherList.sort(key=func)
print(otherList)
for i in range(len(zeroList)):
    sum += zeroList[i]
    print(sum)
for i in (otherList[1:]):
    sum += math.ceil(i/10)*10
sum += otherList[0]
print(sum)


Fixed code:
import math

list = []
for i in range(5):
    list.append(int(input()))
sum = 0
zeroList = [list[i] for i in range(len(list)) if list[i]%10 == 0]
otherList = [list[i] for i in range(len(list)) if not list[i]%10 == 0]
def func(x):
    return x % 10
otherList.sort(key=func)
for i in range(len(zeroList)):
    sum += zeroList[i]
for i in (otherList[1:]):
    sum += math.ceil(i/10)*10
if not len(otherList) == 0:
    sum += otherList[0]
print(sum)
Buggy code:
s=[int(input()) for _ in range(5)]
k=[s[i]%10 for i in range(5)]
l=[]
for i in range(5):
    if k[i] !=0:
        l.append(10-k[i])
    else:
        l.append(0)
l=max(k)
m=sum(s)
n=sum(k)
print(int(m+n-l))

Fixed code:
s=[int(input()) for _ in range(5)]
k=[s[i]%10 for i in range(5)]
l=[]
for i in range(5):
    if k[i] !=0:
        l.append(10-k[i])
    else:
        l.append(0)
p=max(l)
m=sum(s)
n=sum(l)
print(int(m+n-p))
Buggy code:
A=[int(input()) for i in range(5)]
B=[10 if A[i]%10==0 else A[i]%10 for i in range(5)]
print((sum(A)-A[B.index(min(B))])//10*10+10+A[B.index(min(B))])

Fixed code:
A=[int(input()) for i in range(5)]
B=[10 if A[i]%10==0 else A[i]%10 for i in range(5)]
k=B.index(min(B))
C=[(A[i]-0.001)//10*10+10 for i in range(5)]
print(int(sum(C)-C[k]+A[k]))
Buggy code:
import itertools

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
array = [A, B, C, D, E]
min_time= float('inf')

for i in list(itertools.permutations(array)):
    tmp = i[0] + (10 - i[0]%10)
    tmp += i[1] + (10 - i[1]%10)
    tmp += i[2] + (10 - i[2]%10)
    tmp += i[3] + (10 - i[3]%10)
    tmp += i[4]
    
    min_time = min(min_time, tmp)
    
print(min_time)

Fixed code:
import itertools

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
array = [A, B, C, D, E]
min_time= float('inf')

for i in list(itertools.permutations(array)):
    tmp = i[0] + ((10 - i[0]%10) if i[0] % 10 != 0 else 0)
    tmp += i[1] + ((10 - i[1]%10)  if i[1] % 10 != 0 else 0)
    tmp += i[2] + ((10 - i[2]%10) if i[2] % 10 != 0 else 0)
    tmp += i[3] + ((10 - i[3]%10) if i[3] % 10 != 0 else 0)
    tmp += i[4]
    
    min_time = min(min_time, tmp)
    
print(min_time)
Buggy code:
import sys
input=sys.stdin.read
*x,=map(int, input().split("\n"))
tmp=100
for i in range(5):
    if x[i]%10:
        tmp = min(tmp,x[i]%10)
        x[i]//=10
        x[i]*= 10
        x[i]+=10
ans= sum(x)
if tmp<100:
    ans-=10
    ans+=tmp
print(ans)
    


Fixed code:
#import sys
#input=sys.stdin.read
#*x,=map(int, input().split("\n"))
x=[int(input()) for _ in range(5)]
tmp=100
for i in range(5):
    if x[i]%10:
        tmp = min(tmp,x[i]%10)
        x[i]//=10
        x[i]*= 10
        x[i]+=10
ans= sum(x)
if tmp<100:
    ans-=10
    ans+=tmp
print(ans)
Buggy code:
A = [0] * 5

A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

maximum = 0
for i in range(5):
  tmp = (A[i] // 10 + 1) * 10 - A[i]
  A[i] = (A[i] // 10 + 1) * 10
  if tmp > maximum:
    maximum = tmp
    
print(sum(A) - maximum)

Fixed code:
A = [0] * 5

A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

maximum = 0
for i in range(5):
  tmp = (A[i] // 10 + 1) * 10 - A[i]
  if tmp == 10:
    tmp = 0
  else:
    A[i] = (A[i] // 10 + 1) * 10
  if tmp > maximum:
    maximum = tmp
    
print(sum(A) - maximum)
Buggy code:
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i%10!=0 ])
print(df)
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
print(sum-10+df)

Fixed code:
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i % 10 != 0 ],default=0)
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
if(df == 0):
        print(sum)
else:
        print(sum-df)
Buggy code:
foods = [int(input()) for i in range(5)]

li = []
for i in range(5):
    if foods[i] % 10 != 0:
        li.append(10-foods[i]%10)
        foods[i] += (10-foods[i]%10)
if li = []:
    ans = sum(foods)
else:    
    ans = sum(foods) - max(li)
print(ans)

Fixed code:
foods = [int(input()) for i in range(5)]

li = []
for i in range(5):
    if foods[i] % 10 != 0:
        li.append(10-foods[i]%10)
        foods[i] += (10-foods[i]%10)
if li == []:
    ans = sum(foods)
else:    
    ans = sum(foods) - max(li)
print(ans)
Buggy code:
n =  [int(input()) for x in range(5)]
minNum = 10
array = 0
for i in range(len(n)):
    num = i % 10
    if(num <= minNum):
        minNum = num
        array = i
numList = []
a = n[array]
n[array] = 0
for x in n:
    k = ((x + 9) // 10) * 10
    numList.append(k)
    
print(sum(numList) + a)

Fixed code:
n =  [int(input()) for x in range(5)]
minNum = 10
array = 0
for i in range(len(n)):
    num = n[i] % 10
    if((num <= minNum) and (num != 0)):
        minNum = num
        array = i
        
numList = []
a = n[array]
n[array] = 0

for x in n:
    k = ((x + 9) // 10) * 10
    numList.append(k)  
print(sum(numList) + a)
Buggy code:
print('Enter values!!')
abc = int(input())
arc = int(input())
agc = int(input())
apc = int(input())
atc = int(input())

food_time = [abc, arc, agc, apc, atc]
sort_time = [0, 0, 0, 0, 0]
total_time = 0


for i in range(5):
    sort_time[i] = food_time[i] % 10
    if food_time[i] % 10 == 0:
        total_time += food_time[i]
    else:
        a = food_time[i] // 10
        a = a * 10 + 10
        total_time += a

sort_time.sort()

for j in range(5):
    if sort_time[j] != 0:
        b = 10-sort_time[j]
        total_time -= b
        break

print(total_time)

Fixed code:
#print('Enter values!!')
abc = int(input())
arc = int(input())
agc = int(input())
apc = int(input())
atc = int(input())

food_time = [abc, arc, agc, apc, atc]
sort_time = [0, 0, 0, 0, 0]
total_time = 0


for i in range(5):
    sort_time[i] = food_time[i] % 10
    if food_time[i] % 10 == 0:
        total_time += food_time[i]
    else:
        a = food_time[i] // 10
        a = a * 10 + 10
        total_time += a

sort_time.sort()

for j in range(5):
    if sort_time[j] != 0:
        b = 10-sort_time[j]
        total_time -= b
        break

print(total_time)
Buggy code:
a = [int(input()) for i in range(5)]
b = [g%10 for g in a]
kkk = 9
h = 0
for i in range(len(a)):
    g = a[i] % 10
    if g > 0 and g < kkk:
        kkk = g
        h = i
l = a[h]
a.pop(h)
a.append(l)
print(a)
total = 0
for i in a:
    if total % 10 != 0:
        total += 10 - (total % 10)
    total += i

print(total)


Fixed code:
a = [int(input()) for i in range(5)]
b = [g%10 for g in a]
kkk = 9
h = 0
for i in range(len(a)):
    g = a[i] % 10
    if g > 0 and g < kkk:
        kkk = g
        h = i
l = a[h]
a.pop(h)
a.append(l)
total = 0
for i in a:
    if total % 10 != 0:
        total += 10 - (total % 10)
    total += i

print(total)
Buggy code:
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10
		
	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	print(min_r,min_d,i,sm)


print(sm - (10-min_r))

Fixed code:
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
min_r = 10
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10

	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	#print(min_r,min_d,i,sm)


print(sm - (10-min_r))
Buggy code:
li=[]
li2=[]
ans=0
for i in 5:
  li.append(int(input()))
for i in 5:
  li2.append=(li[i]-1)%10
for i in 5:
  ans+=(li[i]//10)*10
print(ans+min(li2)+1)

Fixed code:
li=[]
li2=[]
ans=0
for i in range(5):
  li.append(int(input()))
for i in range(5):
  li2.append((li[i]-1)%10)
for i in range(5):
  ans+=((li[i]-1)//10)*10
print(ans+min(li2)+41)
Buggy code:
a=[int(input()) for i in range (5)]
m=[]
s=0
for i in range(5):
    x=a[i]%10
    if x!=0:
        s+=a[i]+10-x
    else:
        s+=a[i]
for k in range(5):
    y=a[k]%10
    b=s
    if y!=0:
        n=10-y
        b=s-n
        m.append(b)
    else:
        m.append(b)
print(min(m)

Fixed code:
a=[int(input()) for i in range (5)]
m=[]
s=0
for j in range(5):
    x=a[j]%10
    if x!=0:
        s+=a[j]+10-x
    else:
        s+=a[j]
for k in range(5):
    y=a[k]%10
    b=s
    if y!=0:
        n=10-y
        b=b-n
        m.append(b)
    else:
        m.append(b)
print(min(m))
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

g = []
g.append(a)
g.append(b)
g.append(c)
g.append(d)
g.append(e)

G = []

A=a%10
B=b%10
C=c%10
D=d%10
E=e%10

G.append(A)
G.append(B)
G.append(C)
G.append(D)
G.append(E)

min_except0 = G[:]

for i in range(4):
    try:
        min_except0.remove(0)
    except:
        pass
x = G.index(min(min_except0))

loop = [0,1,2,3,4]
loop.remove(x)

answer = 0
for i in loop:
  answer += g[i]
  answer += 10-G[i]
  print(answer)
answer += g[x]

minas = 10*(5 - len(min_except0))

answer -= minas

print(answer)


Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

g = []
g.append(a)
g.append(b)
g.append(c)
g.append(d)
g.append(e)

G = []

A=a%10
B=b%10
C=c%10
D=d%10
E=e%10

G.append(A)
G.append(B)
G.append(C)
G.append(D)
G.append(E)

min_except0 = G[:]

for i in range(4):
    try:
        min_except0.remove(0)
    except:
        pass
x = G.index(min(min_except0))

loop = [0,1,2,3,4]
loop.remove(x)

answer = 0
for i in loop:
  answer += g[i]
  answer += 10-G[i]
answer += g[x]

minas = 10*(5 - len(min_except0))

answer -= minas

print(answer)
Buggy code:
num=[]
a=[] 
time = 0 
for i in range(5):
    num.append(int(input()))
    if num[i]%10 == 0:
        a.append(0)
    else:
        a.append(10 - num[i]%10)
    time += num[i] + a[i]

time -= max(a)
time

Fixed code:
num=[]
a=[] 
time = 0 
for i in range(5):
    num.append(int(input()))
    if num[i]%10 == 0:
        a.append(0)
    else:
        a.append(10 - num[i]%10)
    time += num[i] + a[i]

time -= max(a)

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

ans = 0
tmp = []

for i in range(len(L)):
    if(L[i]%10 == 0):
        ans += L[i]
    else:
        ans += L[i] + (10 - L[i]%10)
        tmp.append(L[i]%10)

ans -= min(tmp)

print(ans)


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

ans = 0
tmp = []

for i in range(len(L)):
    if(L[i]%10 == 0):
        ans += L[i]
    else:
        ans += L[i] + (10 - L[i]%10)
        tmp.append(L[i]%10)

if(len(tmp) > 0):
    ans -= 10 - min(tmp)

print(ans)
Buggy code:
def abc(n):
    if n % 10 == 0:
        return n
    else:
        return n + 10 - (n%10)

ans = 0
mods = []

for _ in range(5):
    tmp = int(input())
    ans += abc(tmp)
    mods.append(tmp%10)

if not set(mods) == {0}:
    ans -= 10
    ans += min(mods)

print(ans)

Fixed code:
def abc(n):
    if n % 10 == 0:
        return n
    else:
        return n + 10 - (n%10)

ans = 0
mods = []

for _ in range(5):
    tmp = int(input())
    ans += abc(tmp)
    mods.append(tmp%10)

if not set(mods) == {0}:
    while 0 in mods:
        mods.remove(0)
    ans -= 10
    ans += min(mods)

print(ans)
Buggy code:
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())
sample_list = []
sample_list.append(a)
sample_list.append(b)
sample_list.append(c)
sample_list.append(d)
sample_list.append(e)
x = []
for i in sample_list:
  if i%10 = 0:
    x.append(0)
  else:
    x.append(10-(i%10))
print(sam(sample_list)+sam(x)-max(x))

Fixed code:
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())
sample_list = []
sample_list.append(a)
sample_list.append(b)
sample_list.append(c)
sample_list.append(d)
sample_list.append(e)
x = []
for i in sample_list:
  if i%10 == 0:
    x.append(0)
  else:
    x.append(10-(i%10))
print(sum(sample_list)+sum(x)-max(x))
Buggy code:
t=[0]*5
for i in range(5):
    t[i]=int(input())
ans=0
min=10
c=0
for i in range(5):
    if t[i]%10!=0 and t[i]%10<min:
        c=i
        min=t[i]
for i in range(5):
    if i==c:
        ans+=t[i]
    elif t[i]%10==0:
        ans+=t[i]
    else:
        ans+=t[i]-t[i]%10+10
print(ans)

Fixed code:
t=[0]*5
for i in range(5):
    t[i]=int(input())
ans=0
min=10
c=6
for i in range(5):
    if t[i]%10!=0 and t[i]%10<min:
        c=i
        min=t[i]%10
for i in range(5):
    if i==c:
        ans+=t[i]
    elif t[i]%10==0:
        ans+=t[i]
    else:
        ans+=t[i]-t[i]%10+10
print(ans)
Buggy code:
import itertools
dishes=[int(input()) for i in range(5)]
all_comb=list(itertools.permutations(dishes))
t_min=123*5
for comb in all_comb:
  t=0
  for i in range(4):
    t=int((t+comb[i]-1)/10)*10+10
  t=t+comb[4]
  if t < t_min:
    t_min=t
print(t_min)


Fixed code:
import itertools
dishes=[int(input()) for i in range(5)]
all_comb=list(itertools.permutations(dishes))
t_min=123*50
for comb in all_comb:
  t=0
  for i in range(4):
    t=int((t+comb[i]-1)/10)*10+10
  t=t+comb[4]
  if t < t_min:
    t_min=t
print(t_min)
Buggy code:
mx = 0
s = 0
for _ in range(5):
  ai = int(input())
  if ai%10 == 0:
    s += ai
  else:
    s += ai//10+10
    if 10-ai%10 > mx:
      mx = 10-ai%10
print(s-mx)
  

Fixed code:
mx = 0
s = 0
for _ in range(5):
  ai = int(input())
  if ai%10 == 0:
    s += ai
  else:
    s += 10*(ai//10)+10
    if 10-ai%10 > mx:
      mx = 10-ai%10
print(s-mx)
Buggy code:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

#time_residual = [i%10 for i in time]
# print(time_residual)

#time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

#ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
#print(ans)

Fixed code:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

if(time_residual_notZero != []):
    ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
else:
    ans = sum(time)
print(ans)
Buggy code:
a=[0]*5
for i in range(5):
    a[i]=int(input())
ha=10
for i in range(5):
    if a[i]%10!=0:
        ha=min(ha,a[i]%10)
ans=0
for i in range(5):
    if a[1]%10==0:
        ans+=a[i]
    else:
        ans+=a[i]+(10-a[i]%10)
print(ans-(10-ha))

Fixed code:
a=[0]*5
for i in range(5):
    a[i]=int(input())
ha=10
for i in range(5):
    if a[i]%10!=0:
        ha=min(ha,a[i]%10)
ans=0
for i in range(5):
    if a[i]%10==0:
        ans+=a[i]
    else:
        ans+=a[i]+(10-a[i]%10)
print(ans-(10-ha))