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 = []
for i in range(5):
    a.append(int(input()))

b = []
c = []
for j in range(5):
    if a[j] % 10 == 0:
        c.append(10)
        b.append(a[j]-10)
    else:
        
        num = a[j] % 10
        c.append(num)
        b.append(a[j] - c[j])

b_sum = sum(b)
c_min = min(c)
c_sum = c_min + 4*10
 
print(b_sum + c_sum)

Solution (Python):

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
a = (10 - A) % 10
b = (10 - B) % 10
c = (10 - C) % 10
d = (10 - D) % 10
e = (10 - E) % 10
 
print(A+B+C+D+E+a+b+c+d+e-max([a,b,c,d,e]))

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

b = []
c = []
for j in range(5):
    if a[j] % 10 == 0:
        c.append(10)
        b.append(a[j]-10)
    else:
        
        num = a[j] % 10
        c.append(num)
        b.append(a[j] - c[j])

b_sum = sum(b)
c_min = min(c)
c_sum = c_min + 4*10
 
print(b_sum + c_sum)

Solution (Python):
a = []
for _ in range(5):
    b = int(input())
    t = 10 if b%10 == 0 else b%10
    a.append((t, b))
a.sort()
a.reverse()
c = 0
for i in range(4):
    if a[i][0] == 10:
        c += (a[i][1]  - a[i][1] % 10)
    else:
        c += (a[i][1] + (10 - a[i][1] % 10))
c += a[-1][1]
print(c)

Solution (Python):
times = [int(input()) for _ in range(5)]
fractions = [10 - t % 10 for t in times if t % 10 != 0]
if fractions:
    fraction = max(fractions)
else:
    fraction = 0
