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

ans = 0
min_div = 10
for i in l:
  ans += 10 * (i + 10 - 1) //10
  min_div = min(min_div, i % 10)
print(ans - (10 - min_div))

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

ans = 0
min_div = 10
for i in l:
  ans += 10 * ((i + 10 - 1) //10)
  if i % 10 != 0:
  	min_div = min(min_div, i % 10)
print(ans - (10 - min_div))
Buggy code:
m=[]
cnt=0
for i in range(5):
    x=int(input())
    menu.append(x)
m10=[i % 10 for i in m if i %10 >=1]
t=min(m10)
for i in m:
    if i %10==0:
        cnt += i
    else:
        cnt += ((i//10)+1)*10
print(cnt-t)

Fixed code:
m=[]
cnt=0
for i in range(5):
    x=int(input())
    m.append(x)
m10=[i % 10 for i in m if i %10 >=1]
if m10:
    t=min(m10)
    for i in m:
        if i %10==0:
            cnt += i
        else:
            cnt += ((i//10)+1)*10
    print(cnt-10+t)
else:
    print(sum(m))
Buggy code:
a = [int(input()) for i in range(5)]
n=0
ans =0
for x in a:
  if x % 10 !=0:
    t = 10 -x%10
  else:
    t=0
  n=max(n,t)
print(ans-n)

Fixed code:
a = [int(input()) for i in range(5)]
n=0
ans =0
for x in a:
  if x % 10 !=0:
    t = 10 -x%10
  else:
    t=0
  n=max(n,t)
  ans +=x+t
print(ans-n)
Buggy code:
 
import itertools
#import time

#t1 = time.time()

num = [int(input()) for _ in range(5)]
#num2 = [n if n % 10 == 0 else n - (n%10) + 10  for n in num]

N = []

for i in list(itertools.permutations(range(5))):
    c = 0
    n = 0
#    print(i)
    for j in i:
        c += 1
 #       print(j)
        if c == 5:
            n += num[j]
#            print(n)
        else:
            n += num[j] - (num[j] % 10) + 10
 #           print(n)
    N.append(n)

print(int(min(N)))

#t2 = time.time()

#print(t2-t1)


Fixed code:
 
import itertools
#import time

#t1 = time.time()

num = [int(input()) for _ in range(5)]
#num2 = [n if n % 10 == 0 else n - (n%10) + 10  for n in num]

N = []

for i in list(itertools.permutations(range(5))):
    c = 0
    n = 0
#    print(i)
    for j in i:
        c += 1
 #       print(j)
        if c == 5:
            n += num[j]
#            print(n)
        else:
            if num[j]%10 == 0: n+=num[j]
            else:n += num[j] - (num[j] % 10) + 10
 #           print(n)
    N.append(n)

print(int(min(N)))

#t2 = time.time()

#print(t2-t1)
Buggy code:
import math
 
num = [int(input()) for _ in range(5)]
num2 = [n if n % 10 == 0 else n - (n%10) + 10  for n in num]

c = []
for i, j  in enumerate(num):
    n = j
    for k,l in enumerate(num2):
        if  k == i:
            continue
        else:
            n += l
	c.append(n)
print(min(c))


Fixed code:
num = [int(input()) for _ in range(5)]
num2 = [n if n % 10 == 0 else n - (n%10) + 10  for n in num]

c = []
for i, j  in enumerate(num):
    n = j
    for k,l in enumerate(num2):
        if  k == i:
            continue
        else:
            n += l
    c.append(n)

print(int(min(c)))
Buggy code:
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]
T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))
print(T_0,T_o,T_c,T_s)
if T_0 != np.array([0,0,0,0,0]):
    A = np.sum(T_c) - 10 + np.sum(T_0) + T_s[0]
    print(A)
else:
    A = np.sum(T_0)
    print(A)

Fixed code:
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]

T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))
if T_0.size == 5:
    print(np.sum(T_0))
else:
    print(np.sum(T_c) - 10 + np.sum(T_0) + T_s[0])
Buggy code:
nums = [int(input()) for _ in range(5)]
mn = float('inf')

for i in nums:
    if i%10!=0:
        mn = min(mn, i%10)
if mn == float('inf'):
    mn = 0

