Problem:
 Score: 200 points    Problem Statement  The restaurant AtCoder serves the following five dishes:   ABC Don (rice bowl): takes A minutes to serve.  ARC Curry: takes B minutes to serve.  AGC Pasta: takes C minutes to serve.  APC Ramen: takes D minutes to serve.  ATC Hanbagu (hamburger patty): takes E minutes to serve.   Here, the time to serve a dish is the time between when an order is placed and when the dish is delivered.  This restaurant has the following rules on orders:   An order can only be placed at a time that is a multiple of 10 (time 0 , 10 , 20 , ... ).  Only one dish can be ordered at a time.  No new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.   E869120 arrives at this restaurant at time 0 . He will order all five dishes. Find the earliest possible time for the last dish to be delivered. Here, he can order the dishes in any order he likes, and he can place an order already at time 0 .      Constraints   A, B, C, D and E are integers between 1 and 123 (inclusive).         Input  Input is given from Standard Input in the following format:  A  B  C  D  E       Output  Print the earliest possible time for the last dish to be delivered, as an integer.        Sample Input 1 29
20
7
35
120      Sample Output 1 215  If we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:   Order ABC Don at time 0 , which will be delivered at time 29 .  Order ARC Curry at time 30 , which will be delivered at time 50 .  Order AGC Pasta at time 50 , which will be delivered at time 57 .  Order ATC Hanbagu at time 60 , which will be delivered at time 180 .  Order APC Ramen at time 180 , which will be delivered at time 215 .   There is no way to order the dishes in which the last dish will be delivered earlier than this.       Sample Input 2 101
86
119
108
57      Sample Output 2 481  If we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:   Order AGC Pasta at time 0 , which will be delivered at time 119 .  Order ARC Curry at time 120 , which will be delivered at time 206 .  Order ATC Hanbagu at time 210 , which will be delivered at time 267 .  Order APC Ramen at time 270 , which will be delivered at time 378 .  Order ABC Don at time 380 , which will be delivered at time 481 .   There is no way to order the dishes in which the last dish will be delivered earlier than this.       Sample Input 3 123
123
123
123
123      Sample Output 3 643  This is the largest valid case.

Solution (Python):
import math
l=[]
k=[]
sa=[]
for i in range(5):
	a = int(input())
	l.append(a)
	j=math.ceil(a/10)*10
	k.append(j)
	m=j-a
	sa.append(m)
print(sum(k)-max(sa))

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

food = [a, b, c, d, e]

tmp = 10
for i, f in enumerate(food):
    if (f - 1) % 10 < tmp:
        tmp = (f - 1) % 10
        index = i

