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 itertools
import math

A= int(input())
B= int(input())
C= int(input())
D= int(input())
E= int(input())
food = list(itertools.permutations((A,B,C,D,E)))
time = 1000

for i in range(len(food)):
    temptime = 0
    for j in range(4):
        temptime += math.ceil(food[i][j]/10)*10
    temptime += food[i][4]
    time = min(temptime,time)

print(time)

Solution (Python):

a = []

timeloss =[]
for i in range(5):
    a.append(int(input()))
    timeloss.append((10-a[i]) % 10)

count = 0
for i in range(4):
    if timeloss[i + 1]>timeloss[count]:
        count = i + 1
t = sum(a) + sum(timeloss) - timeloss[count]
print(t)

Solution (Python):
A = [int(input()) for i in range(5)]
B = []
for a in A:
    b = a
    if b%10!=0:
        b+=9
        b = b//10*10
    B.append(b)
min_time = 10**10
for i in range(5):
    time = A[i]
    for j in range(5):
        if j==i:
            continue
        time+=B[j]
    min_time = min(min_time,time)
print(min_time)

Solution (Python):
T = [[0,0],[0,0],[0,0],[0,0],[0,0]]
for i in range(5):
	t = int(input())
	if t%10 == 0:
		T[i][0] = 10
	else:
		T[i][0] = t%10
	T[i][1] = t

T.sort(reverse=True)