print(sum(list(map(lambda x: int(math.ceil(x/10)*10), nums)))-10+mn)


Fixed code:
import math
nums = [int(input()) for _ in range(5)]
mn = float('inf')

for i in nums:
    if i%10!=0:
        mn = min(mn, i%10)
if mn == float('inf'):
    mn = 10

print(sum(list(map(lambda x: int(math.ceil(x/10)*10), nums)))-10+mn)
Buggy code:
d=[]

for i in range(5):
    s=int(input())
    d.append((s,s+(10-s%10),10-s%10))

d.sort(key=lambda d:d[2])
result=0
result=sum(d[i][1] for i in range(len(d)-1)) + d[-1][0]

print(result)



Fixed code:
d=[]

for i in range(5):
    s=int(input())
    if s%10 == 0:
        d.append((s,s,s%10))
    else:
        d.append((s,s+(10-s%10),10-s%10))

d.sort(key=lambda d:d[2])
result=0
result=sum(d[i][1] for i in range(len(d)-1)) + d[-1][0]

print(result)
Buggy code:
import math
l=[]
for i in range(5):
  l=l+[int(input())]

li=[i%10 for i in l]
minimum=min(li)
ans=0
for i in l:
  if i != l[li.index(minimum)]:
    ans+=math.ceil(i/10)*10
  else:
    ans+=i
print(ans)

Fixed code:
import math
l=[]
for i in range(5):
  l=l+[int(input())]

li=[i%10 for i in l]
lil = [i for i in li if i!=0]
if lil:
  minimum=min([i for i in li if i!=0])
else:
  minimum=0
ans=l.pop(li.index(minimum))
for i in l:
  ans+=math.ceil(i/10)*10