ans = 0
for i, f in enumerate(food):
    if i != index:
        ans += ((f - 1) // 10 + 1) * 10
    else:
        ans += f

print(ans)

Solution (Python):
a = []
b = []
for i in range(5):
    temp = int(input())
    amari = (10 - temp % 10) % 10
    a.append(temp)
    b.append(amari)

print(sum(a)+sum(b)-max(b))

Solution (Python):
A=[]
for i in range(5):
  A.append(int(input()))

B=[]
for i in range(5):
  B.append((10-A[i]%10)%10)

print(sum(A)+sum(B)-max(B))

Solution (Python):
A=[]
for i in range(5):
  A.append(int(input()))


B=[]
for i in range(5):
  B.append(10-A[i]%10 if A[i]%10 else 0)


for i in range(5):
  if B[i]==max(B):
    B[i]=0
    break


for i in range(5):
  A[i]+=B[i]

print(sum(A))

Solution (Python):
import math
r=list(int(input()) for _ in range(5))
_r=list(map(lambda x: math.ceil(x/10)*10, r))

diff=[]
for i in range(5):
    diff.append(_r[i]-r[i])

print(sum(_r)-max(diff))

Solution (Python):
import itertools

d = [int(input()) for _ in range(5)]
s = []
min = 999
for i in itertools.permutations(range(5)):
    s.append(i)
for x in s:
    tmp = 0
    for y in x:
        tmp += d[y]
        if y != x[-1] and d[y]%10 != 0:
            tmp += 10 - tmp%10
    if tmp < min:
        min = tmp

print(min)

Solution (Python):
A,B,C,D,E=(int(input()) for _ in range(5))
X=[A,B,C,D,E]
time=0
rest=[]
for i in range(5):
    if X[i]%10!=0:
        time+=(X[i]//10+1)*10
    else:
        time+=X[i]
    rest.append((10-X[i]%10)%10)
time-=max(rest)
print(time)

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a=[int(input()) for _ in [0]*5]
c=10
for i in range(5):
	if int(str(a[i])[-1])==0:
		continue
	c=min(int(str(a[i])[-1]),c)
	
for i in range(5):
	a[i]=(-(-(a[i])//10))*10

if c==0:
	print(sum(a))
else:
	print(sum(a)-(10-c))

Solution (Python):
import math
l = [int(input()) for _ in range(5)]

l2 = [math.ceil(i/10)*10 for i in l]

diff = max([i-j for i,j in zip(l2,l)])

print(sum(l2) - diff)

Solution (Python):
import itertools
A = [int(input()) for _ in range(5)]
tmin = 10**4
for x in itertools.permutations(range(5)):
    t = 0
    for i in range(5):
        a = t%10
        if a>0:
            t = (t//10+1)*10
        t += A[x[i]]
    tmin = min(tmin,t)
print(tmin)

Solution (Python):
T = [int(input()) for i in range(5)]
t = 0
R = []
for i in range(5):
  t += -(-T[i]//10)*10
  R += [-(-T[i]//10)*10-T[i]]
print(t - max(R))

Solution (Python):
a = [int(input()) for _ in range(5)]
b = 10-min([a[i]%10 for i in range(5) if 0 < a[i]%10] or [10])
print(sum([(-(-a[i]//10)) for i in range(5)])*10-b)

Solution (Python):
A = input()
B = input()
C = input()
D = input()
E = input()
an = [A,B,C,D,E]
s = 0
an = list(map(int,an))
for i in an:
  s += i +(10-i%10 if i%10!=0 else 0)
ans = 10000
for i in range(5):
  ans = min(ans,s-(an[i]+(10-an[i]%10 if an[i]%10!=0 else 0))+an[i])
print(ans)

Solution (Python):
n=[int(input()) for i in range(5)]

a=[-(-n[i]//10)*10 for i in range(len(n))]
b=[n[i]%10 for i in range(len(n)) if n[i]%10 != 0]
if b != []:
    print(sum(a) + min(b) -10)
else:
    print(sum(a))

Solution (Python):
t = [int(input()) for _  in range(5)]
total = 0
amari = []

for ti in t:
    d, m = divmod(ti, 10)
    total += ti - m
    if m > 0:
        amari.append(m)
if amari:
    total += min(amari) + 10 * (len(amari) - 1)
print(total)

Solution (Python):
a=list(int(input()) for i in range(5))

b=[-(-a[i]//10)*10 for i in range(5)]
c=[a[i]%10 for i in range(5) if a[i]%10 != 0]

if c != []:
    print(sum(b) + min(c) -10)
else:
    print(sum(b))

Solution (Python):
import math
total = 0
times = []
for i in range(5):
  times.append(int(input()))
  
d1 = 10
for i in range(5):
  total += math.ceil(times[i] / 10) * 10
  if times[i] % 10 != 0:
    d1 = min(d1, times[i] % 10)
  
print(total - 10 + d1)

Solution (Python):
import math

times = [0]*5
for i in range(5):
    times[i] = int(input())


mini = 10
idx = 9
for time in times:
    if time%10 < mini and time%10 > 0:
        mini = min(mini,time%10)
        idx = times.index(time)

total = 0
for i in range(5):
    if i == idx:
        total += times[i]
    else:
        total += math.ceil(times[i]/10)*10
print(total)

Solution (Python):
import math
a = 0
b = 0
c = 0
d = 0
e = 0
ls = [a,b,c,d,e]
for i in range(len(ls)):
    ls[i] = int(input())
for i in ls:
    if i > 9:
        i = i//10
ans = 0
for i in ls:
    ans += math.ceil(i)

lsls = [0]
for i in range(len(ls)):
    ls_one = str(ls[i])
    if int(ls_one[-1]) > 0:
    	lsls.append(10-int(ls_one[-1]))
    
lsls.remove(max(lsls))
print(ans+sum(lsls))

Solution (Python):
import math
a = 0
b = 0
c = 0
d = 0
e = 0
ls = [a,b,c,d,e]
for i in range(len(ls)):
    ls[i] = int(input())
for i in ls:
    if i > 9:
        i = i//10
ans = 0
for i in ls:
    ans += math.ceil(i)

lsls = [0]
for i in range(len(ls)):
    ls_one = str(ls[i])
    if int(ls_one[-1]) > 0:
    	lsls.append(10-int(ls_one[-1]))
    
lsls.remove(max(lsls))
print(ans+sum(lsls))

Solution (Python):
A = [0]*5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
last = -1
mini = 9
for i in range(5):
  if mini >= A[i] % 10 and A[i]%10 != 0:
    mini = A[i] % 10
    last = i
count = 0
for i in range(5):
  if i != last:
    count += (((A[i]-1) // 10) * 10)+10
  else:
    count += A[i]
print(count)

Solution (Python):
def f(m):
  if m%10 == 0:
    return 10
  else:
    return m%10

def g(m):
  if m%10 == 0:
    return m
  else:
    return 10*(m//10 + 1)
lis = []
for i in range(5):
  x = int(input())
  lis.append([f(x%10),g(x),x])

a = sorted(lis)
ans = 0
for i in reversed(range(1,5)):
  ans += a[i][1]

ans += a[0][2]
print(ans)

Solution (Python):
data=[int(input()) for i in range(5)]
import math
ans=0
a,b,c,d,e=data
mod10=[i%10 if i%10!=0 else 10 for i in data]
m = mod10.index(min(mod10))
ans+=data[m]
data[m]=0
for time in data:
    ans+=math.ceil(time/10)*10
print(ans)

Solution (Python):
l1=[]
l2=[]
for _ in range(5):
  a=int(input())
  if a%10==0:
    l1.append(a//10)
    l2.append(10)
  else:
    l1.append(1+a//10)
    l2.append(a%10)
print(10*sum(l1)+min(l2)-10)

Solution (Python):
A = [int(input()) for _ in[0]*5]
B = [-(-a//10)*10-a for a in A]

print(sum(A)+sum(B)-max(B))

Solution (Python):
if __name__ == '__main__':
    T = [int(input()) for _ in range(5)]
    
    del_max = -1
    idx_max = 0
    for i in range(5):
        if T[i]%10 == 0:
            pass
        elif 10 - T[i]%10 > del_max:
            del_max = 10 - T[i]%10
            idx_max = i
    
    count = 0
    for i in range(5):
        if i != idx_max:
            time = (T[i]//10)*10
            if time < T[i]:
                time += 10
            count += time
    count += T[idx_max]
    
    print(count)

Solution (Python):
def up(x):
  return x + (10 - x % 10) if x%10!=0 else x
def key(x):
  return 10 if x%10 == 0 else x%10
ans = 0
a = sorted([int(input()) for i in range(5)], key=key)
print(a[0] + sum(list(map(up, a[1:]))))

Solution (Python):
a = [0]*5
a[0] = int(input())
a[1] = int(input())
a[2] = int(input())
a[3] = int(input())
a[4] = int(input())
q = [0]*5
t = 0
for i in range(5):
  q[i] = a[i] % 10
  q[i] = (10 - q[i])%10
  t += (a[i]+9)//10*10
t -= max(q)
print(t)

Solution (Python):
a = sorted([int(input()) for i in range(5)])
mina = 10
minban = 0
for i in range(5):
    b = a[i]%10
    if b != 0 and b <= mina:
        mina = b
        minban = i
time = 0
for i in range(5):
    if i == minban:
        time += a[i]
    else:
        time += (-(-a[i]//10))*10
print(time)

Solution (Python):
a = [int(input()) for i in range(5)]
b = [i % 10 for i in a if i % 10]
ans = 0
from math import ceil
for i in a:
  ans += ceil(i / 10) * 10
if b:
  ans = ans - 10 + min(b)
print(ans)

Solution (Python):
lst = [int(input()) for _ in range(5)]
t = 0
diff = []
for i in range(5):
    t += -(-lst[i] // 10) * 10
    diff += [-(-lst[i] // 10) * 10 - lst[i]]
print(t - max(diff))

Solution (Python):
r=[int(input()) for _ in range(5)]


ans=0
rowMin=9

flag=0
for item in r:
  ans+=(((-1*item)//10)*(-10))
  if item%10 !=0 and item%10<=rowMin%10:
    rowMin=item
    flag=1
if flag==1:
  ans=ans+rowMin-(((-1*rowMin)//10)*(-10))
else:
  ans=ans
print(ans)

Solution (Python):
T = [int(input()) for i in range(5)]
t = 0
R = []
for i in range(5):
  t += -(-T[i]//10)*10
  R += [-(-T[i]//10)*10-T[i]]
print(t - max(R))

Solution (Python):
a=[int(input()) for i in range(5)]
b=[-(-a//10)*10-a for a in a]
print(sum(a)+sum(b)-max(b))

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

a = ((A-1)//10)*10 + 10
b = ((B-1)//10)*10 + 10
c = ((C-1)//10)*10 + 10
d = ((D-1)//10)*10 + 10
e = ((E-1)//10)*10 + 10

print(min(A+b+c+d+e,a+B+c+d+e,a+b+C+d+e,a+b+c+D+e,a+b+c+d+E))

Solution (Python):
import math
l = [int(input()) for _ in range(5)]
l = sorted(l, key= lambda x: (x-1)%10, reverse = True)
ans = 0

for i in range(4):
    ans += math.ceil(l[i]/10)*10
ans +=l[-1]
print(ans)

Solution (Python):
import math
l = [int(input()) for _ in range(5)]

l = sorted(l, key= lambda x: (x-1)%10, reverse = True)
ans = 0

for i in range(4):
  ans += math.ceil(l[i] / 10) * 10
ans += l[-1]

print(ans)

Solution (Python):
import math
T = [int(input()) for i in range(5)]
Rest=[0]*5
for i in range(5):
    if T[i]%10 == 0:
        Rest[i] = 10
    else: Rest[i] = T[i]%10
maxrest = 10-min(Rest)
ans = 0
for i in range(5):
    ans += 10*math.ceil(T[i]/10)
print(ans-maxrest)

Solution (Python):
import math
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

s_a = [x for x in str(a)]
s_b = [x for x in str(b)]
s_c = [x for x in str(c)]
s_d = [x for x in str(d)]
s_e = [x for x in str(e)]

l = [a,b,c,d,e]
m = [s_a,s_b,s_c,s_d,s_e]
s = []
ans = 0

for i in range(len(m)):
  if int(m[i][-1]) != 0:
    s.append(int(m[i][-1]))
  else:
    s.append(9) 
min_index = s.index(min(s))
max_num = l.pop(min_index)

for i in range(len(l)):
  ans += math.ceil(l[i] / 10) * 10

print(ans + max_num)

Solution (Python):
import sys
input = sys.stdin.readline
dish = []
min = 10
ans = 0
for _ in range(5):
	tmp = int(input())
	if tmp % 10 < min and tmp % 10 != 0:
		min = tmp % 10
	if tmp % 10 != 0:
		tmp += 10 - (tmp % 10)
	dish.append(tmp)
print(sum(dish)-(10-min))

Solution (Python):
a = [ int(input()) for _ in range(5)]
n = float("inf")
for i in range(5):
    if 0 < a[i] % 2 < 10:
        n = min(n,a[i] % 10)
else:
    if n == float("inf"):
        n = 10
print(sum([(-a[i]//10)*-10 for i in range(5)]) -(10-n))

Solution (Python):
import math

ts = [int(input()) for _ in range(5)]
rs = [t % 10 for t in ts if t % 10 > 0]
if len(rs) > 0:
    r = min(rs)
else:
    r = 0

res = 0
selected = False
for t in ts:
    if t % 10 == r and not selected:
        res += t
        selected = True
    else:
        res += math.ceil(t / 10) * 10
print(res)

Solution (Python):
p = [int(input()) for _ in range(5)]

maxIndex = 0;
v = 10;
for i in range(5):
  div = p[i]%10
  if div != 0 and v > div:
    v = div
    maxIndex = i

ans = 0
for i in range(5):
  if i != maxIndex:
    ans += p[i]
    if ans%10 != 0:
      ans += (10-p[i]%10)
print(ans+p[maxIndex])

Solution (Python):
from math import floor
A = [int(input()) for _ in range(5)]

ans = 0
tmp = 10
for a in A:
    q, mod = divmod(a, 10)
    if mod == 0:
        ans += q
    else:
        ans += q+1
        tmp = min(tmp, mod)
        
print(ans*10 - (10 - tmp))

Solution (Python):
dish = [int(input()) for _ in range(5)]

dish.sort(key=lambda x: (x-1)%10, reverse=True)

t = 0
for i in range(4):
    t += (dish[i]-1) // 10 * 10 + 10
t += dish[4]
print(t)

Solution (Python):
dish = [int(input()) for _ in range(5)]
dish = sorted(dish,key = lambda x: x%10)
ans = []
flag = False
for d in dish:
    ans.append(d)
    if flag:
        ans.append(10-(d%10))
    if d % 10 != 0:
        flag = True
print(sum(ans))

Solution (Python):
lis = []
for _ in range(5):
  lis.append(int(input()))
mod = []
for i in lis:
  mod.append(i%10)
if mod == [0,0,0,0,0]:
  print(sum(lis))
else:
  k = min(mod) if min(mod) != 0 else sorted(set(mod))[1]
  ans = 0
  for i in range(5):
    if i == mod.index(k):
      ans += lis[i]
    else:
      ans += ((lis[i]+9)//10)*10
  print(ans)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = [a, b, c, d, e]
B = []
for x in A:
  if x%10 == 0:
    B.append(x)
    A.remove(x)
A.sort(key = lambda y:y%10, reverse = True)
B.extend(A)
time = 0
for i in range(4):
  if (B[i]) % 10 == 0:
    time += B[i]
  else:
    time += 10*((B[i] // 10) + 1)
print(time+B[4])

Solution (Python):
dishes = list(map(int, [input() for _ in range(5)]))
visited = [0, 0, 0, 0, 0]
inf = 777
def dfs(t):
  global visited
  temp = inf
  for i in range(5):
    if visited[i] == 0:
      visited[i] = 1
      ti = dishes[i] + t
      if sum(visited) != 5:
        temp = min(temp, dfs((ti // 10 + bool(ti % 10)) * 10))
      else:
        temp = t + dishes[i]
      visited[i] = 0
  return temp
print(dfs(0))

Solution (Python):
menu = [ int(input()) for i in range(5)]
menu_per = []
for j in menu:
  if j % 10 != 0:
    menu_per.append(10 - (j % 10))
  else:
    menu_per.append(0)
ans = sum(menu) + sum(menu_per)
max_menu_per = max(menu_per)
ans = ans - max_menu_per
print(ans)

Solution (Python):
a = []
for _ in range(5):
    i = int(input())
    if i %10 == 0:
        q = 10
    else:
        q = i%10
    a.append([q, i])
a.sort()
count = 0
for i in range(1,5):
    if a[i][1] % 10 != 0:
        count += (a[i][1]//10)*10 + 10
    else:
        count += a[i][1]
print(count+a[0][1])

Solution (Python):
import math

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

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

sum=(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)

print(sum-10+k)

Solution (Python):
import itertools

def main():
    
    cnt = 0
    mod = 10
    for i in range(5):
        A = int(input())
        if A % 10 == 0:
            cnt += A
        else:
            cnt += 10 - (A % 10)
            cnt += A
            mod = min(mod, A % 10)

    if mod == 10:
        print(cnt)
    else:
        print(cnt - (10 - mod))

main()

Solution (Python):
T = [int(input()) for i in range(5)]
t = 0
R = []
for i in range(5):
  t += -(-T[i]//10)*10
  R += [-(-T[i]//10)*10-T[i]]
print(t - max(R))

Solution (Python):
lst = []
min = int(input())
for i in range(4):
    x = int(input())
    if x%10 != 0 and x%10 <= min%10:
       lst.append(min)
       min = x
    else:
        lst.append(x)
sum = 0
for i in lst:
    if i%10 == 0:
        sum += i
    else:
        sum += (i//10)*10 + 10
print(sum+min)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
s=min((a-1)%10,(b-1)%10,(c-1)%10,(d-1)%10,(e-1)%10)+1
print(int(-(-a//10))*10+int(-(-b//10))*10+int(-(-c//10))*10+int(-(-d//10))*10+int(-(-e//10))*10+s-10)

Solution (Python):
A=[int(input()) for x in range(5)]
B=[(10-s%10)%10 for s in A]
print(sum(A)+sum(B)-max(B))

Solution (Python):
A=[int(input()) for x in range(5)]
j=0
for i in range(4):
  if (A[j]-1)%10>(A[i+1]-1)%10:
    j=i+1
B=[(A[i]//10)*10+10 if A[i]%10!=0 else A[i] for i in range(5)]
B[j]=A[j]
print(sum(B))

Solution (Python):
menu = [int(input()) for _ in range(5)]
menu = sorted(menu,key = lambda x:x%10)
flag = True
ans=0

for v in menu:
    if flag and v%10!=0:
        ans+=v
        flag=False
    else:
        if flag:
            ans+=v
        else:
            ans+= v + 10-(v%10)
print(ans)

Solution (Python):




cook_time = [int(input()) for _ in range(5)]
interval_time = [0]*5

for i in range(len(cook_time)):
    interval_time[i] = (10 - (cook_time[i]%10))%10
    
print(sum(cook_time)+sum(interval_time)-max(interval_time))

Solution (Python):
l = [int(input()) for _ in range(5)]
a = list(map(lambda x:-(-x//10)*10,l))
b = list(map(lambda x:x%10 if x%10 else 10,l))
print(sum(a)-(10-min(b)))

Solution (Python):
A = [int(input()) for i in range(5)]

B = [-((-A[i])%10) for i in range(5)]
C = [-((-A[i])//10) * 10 for i in range(5)]



print(sum(C) + min(B))

Solution (Python):
dishes = [int(input()) for _ in range(5)]
diffs = [-(-dish//10)*10 - dish for dish in dishes]
print(sum(dishes) + sum(diffs) - max(diffs))

Solution (Python):
import itertools


def func():
    index = list(range(5))
    p = list(itertools.permutations(index))

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

    mn = 1e1000

    for i in p:
        sum = 0
        for k in range(5):

            reminder = time[i[k]] % 10
            if reminder == 0:
                reminder = 10
            if k == 4:
                sum += time[i[k]]
            else:
                sum += time[i[k]] + (10 - reminder)
        mn = min(mn, sum)

    print(mn)


if __name__ == '__main__':
    func()

Solution (Python):
def func():
    time = []

    for i in range(5):
        t = int(input())
        remainder = t % 10
        if remainder == 0:
            remainder = 10
        tmp = [t, remainder]
        time.append(tmp)

    time = sorted(time, reverse=True, key=lambda x: x[1])

    sum = 0
    for i in range(5):
        if i == 4:
            sum += time[i][0]
        else:
            sum += time[i][0] + (10 - time[i][1])

    print(sum)


if __name__ == '__main__':
    func()

Solution (Python):



import math

A, B, C, D, E = int(input()), int(input()), int(input()), int(input()), int(input())
a = [A, B, C, D, E]
b = list(map(lambda x: (x - 1) % 10, a))
tmp = a[b.index(min(b))]
del a[b.index(min(b))]
c = list(map(lambda x: (math.ceil(x / 10) * 10), a))
print(sum(c) + tmp)

Solution (Python):
I = [int(input()) for _ in range(5)]
min_ = 10
cnt = 0
for ii in range(5):
    mod10 = I[ii] % 10
    cnt += I[ii] + (10 - mod10) if mod10 != 0 else I[ii]
    if min_ > mod10 and mod10 != 0: min_ = mod10

print (cnt - (10 - min_))

Solution (Python):
import math

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

total = 0
sub = 0
for i in L:
    if i % 10 == 0:
        total += i
    else:
        rest = 10 - (i % 10)
        if rest > sub:
            sub = rest
        total += math.ceil(i / 10) * 10

print(total - sub)

Solution (Python):
import math

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

uptime = [0 for _ in range(5)]
for i in range(5):
    uptime[i] = math.ceil(time[i]/10)*10 

sa = [0 for _ in range(5)]
for i in range(5):
    sa[i] = uptime[i] - time[i]

ans = sum(uptime) - max(sa)

print(ans)

Solution (Python):
ans = 0
m = 10
for i in range(5):
  food = int(input())
  if food % 10 == 0:
    ans += food
  else:
    k = food % 10
    ans += food + 10 - k
    m = min(m,k)
print(ans - 10 + m)

Solution (Python):
import math
total = 0
first_min = 10
for _ in range(5):
    time = int(input())
    total += math.ceil(time/10)*10
    if first_min > time%10 > 0:
        first_min = time%10
print(total-10+first_min)

Solution (Python):

from itertools import permutations
from math import ceil

def main():
    L = []
    [L.append(int(input())) for _ in range(5)]
    all_combinations = list(permutations(L))

    ans = float('inf')
    for i in range(len(all_combinations)):
        temp = 0
        for j in range(5):
            if j != 4:
                temp += all_combinations[i][j]
                temp = ceil(temp/10) *10
            if j == 4:
                temp += all_combinations[i][j]
        if temp < ans:
            ans = temp

    return ans

if __name__ == '__main__':
    print(main())

Solution (Python):
Z=[]
Y=[]
for i in range(5):
    a=int(input())
    if a% 10!=0:
        Z.append(10-a % 10+a)
        Y.append(a % 10)
    else:
        Z.append(a)
if len(Y)==0:
    H=10
else:
    H=min(Y)

print(sum(Z)-(10-H))

Solution (Python):
ans = 0
t_min = 10

for i in range(5):
    o = int(input())
    ans += o
    t = o % 10
    if t != 0:
        ans += 10 - t
        if t < t_min:
            t_min = t
ans -= 10 - t_min

print(ans)

Solution (Python):
a = [int(input()) for _ in range(5)]
t = []
for i in range(5):
  c = (10-a[i])%10
  t.append(c)
print(sum(a) + sum(t) - max(t))

Solution (Python):
c=list(int(input()) for i in range(5))
amari=0
ma=0
for i in range(5):
    if c[i]%10!=0:
        amari+=10-(c[i]%10)
        if 10-(c[i]%10)>ma:
            ma=(10-(c[i]%10))           
time=sum(c)+(int(amari-ma))
print(int(time))

Solution (Python):
ds = []
total_time = 0
for i in range(5):
    d = int(input())
    if d % 10 == 0:
        total_time += d
    else:
        total_time += (d // 10 + 1) * 10
        ds.append(d % 10)
if len(ds) > 0:
    total_time = total_time - 10 + sorted(ds)[0]
print(total_time)

Solution (Python):
inputs=[int(input()) for _ in range(5)]

ans=0
ans=1000000000000000
for i in range(len(inputs)):
  tmp=0
  for j in range(len(inputs)):
    no=(i+j)%len(inputs)
    if j!=len(inputs)-1 and inputs[no]%10!=0:
      tmp+=inputs[no]+(10-inputs[no]%10)
    else:
      tmp+=inputs[no]
  if ans>tmp:
    ans=tmp
print(ans)

Solution (Python):
minv = 9
time = 0
count = 0
for i in range(5):
    p = int(input())
    if p%10 >0:
        minv = min(minv,p%10)
        q = (p//10)*10+10
        time += q
    else:
        time += p
        count+=1
time -= 10-minv
print(time+1 if count == 5 else time )

Solution (Python):
list = list(int(input()) for _ in range(5))
ans = 0
tag = 9
count = 0
for i in range(5):
  if list[i]%10==0:
    ans+=list[i]
    count+=1
  else:
    ans+=list[i]+(10-(list[i]%10))
    if tag>list[i]%10:
      tag = list[i]%10
print(ans if count==5 else ans-(10-tag))

Solution (Python):
lst = []
time = 0
for i in range(5):
    t = input()
    if int(t[-1]) == 0:
        lst.append([int(t), 9])
    else:
        lst.append([int(t), int(t[-1])])
l = sorted(lst, key = lambda lst:lst[1])
for i in range(5):
    if i == 0:
        time += l[i][0]
    else:
        time += l[i][0]//10 * 10
        if l[i][0]%10 != 0:
            time += 10
print(time)

Solution (Python):
sum_div = 0
M = []
for i in range(5):
    num = int(input())
    sum_div += num // 10
    mod = num % 10
    if mod != 0:
        M.append(mod)

if M:
    waiting = 10*(len(M)-1) + min(M)
else:
    waiting = 0
total = sum_div*10 + waiting
print(total)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
a1=a%10
b1=b%10
c1=c%10
d1=d%10
e1=e%10
ar=[a1,b1,c1,d1,e1]
a2=a//10
b2=b//10
c2=c//10
d2=d//10
e2=e//10
k=10
s=0
minimini=-1
for i in ar:
    if i==0:
        continue
    minimini=min(i,k)
    if i<k:
        k=i
for i in ar:
    if i==0:
        continue
    if i==minimini:
        minimini-=1
        continue
    else:
        s+=10
print((a2+b2+c2+d2+e2)*10+minimini+1+s)

Solution (Python):
A = [int(input()) for _ in range(5)]

can_saves = [(10-x)%10 for x in A]
times = [(x+9)//10*10 for x in A]
print(sum(times) - max(can_saves))

Solution (Python):
A=[int(input()) for a in range(5)]
A.sort(key=lambda x:10-(x-1)%10)
ans=0
for i in range(4):
	if A[i]%10!=0:
		A[i]=(A[i]//10)*10+10
print(sum(A))

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
def tenmul (n):
    if n % 10 == 0:
        return n
    else:
        return n + 10 - n%10

a2 = tenmul(a)
b2 = tenmul(b)
c2 = tenmul(c)
d2 = tenmul(d)
e2 = tenmul(e)
list = [a,b,c,d,e]
list2 = [a2,b2,c2,d2,e2]

result = sum(list2)
for i in range(5):
    M = sum(list2)
    result = min(M-list2[i]+list[i],result)
print(result)

Solution (Python):
ds = [int(input()) for _ in range(5)]
ls = 10

for i in range(5):
    m = ds[i] % 10

    if ls > m > 0:
        ls = m

    if m > 0:
        ds[i] += 10 - m

res = sum(ds) - (10 - ls)
print(res)

Solution (Python):
t = [int(input()) for i in range(5)]
r = [0] * 5
q = 0

for i in range(5):
    tr = t[i] % 10
    tq = t[i] // 10
    if tr == 0:
        r[i] = 10
        q += tq
    else:
        r[i] = tr
        q += tq + 1

if min(r) != 10:
    q -= 1
else:
    r = [0] * 5

print(q * 10 + min(r))

Solution (Python):
a = [int(input()) for i in range(5)]
before = 9
index = 0

for i in range(5):
    if before > (a[i]+9)%10:
        before = (a[i]+9)%10
        index = i
for i in range(5):
    if i != index and a[i]%10 != 0:
        a[i] = (a[i]+10)//10*10

print(sum(a))

Solution (Python):
p = [int(input()) for _ in range(5)]
minr = 10
ans = 0
for x in p:
    if x % 10 == 0:
        ans += x // 10
    else:
        ans += x // 10 + 1
        minr = min(minr, x % 10)
print(ans * 10 - (10 - minr))

Solution (Python):
import itertools
from math import ceil
t = []
for i in range(5):
    t.append(int(input()))
ans = 10**9

for values in list(itertools.permutations(t)):
    tmp = 0
    for i, v in enumerate(values):
        if i == 4:
            tmp += v
        else:
            tmp += (ceil(v / 10) * 10)
    ans = min(ans, tmp)
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline


def main(): 

    a=[int(input()) for _ in range(5)]
    ans=10**5
    for i in range(5):
        tmp = a[i]
        for j in range(5):
            if i != j:
                if a[j]%10==0:
                    tmp += a[j]
                else:
                    tmp += (a[j]//10+1)*10
        ans=min(ans,tmp)
    print(ans)
    



if __name__ == "__main__":
    main()

Solution (Python):
import math
L = [int(input()) for i in range(5)]
S = 0
answer = []
for i in range(5):
    S += math.ceil(L[i]/10) * 10
for i in range(5):
    answer.append(S - math.ceil(L[i]/10) * 10 + L[i])
print(min(answer))

Solution (Python):
from collections import deque
from math import ceil
L1 = [int(input()) for _ in range(5)]
L2 = list(map(lambda x: x % 10 if x % 10 != 0 else 10, L1))
L3 = list(map(lambda x: ceil(x/10)*10 if x % 10 != 0 else x, L1))
print (sum(L3) + min(L2) -10)

Solution (Python):
dish = []
for _ in range(5):
    dish.append(int(input()))

dish1 = [x for x in dish if x % 10 == 0]
dish2 = [x for x in dish if x % 10 != 0]
dish2 = sorted(dish2, key=lambda x: x % 10, reverse=True)

score = sum(dish1)
for i, d in enumerate(dish2):
    if i < len(dish2) - 1:
        score += d + (10 - d % 10)
    else:
        score += d

print(score)

Solution (Python):
f = [int(input()) for i in range(5)]
f.sort(key=lambda x: (x-1)%10)
t = f[0]
for v in f[1:]:
    t += (v+9)//10 * 10

print(t)

Solution (Python):
order_list = []
for _ in range(5):
    order_list.append(int(input()))

a = []
b = []
for i in range(5):
    a.append(((order_list[i]-1)//10+1)*10)
    b.append((order_list[i]-1)%10)

if min(b) != 9:
    ans = sum(a) + min(b) -9
else:
    ans = sum(a)
print(ans)

Solution (Python):
import itertools
a = [int(input()) for _ in range(5)]
mi = 10 ** 10
for i in itertools.permutations(a, 5):
    t = 0
    for j, v in enumerate(i):
        if j == 4:
            t += v
        else:
            t += ((v + 9) // 10 * 10)
    mi = min(t, mi)
print(mi)

Solution (Python):
import math

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



time = 0
for i in range(5):
    time = time + 10*math.ceil(menu[i]/10)
    menu[i] = menu[i]%10

nonzeromenu = [i for i in menu if i != 0]
nonzeromenu.sort()

if nonzeromenu:
    print(time -10 +nonzeromenu[0])
else:
    print(time)

Solution (Python):
import math
def main():
    order = []
    for _ in range(5):
        order.append(int(input()))
    min_r = 10
    last = None
    for i in range(5):
        r = order[i] % 10
        if r != 0 and r < min_r:
            min_r = r
            last = i
    if last == None:
        return sum(order)
    time = 0
    for i in range(5):
        if i != last:
            time += math.ceil(order[i] / 10) * 10
        else:
            time += order[i]
    return time


if __name__ == '__main__':
    print(main())

Solution (Python):
s = [int(input()) for i in range(5)]
n = len(s)
a = []
ans = 0
for i in range(n):
  amari = s[i]%10
  num = 10-amari if amari!=0 else 0
  a += [[i,num]]
a.sort(lambda x:x[1])  
for j in range(n-1):
  ans += s[a[j][0]] + a[j][1]
ans += s[a[-1][0]]
print(ans)

Solution (Python):
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))

Solution (Python):
r=0
m=9
c=0
for i in range(5):
    t=int(input())
    h=int(str(t)[-1])
    if h==0:
        r+=t
        c+=1
    else:
        t=(t+10-1)//10*10
        r+=t
        m=min(m,h)
if c==5:
    print(r)
else:
    print(r-10+m)