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):
a = list(int(input()) for _ in range(5))
print(sum(map(lambda x:(x+9)//10*10, a))-max(map(lambda x:(10-x%10)%10, a)))

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

min_rem = 10
ans = 0
for i in range(5):
    ans += (a[i] + 10 - 1) // 10 * 10
    if min_rem > a[i] % 10 > 0:
        min_rem = a[i] % 10

if min_rem != 10:
    ans -= (10 - min_rem)
print(ans)

Solution (Python):
dish=[int(input()) for i in range(5)]
dish_s=[(dish[i]+9)//10 for i in range(5)]
dish_d=[dish[i]%10 for i in range(5)]
sum=0
for i in range(5):
  sum+=dish_s[i]
m=0
for i in range(5):
  if dish_s[i]*10-dish[i]>m:
    m=dish_s[i]*10-dish[i]  
print(sum*10-m)

Solution (Python):
list_dish = [input() for i in range(0, 5)]
list_disit1 = [int(list_dish[i][-1]) for i in range(0, 5)]
marking = 0
min = 9
ans = 0
for i in range(0, 5):
    if list_disit1[i] != 0 and list_disit1[i] <= min:
        marking = i
        min = list_disit1[i]
for i in range(0, 5):
    if i == marking:
        ans += int(list_dish[i])
    else: ans += -(-int(list_dish[i]) // 10) * 10
print(ans)

Solution (Python):
import math


def main():
    t = []
    for i in range(5):
        t.append(int(input()))

    max_wait = 0
    max_wait_order = 0
    for i in range(len(t)):
        if t[i] % 10 != 0 and 10 - (t[i] % 10) >= max_wait:
            max_wait = 10 - t[i] % 10
            max_wait_order = i

    time = 0
    for i in range(len(t)):
        if i == max_wait_order:
            continue
        else:
            time += math.ceil(t[i] / 10) * 10
    time += t[max_wait_order]

    print(time)


if __name__ == '__main__':
    main()

Solution (Python):
from decimal import Decimal, ROUND_UP

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

for i in range(len(l)):
    rl.append(int(Decimal(str(l[i])).quantize(Decimal('1E1'), rounding=ROUND_UP)))

ans = []
for j in range(len(rl)):
    num = sum(rl) - rl[j] + l[j]
    ans.append(num)

print(min(ans))

Solution (Python):
def main():
    
    
    
    
    

    import math

    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    dishes = [a, b, c, d, e]
    count = 0
    mini = 10
    index = 0
    for i in range(5):
        if dishes[i] % 10 != 0 and mini > dishes[i] % 10:
            mini = dishes[i] % 10
            index = i
    for i in range(5):
        if i != index:
            count += math.ceil(dishes[i]/10) * 10
        else:
            count += dishes[i]

    print(count)


if __name__ == '__main__':
    main()

Solution (Python):
import math

a = [int(input()) for i in range(5)]
sub = 0
cnt = 0

for i in a:
    if i%10!=0 and sub<(10-i%10):
        sub = 10-i%10
    cnt += math.ceil(i/10)*10
print(cnt-sub)

Solution (Python):
foods = [0] * 5
sumfoods = 0
for i in range(5):
  foods[i] = int(input())
maxDiv = 0
for i, var in enumerate(foods):
  temp = 10 - (var % 10)
  if temp == 10:
    temp = 0
  foods[i] += temp
  sumfoods += foods[i]
  if maxDiv < temp:
    maxDiv = temp
print(sumfoods - maxDiv)

Solution (Python):
import math

A = input()
B = input()
C = input()
D = input()
E = input()

num = 10
for i in [int(A[-1]), int(B[-1]), int(C[-1]), int(D[-1]), int(E[-1])]:
    if i != 0:
        num = min(num, i)

result = (math.ceil(int(A)/10) + math.ceil(int(B)/10) + math.ceil(int(C)/10) + math.ceil(int(D)/10) + math.ceil(int(E)/10)) * 10
if num != 10:
    result = result - 10 + num

print(result)

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

wasted_times = []
for dish in dishes:
    wasted_time = (10 - (dish % 10)) % 10
    wasted_times.append(wasted_time)

wasted_times.sort()
del wasted_times[-1]

ans = sum(dishes) + sum(wasted_times)
print(ans)

Solution (Python):
A = []
min_digit = 9
for _ in range(5):
  s = input()
  n = int(s)
  digit = int(s[-1])
  if digit > 0 and digit < min_digit:
    min_digit = digit
    A = A + [n]
  else:
    A = [n] + A
    
import math as m
A = [int(m.ceil(n/10)*10) for n in A[:-1]] + [A[-1]]
print(sum(A))

Solution (Python):
Value = [int(input()) for _ in range(5)]
amari = list()
for i in range(5):
  if(Value[i]%10 == 0):
    amari.append(10)
  else:
    amari.append(Value[i]%10)
min_amari = [i for i in range(5) if(min(amari)==amari[i])]

ans = 0
for i in range(5):
  if(i == min_amari[0]):
    ans += 0
  else:
    ans += (Value[i] + 10-amari[i])
ans += Value[min_amari[0]]
print(ans)

Solution (Python):
def main():
    
    
    
    

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

    total = 0
    li = [a, b, c, d, e]
    mini = 10**10
    ans_idx = 0
    for i, s in enumerate(li):
        last_s = int(str(s)[-1])
        if mini > last_s and last_s != 0:
            mini = last_s
            ans_idx = i

    for i, s in enumerate(li):
        if i != ans_idx:
            if s % 10 != 0:
                total += s // 10 * 10 + 10
            else:
                total += s
        else:
            total += s

    print(total)


if __name__ == '__main__':
    main()

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

d = [abs(d % 10 -10) for d in dishes if d % 10 != 0] 
if d: d.remove(max(d)) 
print(sum(dishes) + sum(d))

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

m = 9 - min([(i-1) % 10 for i in l])

print(sum([((i-1)//10 + 1) * 10 for i in l]) - m)

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

s = list(map(lambda x: (10-x%10)%10, abcde))
print(sum(abcde)+sum(s)-max(s))

Solution (Python):

menu = []
jissai_menu = []
for i in range(5):
    menu.append(int(input()))
    if menu[i] % 10 == 0: 
        jissai_menu.append(menu[i])
    else:
        jissai_menu.append(menu[i] - menu[i] % 10 + 10)

ans = float('inf')
for i in range(5):
    tmp = 0
    for j in range(5):
        if j == i: continue
        tmp += jissai_menu[j]
    ans = min(ans, tmp + menu[i])

print(ans)

Solution (Python):
import sys
t=list(zip(*[[int(n[:-1] or 0),int(n[-1])] for n in (list(sys.stdin.read().split()))]))
print((sum(t[0])+len((u:=sorted(filter(lambda n:n>0,t[1])))[:0:-1]))*10+(u and u[0] or 0))

Solution (Python):
import sys
a = list(sys.stdin.read().split())
t = list(zip(*[[int(n[:-1] or 0), int(n[-1])] for n in a]))
print((sum(t[0]) + len((u := sorted(filter(lambda n: n > 0, t[1])))[:0:-1])) * 10 + (u and u[0] or 0))

Solution (Python):
A=[int(input()) for _ in range(5)]
print(sum(((x-1)//10+1)*10 for x in A)-max((10-x%10)%10 for x in A))

Solution (Python):
L = list(int(input()) for _ in range(5))
ans = 0
for l in L:
  if l%10 != 0:
    ans += (l-(l%10))+10
  else:
    ans += l
m = 0
for l in L:
  cnt = 0
  if (l%10) == 0:
    cnt += 1
  elif m < 10-(l%10):
    m = 10-(l%10)
if cnt == 5:
  m = 0
print(ans-m)

Solution (Python):

import sys
input=sys.stdin.readline
import numpy as np

def main():
    menu=[]
    np_menu=[]
    [menu.append(int(input())) for _ in range(5)]
    np_menu=np.array(menu)
    s_menu=sorted(np_menu,key=lambda x:x%10)
    time_counter=0
    last_add=0

    for time in s_menu:
        if time % 10 ==0:
            time_counter+=time
        elif last_add==0:
            last_add+=time
        else:
            tmp=10-(time%10)
            time_counter+=time+tmp
    time_counter+=last_add
    print(time_counter)

if __name__=="__main__":
    main()

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

l = []
if A%10 > 0:
  l.append(A%10)
if B%10 > 0:
  l.append(B%10)
if C%10 > 0:
  l.append(C%10)
if D%10 > 0:
  l.append(D%10)
if E%10 > 0:
  l.append(E%10)
  
ans = len(l)*10 + A + B + C + D + E - sum(l)
if len(l) > 0:
  ans += min(l) - 10
print(ans)

Solution (Python):
l = []
ans = 0
for i in range(5):
    x = int(input())
    ans +=x
    if x%10 == 0:
        l.append(0)
    else:
        l.append(10-x%10)
l.sort()
ans +=  sum(l[:4])
print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
L = [(10 - A%10)%10,(10 - B%10)%10,(10 - C%10)%10,(10 - D%10)%10,(10 - E%10)%10]
L.sort()
print(A+B+C+D+E+L[0]+L[1]+L[2]+L[3])

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

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

b=[]
c=[]

for i in range(5):
  p=math.ceil(a[i]/10)*10
  b.append(p)
  c.append(list(str(a[i]-1)))

d=[]
for i in range(5):
  d.append(int(c[i][-1]))

print(sum(b)-(10-min(d)-1))

Solution (Python):
import sys
import copy
import math
import itertools
import numpy as np
l = [int(input()) for c in range(5)]

tmp = 0
cnt = 5
for i in range(5):
    if tmp < 10 - l[i]%10 and l[i]%10!=0:
        tmp = 10 - l[i]%10
        cnt = i
res = 0
for i in range(5):
    if cnt == i:
        res+=l[i]
    else:
        if l[i]%10==0:
            res+=l[i]
        else:
            res+=l[i]+10-l[i]%10

print(res)

Solution (Python):
import sys
import itertools

import time
import math
from heapq import heappop, heappush
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import permutations
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


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

def calc(p):
    t = 0
    for n, i in enumerate(p):
        t += A[i]
        if n == 4:
            break
        r = t % 10
        t += (10 - r) % 10
    return t

ans = INF
for p in permutations(range(5)):
    ans = min(calc(p), ans)
print(ans)

Solution (Python):



Ryori = [input() for _ in range(5)]
O = []
t = 0
for i in Ryori:
    if int(i[-1]) == 0:
        x = Ryori.pop(Ryori.index(i))
        O.append(x)
Ryori = sorted(Ryori,key=lambda x: x[-1], reverse=True)

for i in range(len(Ryori)-1):
    for j in range(10):
        if (int(Ryori[i]) + j) % 10 == 0:
            t += int(Ryori[i]) + j
t += int(Ryori[-1])

for i in O:
    t += int(i)
print(t)

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

sum=0
for i in a_list:
    
    sum+=((i+9)//10)*10

ans_list=[]
for i in a_list:
    b=((i+9)//10)*10-i
    ans_list.append(sum-b)
    
print(min(ans_list))

Solution (Python):
S = [int(input()) for _ in range(5)]
l=[]
m=10
for i in range(5):
    if (S[i]%10)<m and S[i]%10!=0:
        m=S[i]%10
        a=S[i]
        j=i
if m==10:
    a=S[0]  
    j=0      
for i in range(5):
    if  i!=j:
        if S[i]%10!=0:
            S[i]+=10-(S[i]%10)
        l.append(S[i])
l.append(a)
print(sum(l))

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

last = a
if b % 10 != 0 and (last % 10) > (b % 10):
    last = b
if c % 10 != 0 and (last % 10) > (c % 10):
    last = c
if d % 10 != 0 and (last % 10) > (d % 10):
    last = d
if e % 10 != 0 and (last % 10) > (e % 10):
    last = e

target = [a, b, c, d, e]
target.remove(last)
ans = 0
for v in target:
    ans += (((v + 10 - 1) // 10) * 10)
ans += last
print(ans)

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

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)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=[a,b,c,d,e]
f.sort()
x=0
for i in range(5):
  if f[i]%10==0:
    x=x+f[i]
  if f[i]%10!=0:
    x=x+(f[i]//10)*10+10
g=a-(a//10)*10
h=b-(b//10)*10
i=c-(c//10)*10
j=d-(d//10)*10
k=e-(e//10)*10
l=[g,h,i,j,k]
l.sort()
y=0
z=0
for i in range(5):
  if l[i]!=0:
    y=y+1
    z=i
    break
if y==0:
  print(x)
else:
  print(x-(10-l[z]))

Solution (Python):
last = 0
answer = 0
dishes = []
dishes.append(int(input()))

for i in range(1,5):
	dish = int(input()) 
	dishes.append(dish)
	if dish % 10 != 0 and dishes[last] % 10 >  dish % 10:
		last = i


for i in range(5):
	if i == last:
		answer += dishes[i]
	else:
		if dishes[i] % 10 == 0:
			answer += dishes[i] 
		else:
			answer += ((dishes[i]//10)+1)*10

print(answer)

Solution (Python):
abcde=[int(input()) for i in range(5)]
ans=0
m=10
for i in abcde:
  ans += (i+9)//10*10
  m=min(m,(i-1)%10+1)
print(ans-10+m)

Solution (Python):
import sys
import itertools

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst = [a, b, c, d, e]
ans = 1 <<10
for i in itertools.permutations(lst, 5):
    cnt = 0
    for num, j in enumerate(i):
        if num == 4:
            cnt += j
            break
        if j%10 != 0:
            cnt += 10 * (j//10) + 10
        else: cnt += j
    ans = min(ans, cnt)

print(ans)

Solution (Python):
from math import ceil
orders = list(int(input()) for _ in range(5))
total = 0
maximum = 0

for order in orders:
    time = ceil(order / 10) * 10
    total += time
    delta = time - order
    maximum = max(maximum, delta)
print(total - maximum)

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

v_mod = [x%10 if x%10 != 0 else 10 for x in V]
min_mod = min(v_mod)

ans = 0
for i, v in enumerate(V):
    ans += v + (10 - v_mod[i])
ans -= (10 - min_mod)
print(ans)

Solution (Python):

C = [int(input()) for _ in range(5)]
C.sort(key=lambda x:-x%10)
ans = 0
for c in C[:4]:
    ans += 10*((c-1)//10+1)
ans += C[4]
print(ans)

Solution (Python):
menu=[]
menu2=[]
total=False
c=0
total2=0
for i in range(5):
    a=int(input())
    menu.append(a)
    menu2.append(a%10)
    if a%10==0:
        total2+=1
if total2==5:
    print(sum(menu))
else:
    for i in range(1,10):
        for k in range(5):
            if menu2[k]==i:
                total=True
                c=k
                break
        if total==True:
            break
    print(sum(menu)+10*(4-total2)-sum(menu2)+menu2[c])

Solution (Python):
from itertools import permutations
ls=[int(input()) for _ in range(5)]
ans = 1000000
for p in permutations(ls):
    t = 0
    for x in p[:-1]:
        t += x
        if t % 10 != 0:
            t += 10-(t%10)
    t += p[-1]
    ans = min(ans,t)
print(ans)

Solution (Python):
l = []
for i in range(5):
    l.append(int(input()))
amari = []
for i in range(5):
    if 10-l[i]%10 == 10 :
        amari.append(0)
    else :
        amari.append(10-l[i]%10)
jikan = []
for i in range(5):
    if amari[i] == 10:
        jikan.append(l[i])
    else :
        jikan.append(l[i] + amari[i])

print(sum(jikan)-max(amari))

Solution (Python):
from itertools import permutations

def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def calc(i, h):
    return all(h[i] >= h[j] for j in range(i))


def main():
    ans = 1000
    data = [int(input()) for i in range(5)]
    for row in permutations(data, 5):
        time = 0
        for index, i in enumerate(row):
            if index == 4:
                time += i
                continue
            remain = i % 10
            if remain:
                time += i + (10-remain)
            else:
                time += i
        ans = min(ans, time)
    print(ans)



main()

Solution (Python):
a = []
for _ in range(5):
    a.append(int(input()))
c = 0
d = 0
for i in range(5):
    b = a[i] % 10
    if b != 0 and abs(10 - b) > c:
        c = abs(10 - b)
        d = i
e = a.pop(d)
f = 0
for j in a:
    g = j % 10
    if g == 0:
        f += j
    else:
        f += (j // 10 + 1) * 10
f += e
print(f)

Solution (Python):
from itertools import permutations

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
a = [a,b,c,d,e]

perms = list(permutations(a))
ans = float('inf')
for x in perms:
    cur = 0 
    x = list(x)
    for i in range(5):
        cur += x[i]
        temp = cur % 10
        if temp != 0 and i != 4:
            cur += (10 - temp)
    ans = min(ans,cur)
print(ans)

Solution (Python):
def main():
    cost_list = [int(input()) for _ in range(5)]
    amari_list = [cost % 10 for cost in cost_list]

    last_order = 0
    min_amari = 10
    for index, amari in enumerate(amari_list):
        if amari == 0:
            continue
        if amari < min_amari:
            min_amari = amari
            last_order = index

    ans = 0
    for index, cost in enumerate(cost_list):
        if index == last_order:
            ans += cost_list[index]
        else:
            if cost % 10 == 0:
                ans += cost
            else:
                cost = (cost // 10 + 1) * 10
                ans += cost

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
from itertools import permutations
import math
menu=5
times=[int(input()) for i in range(menu)]
orders=list(permutations(times))
minimum=sum(math.ceil(time/10)*10 for time in times)
for order in orders:
    total=order[0]
    for i in range(1,menu):
        total+=math.ceil(order[i]/10)*10
    minimum=min(minimum,total)
print(minimum)

Solution (Python):
a = [int(input()) for i in range(5)]
b = [9 - (i - 1) % 10 for i 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())

l=[A,B,C,D,E]
tot = 0
for i in l:
  tot+=-(-i//10)*10
  
a=max(map(lambda x: -(-x//10)*10-x, l))

print(tot-a)

Solution (Python):
A = sorted( [int(input()) for i in range(5)], key = lambda x : - x % 10)

ans = 0
for i in range(4):
  ans += A[i]
  if ans % 10 > 0:
    ans += 10 - ans % 10
print(ans + A[4])

Solution (Python):
from itertools import permutations
from math import ceil

times = list(int(input()) for _ in range(5))
orders = list(permutations(times, 5))
minimum = sum(ceil(time/10)*10 for time in times)

for order in orders:
    total = order[0]
    for i in range(1, 5):
        total += ceil(order[i]/10)*10
    minimum = min(minimum, total)
print(minimum)

Solution (Python):
from itertools import permutations
from math import ceil

times = list(int(input()) for _ in range(5))
orders = list(permutations(times, 5))
minimum = sum(ceil(time/10)*10 for time in times)

for order in orders:
    cnt = order[0]
    for i in range(1, 5):
        cnt += ceil(order[i]/10)*10
    minimum = min(minimum, cnt)
print(minimum)

Solution (Python):
ls=[]
for i in range(5):
  ls.append(int(input()))
rm=10
time=0
for i in ls:
  if i%10==0:
    time+=i
  else:
    time+=(i//10+1)*10
    rm=min(rm,i%10)
time+=rm-10
print(time)

Solution (Python):
import itertools

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

num_list = [a, b, c, d, e]
factorial = list(itertools.permutations(num_list, 5))
ans_list = []
for list in factorial:
    tmp = 0
    for i in list:
        if tmp%10 == 0:
            tmp += i
        else:
            tmp += 10 - tmp%10
            tmp += i
    ans_list.append(tmp)

ans_list.sort()
ans = ans_list[0]

print(ans)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=[a,b,c,d,e]
data=[0]*5
for i in range(5):
  if f[i]%10==0:
    continue
  else:
    data[i]=10-f[i]%10
print(a+data[0]+b+data[1]+c+data[2]+d+data[3]+e+data[4]-max(data))

Solution (Python):
import math

dishes = []
rest = 10

for i in range(5):
    n = int(input())
    dishes.append(math.ceil(n / 10) * 10)
    if 0 < n % 100 % 10 < rest:
        rest = n % 100 % 10 

print(sum(dishes) - (10- rest))

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

mn = a[0] % 10
for i in a:
    if i % 10 == 0:
        continue
    mn = min(mn, i % 10)

for i in a:
    if i % 10 == mn:
        mn = i
        break


ans = 0
for i in a:
    if i == mn:
        ans += i
        mn = -1
        continue
    t = ((i + 9) // 10) * 10
    ans += t

print(ans)

Solution (Python):
from math import ceil
time=[int(input())for i in range(5)]
mod=[i%10 for i in time]
a=124
res=0
for i in range(len(mod)):
    if mod[i] !=0:
        a=min(a,mod[i])
if a==124:
    a=0
for i in range(5):
    if i==mod.index(a):
        res+=time[i]
    else:
        res+=ceil(time[i]/10)*10
print(res)

Solution (Python):
import itertools
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ls = [A,B,C,D,E]
ls2 = []
for i in itertools.permutations(ls,5):
  ls2.append(list(i))
minimum = 10**5
for i in ls2:
  now = 0
  for j in range(5):
    if j == 0:
      now += i[j]
    else:
      if now % 10 == 0:
        now += i[j]
      else:
        now = 10 * (now//10+1)
        now += i[j]
  if now < minimum:
    minimum = now
print(minimum)

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

Solution (Python):
t=[]
aa=10
for i in range(5):
    x=int(input())
    y=(x-1)%10
    aa=min(aa,y)
    for i in range(14):
        if 10*i>=x:
            t.append(10*i)
            break
print(sum(t)-10+aa+1)

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

diff=0
num=0
for i in l:
  if i%10==0:
    num+=i
  else:
    a=round(i+5,-1)
    num+=a
    diff=max(diff,a-i)

print(num-diff)

Solution (Python):
x = list(map(int, (input() for i in range(5))))
y = sorted(x, key= lambda x:((x+9)//10)*10-x)

s = 0
for z in y[:-1]:
  s += ((10 + z -1)//10)*10
print(s+y[-1])

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

last = foods.pop(foods.index(min(foods, key=lambda x: (x - 1) % 10)))
print(sum(map(lambda x: ((x + 9) // 10) * 10, foods)) + last)

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

res = 0
for i in times:
  res += (int(i)//10)*10+(10 if i[-1] != "0" else 0)
  
time = []
for j in times:
  time.append((int(j[-1]) if j[-1] != "0" else 10))
  
print(res - 10 + min(time))

Solution (Python):
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
times = [A,B,C,D,E]
remains = []
for t in times:
    remains.append(t%10)
last_item_i = -1
rmin = 1e8
for i in range(len(remains)):
    if remains[i] != 0 and remains[i] < rmin:
        rmin = remains[i]
        last_item_i = i
if last_item_i == -1:
    last_item_i = 0

ans = 0
for i in range(len(times)):
    if i != last_item_i:
        t = ((times[i] + 10 - 1)//10)*10
        ans += t

ans += times[last_item_i]

print(ans)

Solution (Python):
from itertools import permutations
from math import ceil

times = [int(input()) for _ in range(5)]
orders = list(permutations(times))
minimum = sum(ceil(time/10)*10 for time in times)

for order in orders:
    total = order[0]
    for i in range(1, 5):
        total += ceil(order[i]/10)*10
    minimum = min(minimum, total)
print(minimum)

Solution (Python):
x = [int(input()) for i in range(5)]
y=0
for i in x:
  if i%10==0:
    y+=i
  else:
    y+=(i+(10-(i%10)))
a=[]
for i in x:
  a.append(i%10)
if a.count(0)!=5:
  while 0 in a:
    a.remove(0)
  b=sorted(a)
  print(y-(10-b[0]))
else:
  print(y)

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

def f(x):
    if 1 <= x and x <= 10:
        return 10
    elif 11 <= x and x <= 20:
        return 20
    elif 21 <= x and x <= 30:
        return 30
    elif 31 <= x and x <= 40:
        return 40
    elif 41 <= x and x <= 50:
        return 50
    elif 51 <= x and x <= 60:
        return 60
    elif 61 <= x and x <= 70:
        return 70
    elif 71 <= x and x <= 80:
        return 80
    elif 81 <= x and x <= 90:
        return 90
    elif 91 <= x and x <= 100:
        return 100
    elif 101 <= x and x <= 110:
        return 110
    elif 111 <= x and x <= 120:
        return 120
    else:
        return 130
    
aa = a + f(b) + f(c) + f(d) + f(e)
bb = b + f(c) + f(d) + f(e) + f(a)
cc = c + f(d) + f(e) + f(a) + f(b)
dd = d + f(e) + f(a) + f(b) + f(c)
ee = e + f(a) + f(b) + f(c) + f(d)
print(min(aa, bb, cc, dd, ee))

Solution (Python):
a = [int(input()) for _ in range(5)]
z,ans = 123,0
for i in a:
    if i%10!=0:z = min(z,i%10)
    ans += 10*((i+10-1)//10)
print(ans+z-10 if (z!=123) or (z==0) else ans)

Solution (Python):
a = [int(input()) for _ in range(5)]
z = 123
ans = 0
for i in a:
    if i%10!=0:z = min(z,i%10)
    ans += 10*((i+10-1)//10)
print(ans+z-10 if (z!=123) or (z==0) else ans)

Solution (Python):
import math
a = [int(input()) for i in range(5)]
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)

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

Solution (Python):
import math
s = 0
m = 10
for i in range(5):
  n = int(input())
  if n % 10 != 0:
    m = min(m, int(str(n)[-1]))
    
  s += math.ceil( n * 0.1 )
if m % 10 != 0:
  s +=  m * 0.1 - 1
print(int(s*10))

Solution (Python):
ls =[]
for i in range(5):
    ls.append(int(input()))
rm = 10
time = 0
for i in ls:
    if i % 10 == 0:
        time += i
    else:
        time += (i//10+1)*10
        rm = min(rm,i%10)
time += rm - 10
print(time)

Solution (Python):
import math

dish=[int(input()) for _ in range(5)]
count={str(i%10):[] for i in range(10,-1,-1)}
for t in dish:
	one=t%10
	count[str(one)].append(t)

ans=0
d=0
for k,v in count.items():
	if v!=[]:
		for c in v:
			if d>3:
				ans+=c
			else:
				ans+=math.ceil(c/10)*10
				d+=1
print(int(ans))

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

min=9

min_f=0

for i in range(5):
    if min> li[i]%10 >0:
        min=li[i]%10
        min_f=i

cnt=0

for i in range(5):
    if i==min_f:
        continue
    if li[i]%10==0:
        cnt+=li[i]
    else:
        cnt+=li[i]+10-li[i]%10
print(cnt+li[min_f])

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
ans = 0
l = [a,b,c,d,e]
ld = [(a+9)%10,(b+9)%10,(c+9)%10,(d+9)%10,(e+9)%10]
i = ld.index(min(ld))
last = l[i]
l.remove(l[i])
for j in l:
  ans += ((j+9)//10)*10
print(ans+last)

Solution (Python):
import itertools, math
a = [int(input()) for i in range(5)]
x = 130*5
for i in itertools.permutations(a):
    y = 0
    for j in range(4):
        y+=math.ceil(i[j]/10)*10
    y+=i[4]
    x=min(x,y)
print(x)

Solution (Python):
from math import *
d = []
l = []
for i in range(5):
    n = int(input())
    t = ceil(n/10)
    d.append(t)
    l.append(t-n/10)
print(int((sum(d) - max(l))*10))

Solution (Python):
def resolve():
    '''
    code here
    '''
    import math

    dishes = [int(input()) for _ in range(5)]
    dev_dis = [item % 10 for item in dishes if item % 10 != 0]
    dev_dis.sort()

    res = sum(dishes)
    if dev_dis:
        for item in dev_dis[1:]:
            if item != 0:
                res += 10 -item

    print(res)

if __name__ == "__main__":
    resolve()

Solution (Python):
menu = [int(input()) for i in range(5)]
def kuriage(n):
    if n %10 == 0:
        return 0
    else:
        return 10-(n %10)
ans = 0
mini = 10
k = 5
for i in range(5):
    if menu[i] %10 < mini and menu[i]%10 !=0:
        mini = menu[i] %10
        k = i
for i in range(5):
    if i == k:
        menu[i], menu[-1] = menu[-1], menu[i]

for i in range(5):
    if i != 4:
        ans += menu[i] + kuriage(menu[i])
    else:
        ans += menu[-1]
        print(ans)

Solution (Python):
import math
import itertools
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
p = list(itertools.permutations([A, B, C, D, E], 5))

ans = 10**9
for pi in p:
    order1 = 0
    order2 = math.ceil(pi[0] / 10) * 10
    order3 = math.ceil((order2 + pi[1]) / 10) * 10
    order4 = math.ceil((order3 + pi[2]) / 10) * 10
    order5 = math.ceil((order4 + pi[3]) / 10) * 10
    total = order5 + pi[4]
    ans = min(ans, total)
print(ans)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    (*A,) = map(int, read().split())

    ans = INF
    for i in range(5):
        res = A[i]
        for j in range(5):
            if j != i:
                res += (A[j] + 9) // 10 * 10
        if ans > res:
            ans = res

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
from itertools import permutations
import math


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

lis = list(permutations(x,5))


minimum = 0
for i in x:
    minimum += math.ceil(i/10)*10

total = 0
for l in lis:
    total = l[0]
    for i in range(1,5):
        total += math.ceil(l[i]/10)*10
    minimum = min(minimum,total)

print(minimum)

Solution (Python):
import math
ans=0
A=[int(input()) for i in range(5)]
a=10
p=0
for i in range(5):
  if a>(A[i]%10) and A[i]%10!=0:
    p=i
    a=A[i]%10
for i in range(5):
  if i==p:
    ans+=A[i]
  else:
    ans+=10*(math.ceil(A[i]/10))
print(ans)