print(ans)
Buggy code:
A = [int(input()) for _ in [0]*5]
B = [-(-a//10)*10 - a for a in A]
print(B)
print(sum(B) + sum(A) - max(B))

Fixed code:
A = [int(input()) for _ in [0]*5]
B = [-(-a//10)*10 - a for a in A]
print(sum(B) + sum(A) - max(B))
Buggy code:
a,b,c,d,e=[int(input()) for i in range(5)]
a1=a//10
a2=a%10
if a2==0:
    a1-=1
b1=b//10
b2=b%10
if b2==0:
    b1-=1
c1=c//10
c2=c%10
if c2==0:
    c1-=1
d1=d//10
d2=d%10
if d2==0:
    d1-=1
n=e//10
m=e%10
if m==0:
    n-=1
min1=min(a2,b2,c2,d2,m)
if a1==0 or b1==0 or c1==0 or d1==0 or n==0:
    ans=(a1+b1+c1+d1+n+5)*10+min1
else:
    ans=(a1+b1+c1+d1+n+4)*10+min1
print(ans)


Fixed code:
a,b,c,d,e=[int(input()) for i in range(5)]
a1=a//10
a2=a%10
if a2==0:
    a1-=1
    a2=10
b1=b//10
b2=b%10
if b2==0:
    b1-=1
    b2=10
c1=c//10
c2=c%10
if c2==0:
    c1-=1
    c2=10
d1=d//10
d2=d%10
if d2==0:
    d1-=1
    d2=10
n=e//10
m=e%10
if m==0:
    n-=1
    m=10
min1=min(a2,b2,c2,d2,m)
if a2==10 or b2==10 or c2==10 or d2==10 or m==10:
    ans=(a1+b1+c1+d1+n+4)*10+min1
else:
    ans=(a1+b1+c1+d1+n+4)*10+min1
print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
li = [a, b, c, d, e]

l1 = [i % 10 for i in li]
min_idx = -1
for i in range(len(l1)):
    if min_idx == -1 or l1[i] != 0 and l1[i] < l1[min_idx]:
        min_idx = i
last = li.pop(min_idx)
print(last)

output = 0
for x in li:
    if x % 10 != 0:
        x = x - (x % 10) + 10
    output += x
print(output + last)


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

l1 = [i % 10 for i in li]
min_idx = -1
for i in range(len(l1)):
    if min_idx == -1 or l1[i] != 0 and l1[i] < l1[min_idx]:
        min_idx = i
last = li.pop(min_idx)

output = 0
for x in li:
    if x % 10 != 0:
        x = x - (x % 10) + 10
    output += x
print(output + last)
Buggy code:
A = [int(input()) for i in range(5)]

ans = 0
remain = 9
for a in A:
  if a%10 == 0:
    ans += a//10
  else:
    ans += (a+10)//10
    remain = min(remain, a%10)
    
print(ans * 10 + remain)

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

ans = 0
remain = 10
for a in A:
  if a%10 == 0:
    ans += a//10
    #print(a,a//10)
  else:
    ans += (a+10)//10
    #print(a,(a+10)//10)
    remain = min(remain, a%10)
    
print(ans * 10 + remain -10)
Buggy code:
import math
A = [int(input()) for _ in range(5)]
A.sort()
print([(i//10+1)*10 for i in A])
print(sum([math.ceil(i/10)*10 for i in A])  -max([10-i for i in [ (i % 10) for i in A] if i != 0]))



Fixed code:
import math
A = [int(input()) for _ in range(5)]
print(sum([math.ceil(i/10)*10 for i in A])  -max([10-i for i in [ (i % 10) for i in A] if i != 0] +[0]))
Buggy code:
l = [int(input()) for i in range(5)]

import math

sum([math.ceil(i/10) * 10 for i in l]) - max([math.ceil(i/10) * 10 - i for i in l])

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

import math

print(sum([math.ceil(i/10) * 10 for i in l]) - max([math.ceil(i/10) * 10 - i for i in l]))
Buggy code:
data = [int(input()) for _ in range(5)]

a = 0
for i, d in enumerate(data):
    a = max(10 - d % 10, a)
    data[i] = d + (10 - d % 10)
    
print(sum(data) - a)

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

m = 0
for i, d in enumerate(data):
    a = 10 - d % 10
    if a == 10:
        a = 0
    m = max(a, m)
    data[i] = d + a
    
print(sum(data) - m)
Buggy code:
a=[]
b=[]
ori=[]
ans=0
for i in range(5):
  c=int(input())
  ori.append(c)
  a.append((c//10+1)*10)
  
  if c%10==0:
    b.append(100)
  else:
    b.append(c%10)
a.pop(b.index(min(b)))
print(ori[b.index(min(b))]+a.sum())

Fixed code:
a=[]
b=[]
ori=[]
ans=0
for i in range(5):
  c=int(input())
  ori.append(c)
  if c%10!=0:
    a.append((c//10+1)*10)
  else:
    a.append(c)
  
  if c%10==0:
    b.append(100)
  else:
    b.append(c%10)
a.pop(b.index(min(b)))
print(ori[b.index(min(b))]+sum(a))
Buggy code:
lst = []
for i in range(5):
  lst.append(int(input())
lst.sort(reverse=True, key = lambda x : (x - 1) % 10)
s = 0
for i in lst:
    s += i
    if i != lst[4]:
        s += 10 - s % 10

print(s)

Fixed code:
lst = []
for i in range(5):
    lst.append(int(input()))
lst.sort(reverse=True, key = lambda x : (x - 1) % 10)
s = 0
for i in range(5):
    s += lst[i]
    if s % 10 != 0 and i != 4:
        s += 10 - s % 10

print(s)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

m = 9
a = [A, B, C, D, E]

for i in range(len(a)):

 if a[i] % 10 <= m and a[i] % 10 != 0:
    m = a[i] % 10


for j in range(len(a)):
  if a[j] % 10 != 0:
     a[j] = a[j] + (10 - a[j] % 10)

print(m)

print(sum(a) - (10 - m))

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

m = 10
a = [A, B, C, D, E]

for i in range(len(a)):

 if a[i] % 10 <= m and a[i] % 10 != 0:
     m = a[i] % 10


for j in range(len(a)):
  if a[j] % 10 != 0:
     a[j] = a[j] + (10 - a[j] % 10)

print(sum(a) - (10 - m))
Buggy code:
import numpy as np

i = 0
j = 0

nums = []
first_digits = []
min_first_digit = 9
index = 0
sum = 0

while i < 5:
  x = int(input())
  nums.append(x)
  
  if x % 10 < min_first_digit and x % 10 != 0:
    min_first_digit = x % 10
    index = i
  i += 1
  
while j < 5:
  if j == index:
    sum += nums[j]
  else:
    sum += round(nums[j], -1)
  j += 1
    
print(sum)

  


Fixed code:
import numpy as np

i = 0
j = 0

nums = []
first_digits = []
min_first_digit = 9
index = 0
sum = 0

while i < 5:
  x = int(input())
  nums.append(x)
  
  if x % 10 <= min_first_digit and x % 10 != 0:
    min_first_digit = x % 10
    index = i
  i += 1
  
while j < 5:
  if j == index:
    sum += nums[j]
  else:
    if nums[j] % 10 == 0:
      sum += nums[j]
    else:
      sum += (nums[j] + 10 - (nums[j] % 10))
  j += 1
    
print(sum)
Buggy code:
import numpy as np

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

ins = np.zeros(5)
ins[0] = a
ins[1] = b
ins[2] = c
ins[3] = d
ins[4] = e

ls = np.zeros(5)
ls[0] = a%10
ls[1] = b%10
ls[2] = c%10
ls[3] = d%10
ls[4] = e%10
x = np.argsort(ls)

ans = 0
for i in range(5):
    if ls[i]==0:
        ans = ans+ins[i]
    elif i==x[0]:
        ans = ans+ins[i]
    else:
        ans = ans + ((ins[i]//10)+1)*10
print(ans)

Fixed code:
import numpy as np

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

ins = np.zeros(5)
ins[0] = a
ins[1] = b
ins[2] = c
ins[3] = d
ins[4] = e

ls = np.zeros(5)
ls[0] = a%10
ls[1] = b%10
ls[2] = c%10
ls[3] = d%10
ls[4] = e%10

count=0
for i in range(5):
    if ls[i]==0:
        count=count+1
x = np.argsort(ls)

ans = 0
for i in range(5):
    if ls[i]==0:
        ans = ans+ins[i]
    elif i==x[count]:
        ans = ans+ins[i]
    else:
        ans = ans + ((ins[i]//10)+1)*10
print(int(ans))
Buggy code:
import math
a=int(input());b=int(input());c=int(input());d=int(input());e=int(input())

N=math.ceil(a/10)*10+math.ceil(b/10)*10+math.ceil(c/10)*10+math.ceil(d/10)*10+math.ceil(e/10)*10
X=[a%10,b%10,c%10,d%10,e%10]
n=0
while(n!=5):
  if X[n]==0:
    X[n]==9
  n+=1
if a==b==c==d==e:
  print(N-min(X))
else:
  print(N-(10-min(X)))

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

N=math.ceil(a/10)*10+math.ceil(b/10)*10+math.ceil(c/10)*10+math.ceil(d/10)*10+math.ceil(e/10)*10
X=[a%10,b%10,c%10,d%10,e%10]
n=0
while(n!=5):
  if X[n]==0:
    X[n]=10
  n+=1

else:
  print(N-(10-min(X)))
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

def res(x):
    res_x = 0 if x % 10 == 0 else 10 - x % 10
    return res_x

def gauss(x):
    return 10 * (x // 10 + 1)

ds = [a, b, c, d, e]
ds_sort = sorted(ds, key=lambda x: res(x))
ans = sum([gauss(e) for e in ds_sort[:-1]]) + ds_sort[-1]

print(ans)

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

def res(x):
    res_x = 0 if x % 10 == 0 else 10 - x % 10
    return res_x

def gauss(x):
    gx = x if x%10 == 0 else 10 * (x // 10 + 1)
    return gx

ds = [a, b, c, d, e]
ds_sort = sorted(ds, key=lambda x: res(x))
ans = sum([gauss(e) for e in ds_sort[:-1]]) + ds_sort[-1]

print(ans)
Buggy code:
# coding: utf-8
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
Ac=(a//10+1)*10
Bc=(b//10+1)*10
Cc=(c//10+1)*10
Dc=(d//10+1)*10
Ec=(e//10+1)*10
Af=a%10
Bf=b%10
Cf=c%10
Df=d%10
Ef=e%10

if max(Af,Bf,Cf,Df,Ef)==Af:
  print(a+Bc+Cc+Dc+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Bf:
  print(Ac+b+Cc+Dc+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Cf:
  print(Ac+Bc+c+Dc+Ec)  
  
elif max(Af,Bf,Cf,Df,Ef)==Df:
  print(Ac+Bc+Cc+d+Ec)
  
elif max(Af,Bf,Cf,Df,Ef)==Ef:
  print(Ac+Bc+Cc+Dc+e)  

Fixed code:
# coding: utf-8
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
Ac=(((a-1)//10)+1)*10
Bc=(((b-1)//10)+1)*10
Cc=(((c-1)//10)+1)*10
Dc=(((d-1)//10)+1)*10
Ec=(((e-1)//10)+1)*10
Af=(a-1)%10
Bf=(b-1)%10
Cf=(c-1)%10
Df=(d-1)%10
Ef=(e-1)%10

if min(Af,Bf,Cf,Df,Ef)==Af:
  print(a+Bc+Cc+Dc+Ec)
  
elif min(Af,Bf,Cf,Df,Ef)==Bf:
  print(Ac+b+Cc+Dc+Ec)
  
elif min(Af,Bf,Cf,Df,Ef)==Cf:
  print(Ac+Bc+c+Dc+Ec)  
  
elif min(Af,Bf,Cf,Df,Ef)==Df:
  print(Ac+Bc+Cc+d+Ec)
  
elif min(Af,Bf,Cf,Df,Ef)==Ef:
  print(Ac+Bc+Cc+Dc+e)
Buggy code:
import sys
input=sys.stdin.readline

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

m = 9999
for i in s:
    t = i
    for j in s:
        if i != j:
            t += j if j%10 == 0 else j + 10-j%10
    m = min(m, t) 

print(m)


Fixed code:
import sys
input=sys.stdin.readline

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

m = 9999
for i in s:
    t = 0
    ss = s[0:]
    ss.remove(i)
    for j in ss:
        t += j if j%10 == 0 else j + 10-j%10
    t += i    
    m = min(m, t) 

print(m)
Buggy code:
M = 0
ans = 0
for i in range(5):
  a = append(int(input()))
  b = ((a + 9) // 10) * 10
  M = max(M, b-a)
  ans += b
print(ans - M)

Fixed code:
M = 0
ans = 0
for i in range(5):
  a = int(input())
  b = ((a + 9) // 10) * 10
  M = max(M, b-a)
  ans += b
print(ans - M)
Buggy code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

li = [ri() for _ in range(5)]
lis = [math.ceil(i/10)*10 for i in li]
ans = inf
for i in range(5):
  ans = min(sum(lis[:i])+li[i]+sum(lis[i+1:]))
print(ans)
  
    










Fixed code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

li = [ri() for _ in range(5)]
lis = [math.ceil(i/10)*10 for i in li]
ans = inf
for i in range(5):
  ans = min(sum(lis[:i])+li[i]+sum(lis[i+1:]), ans)
print(ans)
Buggy code:
A = [int(input()) for i in range(5)]
B = [10 - a % 10 for a in A]
print(sum(A) + sum(B) - max(B))


Fixed code:
A = [int(input()) for i in range(5)]
B = [(10 - a % 10) % 10 for a in A]
print(sum(A) + sum(B) - max(B))
Buggy code:
def resolve():
    a = list(int(input()) for _ in range(5))
    mint = 1000
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
        if a[i]%10 == 0: continue
        mint = min(mint,a[i]%10)
    print(ans+mint-10)

resolve()

Fixed code:
import math
def resolve():
    a = list(int(input()) for _ in range(5))
    mint = 1000
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
        if a[i]%10 == 0: continue
        mint = min(mint,a[i]%10)
    if mint == 1000:
        print(ans)
    else:
        print(ans+mint-10)
resolve()
Buggy code:
L = []
for i in range(5):
    L.append(int(input()))

L1 = [x for x in L if x%10 == 0]
L2 = [x for x in L if x%10 != 0]
L3 = [(x%10,x//10) for x in L2]

ans = sum(L1)
if len(L3)>0:
	L3.sort(reverse = True)
	for i in range(len(L3)-1):
    	ans += (L3[i][1]+1)*10
	ans += L3[-1][1]*10+L3[-1][0]
print(ans) 

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

L1 = [x for x in L if x%10 == 0]
L2 = [x for x in L if x%10 != 0]
L3 = [(x%10,x//10) for x in L2]

ans = sum(L1)
if len(L3)>0:
  L3.sort(reverse = True)
  for i in range(len(L3)-1):
    ans += (L3[i][1]+1)*10
  ans += L3[-1][1]*10+L3[-1][0]
print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
x = 0
lst = [a,b,c,d,e]
lst2 = []
for i in lst:
  if i%10 == 0:
    lst2.append(10)
  else:
    lst2.append(i%10)
print(lst2)
print(lst2.index(min(lst2)))
y = lst[lst2.index(min(lst2))]
del lst[lst2.index(min(lst2))]
for i in lst:
  if i%10 == 0:
    x += i
  else:
    x += (i//10+1)*10
x = x + y
print(x)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
x = 0
lst = [a,b,c,d,e]
lst2 = []
for i in lst:
  if i%10 == 0:
    lst2.append(10)
  else:
    lst2.append(i%10)
y = lst[lst2.index(min(lst2))]
del lst[lst2.index(min(lst2))]
for i in lst:
  if i%10 == 0:
    x += i
  else:
    x += (i//10+1)*10
x = x + y
print(x)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ALL = [A,B,C,D,E]
G=[[0,0],[0,0],[0,0],[0,0],[0,0]]
for i in range(len(ALL)):
  G[i][1] = ALL[i]
  G[i][0] = 10-ALL[i] %10
G.sort()
total = 0
for j in range(4):
  total = total+G[j][1]+G[j][0]
total = total + G[4][1]
  

Fixed code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ALL = [A,B,C,D,E]
G=[[0,0],[0,0],[0,0],[0,0],[0,0]]
for i in range(len(ALL)):
  G[i][1] = ALL[i]
  if (ALL[i]%10 == 0):
    G[i][0] = 0
  else:
    G[i][0] = 10-(ALL[i] %10)
G.sort()
total = 0
for j in range(4):
  total = total+G[j][1]+G[j][0]
total = total + G[4][1]
print(total)
Buggy code:
time = [int(input()) for i in range(5)]
ten_time = 0
smallest_mod = 9
for i in range(5):
    div,mod = divmod(time[i],10)
    if mod < smallest_mod:
        smallest_mod = mod
    if mod != 0:
        ten_time += div + 1
    else:ten_time += div
print(ten_time * 10 - 10 + smallest_mod)

Fixed code:
time = [int(input()) for i in range(5)]
ten_time = 0
smallest_mod = 10
for i in range(5):
    div,mod = divmod(time[i],10)
    if 0 < mod < smallest_mod:
        smallest_mod = mod
    if mod != 0:
        ten_time += div + 1
    else:ten_time += div
print(ten_time * 10 - 10 + smallest_mod)
Buggy code:
lis = []
for i in range(5):
    lis.append(int(input()))
plus = 0
notdiv = []
for i in range(5):
    if lis[i] % 10 != 0:
        plus += 10 - (lis[i] % 10)
        notdiv.append(lis[i])
for i in range(5):
    notdiv[i] %= 10
    notdiv[i] = 10 - notdiv[i]


notdiv.sort()
print(sum(lis) + plus - notdiv[-1])

Fixed code:
lis = []
for i in range(5):
    lis.append(int(input()))
plus = 0
notdiv = []
for i in range(5):
    if lis[i] % 10 != 0:
        plus += 10 - (lis[i] % 10)
        notdiv.append(lis[i])
if notdiv:
    for i in range(len(notdiv)):
        notdiv[i] %= 10
        notdiv[i] = 10 - notdiv[i]

    notdiv.sort()
    print(sum(lis) + plus - notdiv[-1])
else:
    print(sum(lis) + plus)
Buggy code:
short = 10
ans = 0
for i in range(5):
    n = int(input())
    if short > n%10 and n%10 > 0:
        short = n%10
    ans += (n//10)*10
    if n%10 > 0:
        ans += 10
print(short,ans)
ans -= 10 if short > 0 else 0
print(ans+short)


Fixed code:
short = 10
ans = 0
for i in range(5):
    n = int(input())
    if short > n%10 and n%10 > 0:
        short = n%10
    ans += (n//10)*10
    if n%10 > 0:
        ans += 10
ans -= 10 if short > 0 else 0
print(ans+short)
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())
hikubun=0
for i in range(5):
    hikubun=max(A[i]%10,10-hikubun)
    A[i]=(A[i]//10+(A[i]%10!=0))*10
    
ans=sum(A)-(10-hikubun)
print(ans)
   

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())
hikubun=0
for i in range(5):
    hikubun=max(-A[i]%10,hikubun)
    A[i]=(A[i]//10+(A[i]%10!=0))*10
    
ans=sum(A)-hikubun
print(ans)
Buggy code:
from math import ceil
time_list = [int(input()) for i in range(5)]
sum_list = []
time_list_0 = []
for i in range(5):
    time_list_0[i] = ceil(time_list[i] / 10) * 10
for j in range(5):
    if time_list[i] == 0:
        sum_list[i] = sum(time_list_0)
    else:
        sum_list[i] = sum(time_list_0) - 10 + time_list[i] % 10
print(min(sum_list))


Fixed code:
from math import ceil
time_list = [int(input()) for i in range(5)]
sum_list = []
time_list_0 = []
for i in range(5):
    time_list_0.append(ceil(time_list[i] / 10) * 10)
for j in range(5):
    if time_list[j] % 10 == 0:
        sum_list.append(sum(time_list_0))
    else:
        sum_list.append(sum(time_list_0) - 10 + (time_list[j] % 10))
print(min(sum_list))
Buggy code:
a=[]
ra=[]
for i in range(5):
  a.append(int(input()))

for i in range(5):
  ra.append(a[i]%10)

tot=0
for i in range(5):
  if ra[i]==0:
    tot+=a[i]

  else:
    tot+=a[i]+10-ra[i]


ra.sort()
for i in range(5):
  if ra[i]==0:
    continue
  else:
    tot-=ra[i]
    break
print(tot)

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

for i in range(5):
  ra.append(a[i]%10)

tot=0
for i in range(5):
  if ra[i]==0:
    tot+=a[i]

  else:
    tot+=a[i]+10-ra[i]
    

ra.sort()
for i in range(5):
  if ra[i]==0:
    continue
  else:
    tot-=10-ra[i]
    break
print(tot)
Buggy code:
def t(n):
  if n%10==0:
    return n
  else:
    return ((n//10)+1)*10
def k(n):
  if n%10==0:
    return 10
  else:
    return 10-(n%10)
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
L=[k(a),k(b),k(c),k(d),k(e)]
print(t(a)+t(b)+t(c)+t(d)+t(e)-max(L))

Fixed code:
def t(n):
  if n%10==0:
    return n
  else:
    return ((n//10)+1)*10
def k(n):
  if n%10==0:
    return 0
  else:
    return 10-(n%10)
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
L=[k(a),k(b),k(c),k(d),k(e)]
print(t(a)+t(b)+t(c)+t(d)+t(e)-max(L))
Buggy code:
A = [int(input()) for _ in range(5)]
cnt = 0
Max = 10
for i in range(len(A)):
    if A[i]%10 < Max:
        Max = i
for i in range(len(A)):
    if i != Max:
        cnt += A[i]
    while cnt%10 != 0:
        cnt += 1
print(cnt+A[Max])

Fixed code:
A = [int(input()) for _ in range(5)]
cnt = 0
Max = 10
Max_i = 0
for i in range(len(A)):
    if 0 < A[i]%10 < Max:
        Max = A[i]%10
        Max_i = i
for i in range(len(A)):
    if i != Max_i:
        cnt += A[i]
    while cnt%10 != 0:
        cnt += 1
print(cnt+A[Max_i])
Buggy code:
A=[]
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
count=0
rem=10
for t in A:
    if t%10==0:
        count+=t
    else:
        count+=(((t//10)+1)*10)
        if t%10<10:
            rem=t%10
print(count-10+rem)

Fixed code:
A=[]
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
count=0
rem=10
for t in A:
    if t%10==0:
        count+=t
    else:
        count+=(((t//10)+1)*10)
        if t%10<rem:
            rem=t%10
print(count-10+rem)