print(sum([(t + 9) // 10 * 10 for t in times]) - fraction)

Solution (Python):
a = []

for i in range(5):
    a.append(int(input()))


def ceil10(n):
    return ((n + 9) // 10) * 10


ans = 999

for i in range(5):
    t = 0

    for j in range(5):
        if j == i:
            t += a[j]
        else:
            t += ceil10(a[j])
    ans = min(ans, t)

print(ans)

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

b = []
c = []
for j in range(5):
    if a[j] % 10 == 0:
        b.append(a[j]-10)
        c.append(10)
    else:
        c.append(a[j] % 10)
        b.append(a[j] - c[j])
        

b_sum = sum(b)
c_min = min(c)
c_sum = c_min + 4*10

print(b_sum + c_sum)

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

b = []
c = []
for j in range(5):
    if a[j] % 10 == 0:
        c.append(10)
        b.append(a[j]-10)
    else:
        num = a[j] % 10
        c.append(num)
        b.append(a[j] - c[j])
        

b_sum = sum(b)
c_min = min(c)
c_sum = c_min + 4*10

print(b_sum + c_sum)

Solution (Python):
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
a=[A,B,C,D,E]
mod=0
mx=0
for i in range(5):
    if mod<10-a[i]%10 and a[i]%10!=0:
        mx=i
        mod=10-a[i]%10
ans=0
for i in range(5):
    if i!=mx and a[i]%10!=0:
        ans+=a[i]+10-a[i]%10
    else:
        ans+=a[i]
print(ans)

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


lsd = 10  
lsd_min_index = -1
for k, time in enumerate(Menu):
    if time % 10 < lsd and not time % 10 == 0:
        lsd = time % 10
        lsd_min_index = k
ans = 0
for k, time in enumerate(Menu):
    if k == lsd_min_index or time % 10 == 0:
        ans += time
    else:
        ans += time // 10 * 10 + 10  
print(ans)

Solution (Python):

"""
Created on Sat Apr  6 21:54:27 2019

@author: yuta
"""

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

def main(x):
    rest = list(map(lambda y: 10 - y%10,x))
    for i in range(5):
        if rest[i] == 10:
            rest[i] = 0
    rest_sort = sorted(rest)
    t = sum(x) + sum(rest_sort[0:4])
    print(t)

main(ABCDE)

Solution (Python):
sum = 0
back = 0
for i in range(5):
    a = int(input())
    if a % 10 != 0:
        b = 10 - a%10
    else:
        b = 0
    back = max(back, b)
    sum += a + b

print(sum-back)

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = 0
g = 0
h = 0
i = 0
j = 0

if a%10!=0:
  f = (a+(10-a%10))-a  
if b%10!=0:
  g = (b+(10-b%10))-b
if c%10!=0:
  h = (c+(10-c%10))-c
if d%10!=0:  
  i = (d+(10-d%10))-d
if e%10!=0:  
  j = (e+(10-e%10))-e

k = [f,g,h,i,j]
k.sort()



if a%10!=0:
  a = a+(10-a%10)
  
if b%10!=0:
  b = b+(10-b%10)  
  
if c%10!=0:
  c = c+(10-c%10)  
  
if d%10!=0:
  d = d+(10-d%10)  
  
if e%10!=0:
  e = e+(10-e%10)  
  
ans = a + b + c + d + e - k[4]

print(ans)

Solution (Python):
a=eval('int(input()),'*5);print(min(~-i%10for i in a)-sum(-i//10*10for i in a)-9)

Solution (Python):
import math
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
ans = 0
min1 = 10
for i in range(0,5):
    m = A[i] % 10
    if ((m > 0) and (m < min1)):
        min1 = m        
    ans += math.ceil(A[i] / 10) * 10
print(ans - (10 - min1))

Solution (Python):
data_ls = []
for i in range(5):
    data_ls.append(int(input()))
data_ls.sort(key= lambda x:x%10)
_sum = 0
flg = 0
for i in data_ls:
    if flg == 0:
        if i % 10 == 0:
            _sum += i
        else:
            _sum += i
            flg = 1
    else:
        _sum += (i // 10 + 1) * 10
print(_sum)

Solution (Python):
from itertools import permutations
A = [ int( input()) for _ in range(5)]
ans = 1000
for p in permutations( range(5)):
    now = A[p[0]]
    for i in range(4):
        if now%10 == 0:
            now += A[p[i+1]]
        else:
            now = (now//10+1)*10
            now += A[p[i+1]]
    ans = min( ans, now)
print( ans)

Solution (Python):
from math import ceil

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

ans = float('inf')
for i in range(5):
    
    t = 0
    for j in range(5):
        
        if i == j:
            t += v[j]
        else:
            t += ceil(v[j] / 10) * 10
    ans = min(ans, t)
print(ans)

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

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

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

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

print(result)

Solution (Python):
import sys
from fractions import gcd
from itertools import groupby as gb
from itertools import permutations as perm
from collections import Counter as C
from collections import defaultdict as dd
sys.setrecursionlimit(10**5)

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

res = 10**100
for ll in perm(l):
    now = 0
    for ii,i in enumerate(ll):
        now += p[i]
        if now % 10 != 0 and ii!=4:
            now //= 10
            now += 1
            now *= 10
    res = min(res, now)
print(res)

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

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


m = 10
cnt = 0
for i in memo:
    if i % 10 == 0:
        cnt += int(i/10)
    else:
        cnt += int(i/10)+1

    if i%10 < m and i%10 != 0:
        m = i%10

print(cnt*10-(10-m))

Solution (Python):
def maxtime(x):
  return (x + 9) // 10 * 10

def restime(x):
  return maxtime(x) - x

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

sumtime = maxtime(A)+maxtime(B)+maxtime(C)+maxtime(D)+maxtime(E)
maxrestime = max(restime(A),restime(B),restime(C),restime(D),restime(E))
print(sumtime - maxrestime)

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

b = []
c = []
for j in range(5):
    if a[j] % 10 == 0:
        c.append(10)
        b.append(a[j]-10)
    else:
        c.append(a[j] % 10)
        b.append(a[j] - c[j])
        

b_sum = sum(b)
c_min = min(c)
c_sum = c_min + 4*10

print(b_sum + c_sum)

Solution (Python):
a=eval('int(input())-1,'*5);print(min(i%10for i in a)+sum((i//10+1)*10for i in a)-9)

Solution (Python):
list = [int(input()) for i in range(5)]
list_amari = [(i-1) % 10 +1 for i in list]
min = min(list_amari)
for i in range(5):
  min += list[i] - list_amari[i] +10
  
print(min-10)

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

Solution (Python):
li = []
for i in range(5):
  li.append(int(input()))
mi = 1e10
ans = 0
for i in range(5):
  ans+=(li[i]//10+(li[i]%10!=0))*(10)
  mi = min(mi,li[i]%10+(li[i]%10==0)*10)
print(ans - 10 + mi)

Solution (Python):

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)

Solution (Python):

import numpy as np
A = np.zeros(5)
B = np.zeros(5)
time = 0
for i in range(5):
    A[i] = int(input())
    if A[i] % 10 == 0:
        B[i] = 10
    else:
        B[i] = A[i] % 10
B = np.sort(B)
for h in range(5):
    time += A[h] + 10 - B[h]
time = time-10+B[0]
print("{}".format(int(time)))

Solution (Python):
import numpy as np
import math

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


dishes=np.array([A,B,C,D,E])
dishes_1=np.array(list(map(lambda x: x%10, dishes)))


last=0
ans=0
if np.all(dishes_1==0):
  print(A+B+C+D+E)
else:
  dishes=np.dstack([dishes, dishes_1])
  dishes=dishes[0]
  dishes=sorted(dishes, key=lambda x: x[1])
  for i in range(len(dishes)):
      if dishes[i][1]!=0:
          last=dishes[i]
          dishes=np.delete(dishes, [i], axis=0)
          break
  for j in range(len(dishes)):
      ans=ans+dishes[j][0]+((10-dishes[j][0]%10)%10)
  print(ans+last[0])

Solution (Python):
p = []
for i in range(5):
    p.append(input())
u = 10
v = 0
for i in range(5):
    if int(p[i][-1]) < u and int(p[i][-1]) != 0:
        u = int(p[i][-1])
        v = int(p[i])
q = []
r = 0
for i in range(5):
    if v != int(p[i]) or r == 1:
        if int(p[i][-1]) != 0:
            q.append(int(p[i]) + 10 - int(p[i][-1]))
        else:
            q.append(int(p[i]))
    else:
        r = 1
print(sum(q) + v)

Solution (Python):

lst=[input()for i in range(5)]
lst.sort(key=lambda x:str(int(x[-1])+9)[-1])
ans=0
for i in lst[1:]:
    if int(i[-1])!=0:
        if len(i)!=1:
            tmp=str(int(i[:-1])+1)+"0"
            ans+=int(tmp)
        elif len(i)==1:
            ans+=10
    elif int(i[-1])==0:
        ans+=int(i)

print(ans+int(lst[0]))

Solution (Python):
from itertools import permutations

A = [int(input()) for i in range(5)]
ans = 1e10 
for a in permutations(A):
    tmp = 0
    for x in a:
        if tmp % 10 != 0:
            tmp += 10 - (tmp % 10)
        tmp += x
    ans = min(ans, tmp)
print(ans)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
li = [a,b,c,d,e]

for i in range(len(li)):
    if li[i]%10 != 0:
        if li[i]%10 == min([x%10 if x%10 != 0 else 10 for x in li]):
            N = i+0
            break
else:
    N = 0


for j in range(len(li)):
    if j == N:
        continue
    elif li[j]%10 != 0:
        li[j] += 10 - li[j]%10

print(sum(li))

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

b = []

for i in a:
    n = i % 10
    b.append(n)
sum = 0
if b == [0,0,0,0,0]:
    for j in a:
        sum += j
    print(sum)
else:
    c = [i for i in b if i > 0]
    c.sort()

    for j in a:
        sum += j
 
    n = 0
    for k in c:
        n += 10 - k

    N = sum + n + (c[0] - 10)
    print(N)

Solution (Python):
import math
from functools import reduce
l = [int(input()) for _ in range(5)]
r = 9
n = 0
for i, j in zip([I % 10 for I in l], range(5)):
    if i != 0 and i < r:
        r = i
        n = j
ceil = lambda n: math.ceil(n / 10) * 10
print(l.pop(n) + reduce(lambda a, b: ceil(a) + ceil(b), l))

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


l = [A, B, C, D, E]
l2 = list()



m = -1

for x in l:
    t = int(x) % 10
    if t == 0:
        l2.append(int(x))
    else:
        l2.append((int(x) + 10) // 10 * 10)

l3 = [int(x) % 10 for x in l]
l3 = [x for x in l3 if x != 0]

if len(l3) == 0:
    print(sum(l2))
else:
    print(sum(l2) - 10 + min(l3))

Solution (Python):
x = [input() for _ in range(5)]
t = 9
fl = False
digits = 0
for idx, i in enumerate(x):
	i = str(int(i) + 10)
	digits = len(i)
	a = int(i[-1])
	if a != 0:
		if t >= a:
			t = a
			fl = True
		if digits == 1:
			x[idx] = "10"
		elif digits == 2:
			x[idx] = "".join((i[-2], "0"))
		else:
			x[idx] = "".join((i[-3], i[-2], "0"))
if not fl: t = 10
print(sum([int(_) for _ in x]) - 10 + t)

Solution (Python):
abcde = list()
ans = 99999
flag = True

for i in range(5):
    abcde.append(int(input()))
    
for i in range(5):
    p_ans = 0
    p_ans += abcde[i]
    for j in range(5):
        if i != j:
            if abcde[j] % 10 == 0: p_ans += abcde[j]
            else:p_ans += abcde[j] + (10 - abcde[j] % 10)
    if ans > p_ans:
        ans = p_ans
print(ans)

Solution (Python):
a = [int(input())  for i in range(5)]
def amari(num):
    return num % 10
b = list(map(amari, a))
b_r = [10 if i == 0 else i for i in b]
d = min(b_r)
c = sum(a) - sum(b_r) + 40 + d
print(c)

Solution (Python):
times = [int(input()) for _ in range(5)]
diff = [False for i in range(10)]
for time in times:
    diff[time%10]=True
res = 0
for i in range(1, 10):
    if diff[i]:
        res=i
        break
else:
    res=10

for i in range(5):
    rep = times[i]//10
    if times[i]%10!=0:
        rep+=1
    times[i] = rep*10

print(sum(times) - (10 - res))

Solution (Python):



import math

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
List1=[a,b,c,d,e]
List2=[(a-1)%10,(b-1)%10,(c-1)%10,(d-1)%10,(e-1)%10]


index=List2.index(min(List2))


ans = math.ceil(a/10)+math.ceil(b/10)+math.ceil(c/10)+math.ceil(d/10)+math.ceil(e/10)-math.ceil(List1[index]/10)+List1[index]/10
ans = int(ans*10)

print(ans)

Solution (Python):
k = 0
m = 0
for i in range(5):
    a = int(input())
    k += a + (10 - a%10)%10
    m = max(m, (10 - a%10)%10)
print(k-m)

Solution (Python):
a = [int(input()) for _ in range(5)]
b = [(x % 10, x) for x in a]
b.sort()
ans = 0
flag = True
for c in b:
    if c[0] == 0:
        ans += c[1]
    else:
        if flag:
            flag = False
            ans += c[1]
        else:
            ans += c[1] - c[0] + 10
print(ans)

Solution (Python):


A = [input() for i in range(5)]
m = 9
flag = True
for a in A:
    if int(a[-1]) == 0:
        pass
    elif int(a[-1]) <= m:
        flag = False
        m = int(a[-1])
        min_dish = a
B = [int(i) for i in A]
if flag:
    min_dish = str(min(B))
sum = int(min_dish)
A.remove(min_dish)
for a in A:
    if int(a[-1]) == 0:
        sum += int(a)
    else:
        sum += int(a) + int(10) - int(a[-1])
print(int(sum))

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

time = []

for i in range(5):
  time.append(0)
  while (times[i] + time[i]) % 10 != 0:
    time[i] += 1

print(sum(times)+sum(time)-max(time))

Solution (Python):
t=[]
for _ in range(5):
    t.append(int(input()))
d=[0]*5
tt = [0]*5
for i in range(5):
    d[i] = t[i]%10 if t[i] %10!=0 else 10
    tt[i] =t[i]//10+1 if t[i]%10!=0 else t[i]//10
print(sum(tt)*10-10+min(d))

Solution (Python):
li = [int(input()) for i in range(5)]
al = []
ans = 0
for i in li:
  if i % 10 != 0:
    al.append(i % 10) 
  ans += i // 10
ans *= 10
if len(al) > 0:
  ans += min(al) + (len(al) - 1)*10
print(ans)

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

a = 10
y = 0
for i in range(5):
  s = int(l[i]) % 10
  if a > s & s != 0:
    a = s
    y = i
    
sum = 0
for i in range(5):
  if y == i:
    sum += int(l[y])
  else:
    sum += int(l[i])
    if int(l[i])%10 != 0:
      sum += (10 - (int(l[i])%10))
print(sum)

Solution (Python):
a = [float(input()) for i in range(5)]
sum = 0
amari = 10
index = 0
for i in range(5):
    if a[i] % 10 < amari and a[i] % 10 != 0:
        index = i
        amari=a[i] % 10
        

for i in range(5):
    if i == index:
        pass
    else:
        if a[i] % 10 != 0:
            sum += a[i]+10 - a[i] % 10
        else:
            sum += a[i]
sum += a[index]
print(int(sum))

Solution (Python):
def f(v):
	y=0
	for x in v:y=(y+9)//10*10+x
	return y
print(min(f(x)for x in __import__('itertools').permutations(int(input())for _ in[0]*5)))

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

f=0
g=[a%10,b%10,c%10,d%10,e%10]
saisyo=10

f+=math.ceil(a/10)*10
f+=math.ceil(b/10)*10
f+=math.ceil(c/10)*10
f+=math.ceil(d/10)*10
f+=math.ceil(e/10)*10

for i in g:
    if 0<i<saisyo:
        saisyo=i
        

print(f-10+saisyo)

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

AA = int(A)
BB = int(B)
CC = int(C)
DD = int(D)
EE = int(E)

a = A[-1]
b = B[-1]
c = C[-1]
d = D[-1]
e = E[-1]

aa = int(a)
bb = int(b)
cc = int(c)
dd = int(d)
ee = int(e)

data = [aa ,bb, cc, dd, ee]
def func(x):
    if(x==0): return False
    else: return True
    
filtered = filter(func, data)

if aa==bb==cc==dd==ee==0:
    kk =int(10)
else:
    kk = min (filtered)

n = int(0)

if aa == 0 :
    n = n+AA
else:
    n = n+AA+10-aa
if bb == 0 :
    n = n+BB
else:
    n = n+BB+10-bb
if cc == 0 :
    n = n+CC
else:
    n = n+CC+10-cc
if dd == 0 :
    n = n+DD
else:
    n = n+DD+10-dd
if ee == 0 :
    n = n+EE
else:
    n = n+EE+10-ee
print(n+kk-10)

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

a = 10 - (A % 10)
if a == 10:
    a = 0
b = 10 - (B % 10)
if b == 10:
    b = 0    
c = 10 - (C % 10)
if c == 10:
    c = 0
d = 10 - (D % 10)
if d == 10:
    d = 0
e = 10 - (E % 10)
if e == 10:
    e = 0
f = max(a, b, c, d, e)
print(A + B + C + D + E + a + b + c + d + e - f)

Solution (Python):
import sys
import numpy as np

a_t=int(input())
b_t=int(input())
c_t=int(input())
d_t=int(input())
e_t=int(input())

a_d = a_t % 10
b_d = b_t % 10
c_d = c_t % 10 
d_d = d_t % 10
e_d = e_t % 10

dish_d = np.zeros(5)
dish_d[0] = a_d
dish_d[1] = b_d
dish_d[2] = c_d
dish_d[3] = d_d
dish_d[4] = e_d

if any(dish_d) == 0:
    time = (
        a_t // 10 + np.where(a_d==0, 0, 1) \
        + b_t  // 10 + np.where(b_d==0, 0, 1) \
        + c_t // 10 + np.where(c_d==0, 0, 1) \
        + d_t // 10 + np.where(d_d==0, 0, 1) \
        + e_t // 10 + + np.where(e_d==0, 0, 1)
       ) * 10
else:
    time = (
            a_t // 10 + np.where(a_d==0, 0, 1) \
            + b_t  // 10 + np.where(b_d==0, 0, 1) \
            + c_t // 10 + np.where(c_d==0, 0, 1) \
            + d_t // 10 + np.where(d_d==0, 0, 1) \
            + e_t // 10 + + np.where(e_d==0, 0, 1)
           ) * 10 - (10 - np.min(dish_d[np.nonzero(dish_d)]))
print(int(time))

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a,b,c,d,e]
h = 0
j =[]
for i in range(0, 5):
    f = l[i] // 10
    g = l[i] % 10
    if not(g == 0):
        f = f + 1
        j.append(g)
    f = f * 10
    h = h + f
    
if not(j == []):
    h = h + min(j) -10
print(h)

Solution (Python):
def f(v):
	y=0
	for x in v:y=(y+9)//10*10+x
	return y
print(min(f(x) for x in __import__('itertools').permutations(int(input())for _ in[0]*5)))

Solution (Python):
import math
from functools import reduce
l = [int(input()) for _ in range(5)]
ans = 9
n = j = 0
for i in [I % 10 for I in l]:
    if i != 0 and i < ans:
        ans = i
        n = j
    j += 1
ceil = lambda n: math.ceil(n / 10) * 10
print(l.pop(n) + reduce(lambda a, b: ceil(a) + ceil(b), l))

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

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

a1=int((a-1)/10)+1
b1=int((b-1)/10)+1
c1=int((c-1)/10)+1
d1=int((d-1)/10)+1
e1=int((e-1)/10)+1

min = min((a-1)%10,(b-1)%10,(c-1)%10,(d-1)%10,(e-1)%10)
  
def time():
  
  return(a1*10+b1*10+c1*10+d1*10+e1*10+min-9)
  

print(time())

Solution (Python):
order = [int(input()) for _ in range(5)]
min_digit = 9
time = 0
for i in range(len(order)):
  if order[i]%10!=0:
    time+=(order[i]//10+1)*10
  else:
    time+=order[i]

for i in range(len(order)):
  digit = order[i]%10
  if min_digit>=digit and digit!=0:
    min_digit=digit
    
order_digit = [i%10 for i in order]
if order_digit == [0,0,0,0,0]:
  print (time)
else:
  print (time-10+min_digit)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
sum = 0
smallnum = 10

listX = [A, B, C, D, E]

for i in listX:
    if i % 10 == 0:
        sum += i
    else:
        if i % 10 < smallnum:
            smallnum = i % 10
        sum += (10 + i - i%10)

print(sum + smallnum - 10)

Solution (Python):
import itertools
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
lists = [A,B,C,D,E]
time = 0
min = 9999
for i,j,k,m,n in itertools.permutations(lists):
        menu_list = [i,j,k,m,n]
        time = 0
        for l in range(5):
                time += menu_list[l]
                if time % 10 != 0 and l != 4:
                         time = (time - (int(time % 10))) + 10
                else:
                        continue
        if min > time:
                min = time
print(min)

Solution (Python):
import copy
def mise(times, temp, time, n):
    mise_time = 1000
    n += 1
    time1 = time
    for i in range(len(temp)):
        temp1 = copy.copy(temp)
        time1 = time
        time1 += temp1.pop(i)
        if n == len(times):
            return time1
        while True:
            if time1 % 10 == 0:
                break
            time1 += 1
        temp_time = mise(times, temp1, time1, n)
        if temp_time < mise_time:
            mise_time = temp_time
    return mise_time

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

times = [a, b, c, d, e]
timess = 1000
for i in range(len(times)):
    time = 0
    temp = copy.copy(times)    
    temp_time = mise(times, temp, time, 0)
    if temp_time < timess:
        timess = temp_time
print(timess)

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

mod_list = []

a_mod = a % 10
if a_mod == 0:
    a_total = a
else:
    a_total = a + (10 - a_mod)
    mod_list.append(a_mod)

b_mod = b % 10
if b_mod == 0:
    b_total = b
else:
    b_total = b + (10 - b_mod)
    mod_list.append(b_mod)

c_mod = c % 10
if c_mod == 0:
    c_total = c
else:
    c_total = c + (10 - c_mod)
    mod_list.append(c_mod)

d_mod = d % 10
if d_mod == 0:
    d_total = d
else:
    d_total = d + (10 - d_mod)
    mod_list.append(d_mod)

e_mod = e % 10
if e_mod == 0:
    e_total = e
else:
    e_total = e + (10 - e_mod)
    mod_list.append(e_mod)

min_mod = 0
if len(mod_list) != 0:
    min_mod = min(mod_list)

if min_mod == 0:
    cut_time = 0
else:
    cut_time = 10 - min(mod_list)

print(a_total + b_total + c_total + d_total + e_total - cut_time)

Solution (Python):

import numpy as np
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
ls=[a,b,c,d,e]
ls_1=[]
for i in range(len(ls)):
    ls_1.append(int(str(ls[i])[-1]))
ls_1=np.array(ls_1)
ls_1_10=10-ls_1
ls_1_10[ls_1_10==10]=0

a=np.argmax(ls_1_10)
ls_non=np.delete(ls_1_10, a, 0)

ls=np.array(ls)
ans=np.sum(ls) + np.sum(ls_non)
print(ans)

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

lm = 10
at = 0
t = 0
count = 0
for j in range(5):
    t,l = divmod(M[j],10)
    if lm > l and l != 0:
        lm = l
        at += t * 10
        count += 1
    elif l == 0:
        at += t * 10
    else:
        at += t * 10
        count += 1

at += lm + (10 * (count - 1))
print(at)

Solution (Python):
A = input()
B = input()
C = input()
D = input()
E = input()
L = [A,B,C,D,E]

m=9
for i in L:
    if(i[-1]!="0"):
        m=min(m,int(i[-1]))

ans=0
flag=1
for i in L:
    if(i[-1]==str(m) and flag):
        ans+=int(i)
        flag=0
        
    else:
        ans+=int(i)
        if(i[-1]!="0"):
            ans+=10-int(i[-1])
print(ans)

Solution (Python):
import math 
a = [int(input())for i in range(5)]
rest = []
t = 0
for i in a:
  if i%10 == 0 :
    t+=i
  else:
    rest.append(i)
if rest == [] :
  print(t)
else :
  f = sorted(rest, key=lambda x:str(x)[-1] ,reverse=True)
  c = [math.ceil(i/10)*10for i in f[:-1]]
  t += sum(c)+f[-1]
  print(t)

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

amarino_times = [i % 10 for i in times]



























sum = 0
for i in times:
    if i % 10 == 0:
        sum += i
    else:
        sum += i + 10-i % 10

hoge = []
for i in range(len(amarino_times)):
    if amarino_times[i] != 0:
        hoge.append(amarino_times[i])

if any(amarino_times):
    sum -= (10-min(hoge))

print(sum)

Solution (Python):
import math
List=[int(input()) for i in range(5)]
t = 0
min_q = 99
for i in range(5):
  q = List[i]%10
  t += math.ceil(List[i]/10)*10

  if q >0:
    min_q = min(min_q, q)
if min_q != 99:
  t -= 10 - min_q
print(t)

Solution (Python):
import itertools
List=[int(input()) for i in range(5)]
List_2=list(itertools.permutations(List))
min = 100000
count = 0
for i in List_2:
  time = 0
  for j in i:
    if count != 4:
      time += j
      if time % 10 != 0:
        time = ((time // 10) + 1) * 10  
      count += 1
    elif count == 4 :
      time += j
      count = 0
  if time < min:
    min = time
print(min)

Solution (Python):
li = [str(input()) for i in range(5)]
tmp = []
tmp_2 = []
s = 0
for i in range(5):
    if 10-int(li[i][-1]) != 10:
        tmp.append(10-int(li[i][-1]))
    tmp_2.append(int(li[i]))
tmp.sort()
if len(tmp) != 0:
    print(sum(tmp_2)+(sum(tmp)-tmp[-1]))
else:
    print(sum(tmp_2))

Solution (Python):
li = []
l = []
for i in range(5):
    a = int(input())
    li.append(a)
    if a % 10 != 0:
        l.append(a%10)
    else:
        l.append(10)
ind = l.index(min(l))
ans = 0
for i in range(5):
    if i != ind and i != 10:
        ans += (li[i] + 10 - l[i])
    elif i != ind and i == 10:
        ans += (li[i] - l[i])
print(ans+li[ind])

Solution (Python):
a=[int(input()) for i in range(5)]
b=[a[i]%10 for i in range(5)]
c= sorted(b)
for i in range(5):
	if c[i]!=0:
		for j in range(5):
			if c[i]==b[j]:
				d=j
		break
for i in range(5):
	if a[i]%10 !=0 and i!=d:
		while True:
			a[i]=a[i]+1
			if a[i] % 10==0:
				break
print(sum(a))

Solution (Python):
import math
import itertools
inputs = [input() for i in range(5)]
nl = [0, 1, 2, 3, 4]
l = list(itertools.permutations(nl))
t = 0
ans = -1
for li in l:
    for a in li:
        t = (math.ceil((t)/10)) * 10 + int(inputs[a])
    if ans == -1 or t < ans:
        ans = t
        c = li
    t = 0
print(ans)

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

if a%10!=0:
	a0 = a + ( 10 - a%10 )
else:
	a0 = a


if b%10!=0:
	b0 = b + ( 10 - b%10 )
else:
	b0 = b  
    
if c%10!=0:
	c0 = c + ( 10 - c%10 )
else:
	c0 = c
  
if d%10!=0:
	d0 = d + ( 10 - d%10 )
else:
	d0 = d
  
  
if e%10!=0:
	e0 = e + ( 10 - e%10 )
else:
	e0 = e


if a%10 != 0:
    a1 = 10 - a%10
else:
  	a1 = 0
    
if b%10 != 0:
    b1 = 10 - b%10
else:
  	b1 = 0
    
if c%10 != 0:
    c1 = 10 - c%10
else:
  	c1 = 0
    
if d%10 != 0:
    d1 = 10 - d%10
else:
  	d1 = 0
    
if e%10 != 0:
    e1 = 10 - e%10
else:
  	e1 = 0

l = max([a1, b1, c1, d1, e1])
	

print(a0+b0+c0+d0+e0-l)

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

l = [A, B, C, D, E]
min = 129
count = 0

for ll in l:
    if ll % 10 <= min % 10 and ll % 10 != 0:
        if min != 129:
            count += (int(min / 10) + 1) * 10
        
        min = ll
    
    else:
        if ll % 10 == 0:
            count += ll
        else:
            count += (int(ll / 10) + 1) * 10
    
if min == 129:
    print(count)
else:
    print(count + min)