ans = 0
for i in range(4):
	if T[i][0] == 10:
		ans += T[i][1]
	else:
		ans += (T[i][1]//10+1)*10
	
ans += T[4][1]
print(ans)

Solution (Python):
from sys import stdin
data = [None] * 5
data_amari = [None] * 5
data_kiriage = [None] * 5
for itr in range(0,5):
    data[itr] = int(stdin.readline().rstrip())
    if (data[itr]%10 != 0):
        data_amari[itr] = data[itr] % 10
        data_kiriage[itr] = data[itr] + (10-data[itr] % 10)
    else:
        data_amari[itr] = 10
        data_kiriage[itr] = data[itr]

sum = 0
for itr in range(0,5):
    if itr != data_amari.index(min(data_amari)):
        sum += data_kiriage[itr]
    else:
        sum += data[itr]
print(sum)

Solution (Python):
inn=[]
hoge=[]
zero=0

mini=0

for i in range(5):
    a=int(input())
    inn.append(a)
    if a%10==0:
        zero +=1

amari=[]
for v in inn:
    amari.append(v%10)

if max(amari)==0:
    print(sum(inn))
    exit()
else:
    amari.sort()
    for v in amari:
        if v!=0:
            mini=v
            break
    for v in inn:
        hoge.append((v//10)*10+10)

    print(sum(hoge)+mini-10-10*zero)
    exit()

Solution (Python):
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A = [I() for i in range(5)]
num = 0
tmp = 0
for i in range(5):
    if str(A[i])[-1] != "0":
        num = max(num,10 - int(str(A[i])[-1]) )
        tmp += 10
    if len(str(A[i]))!=1:
        tmp += 10*int(str(A[i])[:-1])

print(tmp-num)

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

ans = 0
minui = 1000000
u = [a,b,c,e,d]
for i in range(len(u)):
    if u[i]%10==0:
        ans += u[i]
        
    else:
        if (minui>u[i]%10)and(u[i]!=0):
            minui=u[i]%10
        ans += u[i]-u[i]%10+10
        


if(minui == 1000000):
    minui=10


     


print(ans-10+minui)

Solution (Python):
import numpy as np
import math

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


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

Y=np.zeros(5)
for i in range(5):
  Y[i]=math.ceil(X[i]/10)*10

Z=np.zeros(5)
for i in range(5):
  Z[i]=np.sum(Y)-Y[i]+X[i]

print(int(min(Z)))

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

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


def v(x):
    if x % 10 == 0:
        return 9
    else:
        return x % 10


bb = list(reversed(sorted(map(lambda x: (v(x), x), aa))))

total = 0
for _, x in bb:
    if total % 10 == 0:
        pass
    else:
        total = ((total // 10) + 1) * 10
    total += x

print(total)

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

for i in range(5):
    a[i][0] = a[i][1] % 10
    if a[i][0] == 0:
        a[i][0] = 10
        a[i][1] -= 10

a.sort(reverse=True)

ans = 0
for i in range(4):
    if a[i][0] == 10:
        ans += a[i][1] + 10
    else:
        ans += a[i][1] + (10 - a[i][0])

ans += a[4][1]
if a[4][0] == 10:
    ans += 10

print(ans)

Solution (Python):
from math import ceil
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
lst0 = [a%10, b%10, c%10, d%10, e%10]
lst = [(a-1)%10, (b-1)%10, (c-1)%10, (d-1)%10, (e-1)%10]
time0 = [int(a/10), int(b/10), int(c/10), int(d/10), int(e/10)]
time = [ceil(a/10), ceil(b/10), ceil(c/10), ceil(d/10), ceil(e/10)]
last = lst.index(min(lst))
time.pop(last)
print(sum(time)*10+lst0[last]+time0[last]*10)

Solution (Python):
li = [int(input()) for _ in range(5)]
li_mod = [[i % 10, i] for i in li if i % 10 != 0]
li_mod_r = [i for i in li if i % 10 == 0]
li_mod = sorted(li_mod, reverse = True)
time = 0
if li_mod != []:
  for lis in li_mod[:-1]:
    time += lis[1] + (10-lis[0])
  time += li_mod[-1][1]
if li_mod_r != []:
  time += sum(li_mod_r)

print(time)

Solution (Python):
l=[]
lp=[10]
for i in range(5):
    l.append(int(input()))
    if l[i]%10!=0:
        lp.append(l[i]%10)
lp_min=min(lp)
if lp_min==10:
    lp_min=0
ans=0
for i in range(5):
    ans+=-(-l[i]//10)*10
if lp_min!=0:
    ans=ans-10+lp_min
print(ans)

Solution (Python):

 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
 
arg = [int(input()) for i in range(5)]

last_i = 0
min = 100;
for i in range(5):
    if arg[i] % 10 == 0:
        continue
    if arg[i] % 10 < min:
        last_i = i
        min = arg[i] % 10

ans = 0
for i in range(5):
    if last_i == i:
        ans += arg[i]
    else:
        ans += math.ceil(arg[i] / 10) * 10

print(ans)

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

menu=[INT() for i in range(5)]

last=INF
idx=0
for i in range(5):
    if menu[i]%10!=0:
        if menu[i]%10<last:
            last=menu[i]%10
            idx=i

ans=0
for i in range(5):
    if i!=idx:
        ans+=menu[i]//10*10
        if menu[i]%10!=0:
            ans+=10
ans+=menu[idx]
print(ans)

Solution (Python):
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
l=[A,B,C,D,E]
l0=[i%10 for i in l]
x=[]
for i in range(5):
    if l0[i]!=0:
        l[i]=(1+l[i]//10)*10 
        x.append(l0[i])
if x==[]:
    ans=sum(l)
else:
    ans=sum(l)-10+min(x)
print(ans)

Solution (Python):
def main():
    a = []
    for i in range(5):
        a.append(int(input()))
    b = []
    s = 0
    tmp = 0
    for i in a:
        if i%10 != 0:
            tmp = i + (10-i%10)
            b.append(10-i%10)
        else:
            tmp = i
            b.append(0)
        s += tmp
    print(s-max(b))

if __name__ == '__main__':
    main()

Solution (Python):
ls = []

for i in range(5):
    ls.append(int(input()))
sum = 0
ls1 = []
for i in range(5):
    if ls[i] % 10 == 0:
        sum += ls[i]
    else:
        ls1.append(10 - ls[i] % 10)
        sum += ((ls[i] // 10) + 1)* 10

if len(ls1) != 0:
    print(sum - max(ls1))
else:
    print(sum)

Solution (Python):




sum = 0
cl = list()
hmin = 99
minidx = -1

for i in range(5):
    wt = int(input())
    t = int((wt + 9) / 10) * 10
    sum += t
    cl.append(wt)
    wh = wt % 10
    if wh > 0 and wh < hmin:
        hmin = wt % 10
        minidx = i

if hmin < 99:
    sum = sum - (10 - hmin)


print(sum)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
l=[a,b,c,d,e]
l1=[]
for i in l:
  if i%10>0:
    l1+=[i%10]
if len(l1)>0:
  print(sum(l)-sum(l1)+10*(len(l1)-1)+min(l1))
else:
  print(sum(l))

Solution (Python):
ans = 0
m = 10

for v in [int(input()) for _ in range(5)]:
    x = v//10
    y = v%10
    ans += x*10

    if y > 0:
        if m > y:
            m = y
        ans += 10

ans -= (10 - m)
print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ans = 0
import math

a = [A,B,C,D,E]
b = []

for i in range(5):

    if a[i] % 10 != 0:
        
        b.append(a[i] % 10)

if len(b) == 0:

    for i in range(5):

        ans += a[i]

    print(ans)

else:
    
    for i in range(5):

        if a[i] % 10 != 0:

            ans += 10 * ((a[i]//10)+1)

        else:

            ans += a[i]

    print(ans-10+min(b))

Solution (Python):
import numpy as np

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

sum_abcde=0
for i in (a,b,c,d,e):
    if(i%10)==0:
        sum_abcde+=int(i)
    else:
        sum_abcde+=((int(i/10) * 10) + 10)


mod_a = a%10
mod_b = b%10
mod_c = c%10
mod_d = d%10
mod_e = e%10


array=np.array((mod_a, mod_b, mod_c, mod_d, mod_e))
if(np.sum(array)==0):
    print(int(sum_abcde))
else:
    print(int(min(array[array!=0])+sum_abcde-10))

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

if len([i for i in [a % 10, b % 10, c % 10, d % 10, e % 10] if i is not 0]) > 0:
    m = min([i for i in [a % 10, b % 10, c % 10, d % 10, e % 10] if i is not 0])
else:
    m = 10

print((a // 10 + (1 if a % 10 != 0 else 0)) * 10 + (b // 10 + (1 if b % 10 != 0 else 0)) * 10 + (c // 10 + (1 if c % 10 != 0 else 0)) * 10 + (d // 10 + (1 if d % 10 != 0 else 0)) * 10 + (e // 10 + (1 if e % 10 != 0 else 0)) * 10 - 10 + m)

Solution (Python):
import math

a = []
b = []
ans = 0
for i in range(5):
    a.append(int(input()))
ans = sum(a)
for i in range(5):
    tmp = a[i] % 10
    if tmp != 0:
        b.append(10 - tmp)
if len(b) == 0:
    print(ans)
else:
    print(ans + sum(b) - max(b))

Solution (Python):
lst=[]
for i in range(5):
  a=int(input())
  b=10-a%10
  if b==10:
    b=0
  lst.append((b,a))
lst.sort()

ans=0
for i in range(4):
  c=lst[i][1]
  d=lst[i][0]
  ans+=c+d
ans+=lst[4][1]
print(ans)

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

T_list = []

for x in itertools.permutations(A):
    t = 0
    for y in x:
        z = 0
        if t%10 > 0:
            z = 10 - t%10
        t += y + z
    T_list.append(t)
print(min(T_list))

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
lst = [A, B, C, D, E]
roundupped = [(x + 9) // 10 * 10 for x in lst]
diff = [y - x for x, y in zip(lst, roundupped)]
last = diff.index(max(diff))
sums = 0
for i, x in enumerate(lst):
    if i == last:
        sums += x
    else:
        sums += roundupped[i]
print(sums)

Solution (Python):
li = []

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

res = []
for i in range(5):
    if li[i] % 10 == 0:
        res.append((0, li[i]))
    else:
        res.append((((li[i] // 10 + 1) * 10 - li[i]), li[i]))
res.sort(key=lambda x: x[0])

cnt = 0
for i, j in res[:4]:
    cnt += i + j

cnt += res[4][1]
print(cnt)

Solution (Python):
N=[]
time=0
tmp=10
for i in range(5):
    N.append(int(input()))

for i in N:
    if i%10==0:
        time += i


    else:
        if i%10<tmp:
            tmp=i%10
        time += i+(10-i%10)

if tmp ==10:
    tmp==0

print(time+tmp-10)

Solution (Python):
plates = [int(input()) for _ in range(5)]
plates.sort(key=lambda x:x % 10)
time = 0
first = False
for i in plates:
	if i % 10 == 0:
		time += i
	else:
		if not first:
			first = True
			time += i
		else:
			time += (i // 10) * 10 + 10
print(time)

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

ans = 10**10

import itertools
t = 0
tt = 0
for P in itertools.permutations(l,len(l)):
    for p in P:
        t += p
        if (p % 10) != 0:
            tt = 10-p%10
            t += (10 - p%10)
    ans = min(ans , t-tt)
    t = 0
print(ans)

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

total_time=0
tail=[]
for number in nlist:
    if number % 10 == 0:
        total_time += number
    else:
        total_time += (number+10-(number%10))
        tail.append(number%10)
if tail:
    total_time -= (10-min(tail))
print(total_time)

Solution (Python):
import itertools

nums = [0,1,2,3,4]
kumi = list(itertools.permutations(nums))

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

Minimum = 99999

for i in range(len(kumi)):
    temp = 0
    for j in range(5):
        if temp % 10 == 0:
            temp += dishes[kumi[i][j]]
        else:
            temp = temp + 10 - (temp % 10)
            temp += dishes[kumi[i][j]]
    Minimum = min(Minimum, temp)

print(Minimum)

Solution (Python):
import math

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

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

ltgt = [(a-1) %10+1,(b-1) %10+1,(c-1) %10+1,(d-1) %10+1,(e-1) %10+1]
l2 =[math.floor((a-1)//10),math.floor((b-1)//10),math.floor((c-1)//10),math.floor((d-1)//10),math.floor((e-1)//10)]

m = min(ltgt)

print((sum(l2)*10)+40+min(ltgt))

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

tmp = []
tmp.append(a % 10)
tmp.append(b % 10)
tmp.append(c % 10)
tmp.append(d % 10)
tmp.append(e % 10)

for id, item in enumerate(tmp):
    if item == 0:
        tmp[id] = 10

tmp.sort()
ans = 0

if a % 10 == 0:
    ans += a
else:
    a = (a // 10 + 1) * 10
    ans += a

if b % 10 == 0:
    ans +=  b
else:
    b = (b // 10 + 1) * 10
    ans += b

if c % 10 == 0:
    ans +=  c
else:
    c = (c // 10 + 1) * 10
    ans += c 

if d % 10 == 0:
    ans +=  d
else:
    d = (d // 10 + 1) * 10
    ans += d

if e % 10 == 0:
    ans += e
else:
    e = (e // 10 + 1) * 10
    ans += e
ans -= 10
ans += tmp[0]

print(ans)

Solution (Python):
dishes = []
minimum = 9
min_id = 0

for i in range(5):
  t = int(input())
  dishes.append(t)
  if t % 10 <= minimum and t % 10 > 0:
    minimum = t % 10
    min_id = i

print(sum([dishes[i] + (10 - dishes[i] % 10) if i != min_id and dishes[i] % 10 != 0 else dishes[i] for i in range(len(dishes))]))

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

ind=0
ind_min=9
for i,num in enumerate(n):
    if num % 10 == 0 :
        continue
    if num % 10 < ind_min:
        ind_min = num%10
        ind=i

sum=0
for i,num in enumerate(n):
    if i == ind:
        sum+=num
    else:
        sum+=int((num+9)/10)*10

print(sum)

Solution (Python):
s=[int(input()) for i in range(5)]
a=0
b=10
for i in s:
    for j in range(0,140,10):
        if j>=i:
            a+=j
            break
    if i%10>0:
        b=min(b,i%10)

if b==10:
    print(a)
else:
    print(a-10+b)

Solution (Python):
import sys
from copy import copy
A = []
for _ in range(5):
  A.append(int(input()))

def dfs(B):
  if len(B) == 1:
    return B[0]
  ans = float('inf')
  for i in range(len(B)):
    C = copy(B)
    x = C.pop(i)
    if x % 10 != 0:
      x += (10 - x % 10)
    ans = min(ans, x + dfs(C))
  return ans

print(dfs(A))

Solution (Python):
import math

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

num = min(int(str(A-1)[-1]), int(str(B-1)[-1]), int(str(C-1)[-1]), int(str(D-1)[-1]), int(str(E-1)[-1])) + 1
array = [A, B, C, D, E]

result = 0
for i in array:
    result += math.ceil(i/10) * 10

print(result - 10 + num if num != 0 else result + num)

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

T=[int(input().strip()) for x in range(5)]
mini=0
nonmini=[]
for t in T:
  if mini==0:
    mini=t
  elif t%10!=0 and t%10<mini%10:
    nonmini.append(mini)
    mini=t
  else:
    nonmini.append(t)

T=0
for t in nonmini:
  T+=t
  if T%10!=0:
    T+=10-T%10

print(T+mini)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
orderlist = [A,B,C,D,E]
maxtime = 10

for x in range(0,4):
    if orderlist[x] % 10 == 0:
        continue
    time = orderlist[x] % 10
    maxtime = min(time,maxtime) 

Sum = 0

for x in range(0,5):
    if orderlist[x] % 10 ==0:
        Sum += orderlist[x]
    else:
        Sum += orderlist[x] + 10 - (orderlist[x] % 10)

Sum += maxtime -10

print(Sum)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline




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

	aa = 999999999
	ii = 0
	for i, vol in enumerate(me):
		tt = vol % 10
		if tt != 0 and tt < aa:
			aa = tt
			ii = i

	for i, vol in enumerate(me):
		if ii == i:
			continue
		tt = vol % 10
		if tt != 0:
			aa = 10 - tt
			me[i] += aa

	ans = 0
	for i, vol in enumerate(me):
		ans += vol
	print(ans)
	
if __name__ == "__main__":
	main()

Solution (Python):
t = [int(input()) for i in range(5)]
r = [x%10 for x in t]
if all(x==0 for x in r):
  print(sum(t))
else:
  y = min(set(r)-{0})
  print(sum(x if x%10==0 else 10*(1+x//10) for x in t) -10+y)

Solution (Python):
a = int(input())
aa = a % 10
if aa == 0:
    aa = 10**10
    aaa = a
else:
    aaa = (a // 10) * 10 + 10
    
b = int(input())
bb = b % 10
if bb == 0:
    bb = 10**10
    bbb = b
else:
    bbb = (b // 10) * 10 + 10

c = int(input())
cc = c % 10
if cc == 0:
    cc = 10**10
    ccc = c
else:
    ccc = (c // 10) * 10 + 10

d = int(input())
dd = d % 10
if dd == 0:
    dd = 10**10
    ddd = d
else:
    ddd = (d // 10) * 10 + 10


e = int(input())
ee = e % 10
if ee == 0:
    ee = 10**10
    eee = e
else:
    eee = (e // 10) * 10 + 10


t = [a,b,c,d,e]
tt = [aa,bb,cc,dd,ee]
ttt = [aaa,bbb,ccc,ddd,eee]

ans = sum(ttt) - ttt[tt.index(min(tt))] + t[tt.index(min(tt))]






print(ans)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
import math
a_1=a-math.floor((a-1)/10)*10
b_1=b-math.floor((b-1)/10)*10
c_1=c-math.floor((c-1)/10)*10
d_1=d-math.floor((d-1)/10)*10
e_1=e-math.floor((e-1)/10)*10
a_1n=math.ceil(a/10)*10
b_1n=math.ceil(b/10)*10
c_1n=math.ceil(c/10)*10
d_1n=math.ceil(d/10)*10
e_1n=math.ceil(e/10)*10
lists=[]
lists.append(a_1)
lists.append(b_1)
lists.append(c_1)
lists.append(d_1)
lists.append(e_1)
lists.sort()
print(a_1n+b_1n+c_1n+d_1n+e_1n-10+lists[0])

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

mind = 124
mini = 0
for i in range(len(dishlist)):
    d = (dishlist[i]-1) % 10
    if (d < mind):
        mind = d
        mini = i

dishlist[mini], dishlist[-1] = dishlist[-1], dishlist[mini]

ans = 0
for i in range(len(dishlist)):
    p = 0
    if (i < len(dishlist)-1):
        if (dishlist[i] % 10 != 0):
            p = 10 - (dishlist[i] % 10)
    ans += dishlist[i] + p 

print(ans)

Solution (Python):
import math

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

a = (A // 10 + math.ceil((A % 10) / 10)) * 10
b = (B // 10 + math.ceil((B % 10) / 10)) * 10
c = (C // 10 + math.ceil((C % 10) / 10)) * 10
d = (D // 10 + math.ceil((D % 10) / 10)) * 10
e = (E // 10 + math.ceil((E % 10) / 10)) * 10

X = a + b + c + d + e

Y = [A % 10, B % 10, C % 10, D % 10, E % 10]
Y = [i for i in Y if i > 0]

if len(Y) >= 1:
    X = X - 10 + min(Y)

print(X)

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

def calc_taple(x):
    if x % 10 == 0:
        num = 10
    else:
        num = x % 10
    return(num, x)

lst = []
lst.append(calc_taple(a))
lst.append(calc_taple(b))
lst.append(calc_taple(c))
lst.append(calc_taple(d))
lst.append(calc_taple(e))
lst = sorted(lst)
res = 0
for elem1, elem2 in lst[1:]:
    res += elem2 + (10 - elem1)
res += lst[0][1]
print(res)

Solution (Python):



import functools

a = [int(input()) for _ in range(5)]
def e(x):
    if x % 10:
        return x % 10
    else:
        return 10
a.sort(key=functools.cmp_to_key(lambda x,y: e(x) - e(y)), reverse=True)
ans = 0
for x in a[:-1]:
    d,m = divmod(x, 10)
    ans += (d + (m != 0)) * 10
ans += a[-1]
print(ans)

Solution (Python):
total = 0
c = []
for i in range(5):
    a = input()
    b = int(a)
    if int(a[-1]) != 0:
        c.append(int(a[-1]))
        total += b - int(a[-1]) + 10
    else:
        total += b

if c:
    total += min(c)
    total -= 10
print(total)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
tmp = 9
last = 0
for i in [A, B, C, D, E]:
    if i % 10 == 0:
        continue
    else:
        if i % 10 <= tmp:
            tmp = i % 10
            last = i

ans = 0
for i in [A, B, C, D, E]:
    if i % 10 == 0:
        ans += i
    else:
        ans += i + (10-i%10)

print(ans-(10-last%10) if last != 0 else ans)

Solution (Python):
import sys



import numpy as np


"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        
        
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)


"""ここからメインコード"""


def main():
    
    r, e, p = range, enumerate, print
    ip = IP()
    id = Idea()
    mod = 10 ** 9 + 7

    """この下から書いてね"""
    li = np.array(ip.ILS(5))
    li_m = li % 10
    m = max(li_m)
    res = 0
    ans = sum(li // 10)
    for x in li_m:
        if x != 0:
            m = min(m, x)
            res += 1

    if res == 0:
        res += 1
    p(ans * 10 + (res - 1) * 10 + m)


main()

Solution (Python):
import math
n = 5
t = [int(input()) for i in range(n)]
l = 0
ans = 0
min = 10
l = 0
index = 0
for i in t:
    s = str(i)
    if int(s[len(s)-1]) != 0 and int(s[len(s)-1]) < min:
        min = int(s[len(s)-1])
        index = l
    l += 1
l = 0
for i in t:
    if l == index:
        ans += i
    else:
        ans += math.ceil(i/10) * 10
    
    l += 1
print(ans)

Solution (Python):
import numpy as np
a=[0,0,0,0,0]
a[0]=int(input())
a[1]=int(input())
a[2]=int(input())
a[3]=int(input())
a[4]=int(input())
a10=[0,0,0,0,0]
for i in range(5):
    a10[i] = (10-a[i]%10)%10
k = np.argmax(a10)
l = [0,0,0,0,0]
for i in range(5):
    if a[i]%10 == 0:
        l[i]=0
    else:
        l[i]=10-a[i]%10
ans = sum(a)+sum(l)-l[k]
print(ans)

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

res_ = min([x%10 if x%10!=0 else 10 for x in [a,b,c,d,e]])
sum_ = sum([10*(1+x//10) if (x%10!=0) else x for x in [a,b,c,d,e]])

print(sum_ + res_ - 10)

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

tmp = 999
minidx = 0
for idx, i in enumerate(inputs):
    if tmp > (i % 10) and (i % 10) > 0:
        minidx = idx
        tmp = i % 10

ans = 0
for idx, i in enumerate(inputs):
    if idx == minidx:
        ans += i
    else:
        if i % 10 != 0:
            ans += i + (10 - (i % 10))
        else:
            ans += i
        
print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
cook_time = [A,B,C,D,E]
muda = [10-i%10 if i%10!=0 else 0 for i in cook_time]
cook_time_muda = list(zip(cook_time,muda))
cook_time_muda.sort(key=lambda x:x[1])
time = 0
for i in cook_time_muda:
    time = time + i[0]+i[1]
time = time - i[1]
print(time)

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

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

l = [A, B, C, D, E]
ll = []
ans = []
for i in range(5):
    if l[i] % 10 == 0:
        ll.append(11)
        ans.append(l[i])
    else:
        ll.append(l[i] % 10)
        ans.append(l[i] + (10 - l[i] % 10))

p = ll.index(min(ll))


if p == 11:
    print(sum(l))
else:
    print(sum(ans) - ans[p] + l[p])

Solution (Python):
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
min_t = float('inf')
for order in list(itertools.permutations([a,b,c,d,e],5)):
    t = 0
    for i in range(len(order)):
        t += order[i]
        if t % 10 != 0 and i != len(order) - 1:
            t = 10 * int(((t / 10) + 1))
    min_t = min(t, min_t)
print(min_t)

Solution (Python):
import numpy as np

A = []
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))
A.append(int(input()))

A = np.array(A)
tmp = (A-1) % 10 + 1
idx = np.argmin(tmp)

res = A[idx]
A = np.delete(A, idx)
res += (np.sum(np.ceil(A/10)*10))
print(int(res))

Solution (Python):
l = [int(input()) for _ in range(5)]
l.sort(key=lambda x: (x-1)%10)

print(l[0]+sum( t if t%10==0 else t-(t%10)+10 for t in l[1:] ))

Solution (Python):
a = []
ans = 0
mmin = 10
for i in range(5):
    a.append(int(input()))
for i in range(5):
    m = a[i] % 10
    if m > 0:
        mmin = min(mmin, m)
    for j in range(1, 14):
        if a[i] <= 10 * j:
            ans += 10 * j
            break

ans -= 10
ans += mmin
print(ans)