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):
l = [int(input()) for i in range(5)]
ll = []
ans = -10
for i in range(5):
    if l[i] % 10 ==0:
        ans += l[i]
    else:
        ll.append(l[i]%10)
        ans += (l[i]//10 + 1)*10
if ll == []:
    ans += 10
else:
    ans += min(ll)
print(ans)

Solution (Python):

B=[]
C=[]
for i in range(5):
    S=int(input())
    if S%10==0:
        C.append(S)
    else:
        C.append(S+(10-S%10))
    if S%10!=0:
        B.append(S%10)
if B==[]:
    print(sum(C))
else:
    print(sum(C)-(10-min(B)))

Solution (Python):
myArray = list()
for n in range(5):
    myArray.append(int(input()))
Jouyo  = 9
jouyoi = 0

for i,j in enumerate(myArray):
    if 0 < j % 10 <= Jouyo:
        Jouyo = j % 10
        jouyoi = i
times = 0
for i,j in enumerate(myArray):
    if i != jouyoi:
        if j % 10 != 0:
            times += ((j // 10) + 1) * 10
        else:
            times += j
    else:
        times += j
print(times)

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

min = 10
index = 0
for i in range(len(D_)):
    if D_[i]%10 > 0 and D_[i]%10 <= min:
        min = D_[i]%10
        index = i

for i in range(len(D_)):
    if D_[i]%10 > 0 and index != i:
        D_[i] = (D_[i]//10 )*10 + 10

print(sum(D_))

Solution (Python):
li=[input() for i in range(5)]
mi=10
for i in range(5):
    if int(li[i][-1])!=0:
        mi = min(mi, int(li[i][-1]))
ans = 0

for i in range(5):
    if int(li[i])%10 !=0:
        ans += int(li[i])+(10-int(li[i])%10)
    else:
        ans += int(li[i])
print(ans-10+mi)

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

minidx = 0
minval = 124
i = 0
for a in ant:
    while 10 < a:
        a %= 10
        if a == 0:
            a = 10
    if a < minval:
        minidx = i
        minval = a
    i += 1

ans = 0
for i in range(5):
    if i == minidx:
        continue
    fact = 10
    while fact - ant[i] < 0:
        fact += 10
    ans += fact

ans += ant[minidx]
print(ans)

Solution (Python):
from math import ceil
ord = [int(input()) for _ in range(5)]
max_wait = 0
max_idx = 0
for i in range(5):
    cur = ceil(ord[i] / 10) * 10 - ord[i]
    if max_wait < cur:
        max_wait = cur
        max_idx = i
ans = 0
for i in range(5):
    if i != max_idx:
        ans += ceil(ord[i] / 10) * 10
ans += ord[max_idx]
print(ans)

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

minidx = 0
minval = 124
i = 0
for a in ant:
    while 10 < a:
        a %= 10
        if a == 0:
            a = 10
    if a < minval:
        minidx = i
        minval = a
    i += 1

ans = 0
for i in range(5):
    if i == minidx:
        continue
    fact = 10
    while fact - ant[i] < 0:
        fact += 10
    ans += fact

ans += ant[minidx]
print(ans)

Solution (Python):
N = 5

dish_list = []
d1_list = []

for i in range(N):
    tmp = int(input())
    dish_list.append(tmp)
    if tmp%10 == 0:
        d1_list.append(10)
    else:
        d1_list.append(tmp%10)

time = 0
for i in range(N):
    max_index = d1_list.index(max(d1_list))
    if i == 4:
        time += dish_list[max_index]
    else:
        time += (dish_list[max_index]//10) * 10
        if dish_list[max_index]%10 != 0:
            time += 10

    del dish_list[d1_list.index(max(d1_list))]
    del d1_list[d1_list.index(max(d1_list))]

print(time)

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

Solution (Python):
total = 0
MIN = 9999
amari = False
for i in range(5):
    s = int(input())
    smod = int(s % 10)
    if smod == 0:
        total += s
    else:
        total += s - smod + 10
        MIN = min(MIN,smod)
        amari = True
if MIN == 9999:
    MIN = 0
elif amari:
    total -= 10
print(total + MIN)

Solution (Python):
seq = [int(input()) for i in range(5)]
t = 0
d = 9

for s in seq:
    t += s
    t = (t - 1) // 10 + 1
    t *= 10
    
    d = min(d, (s - 1) % 10) 
    
print(t + d - 9)

Solution (Python):
import itertools

seq = [int(input()) for i in range(5)]
ans = 10 ** 9

for ss in itertools.permutations(seq):
    t = 0
    for s in ss:
        t = (t - 1) // 10 + 1
        t *= 10
        t += s
    ans = min(ans, t)
    
print(ans)

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

o=[0 for _ in range(5)]
o1=[0 for _ in range(5)]
o[0]=a
o[1]=b
o[2]=c
o[3]=d
o[4]=e

m=max(o)
if not(m%10==0):
    while(m%10!=0):
        m+=1
for i in range(5):
    o1[i]=(m-o[i])%10
m1=max(o1)%10

for i in range(5):
    if not(o[i]%10==0):
        while(o[i]%10!=0):
            o[i]+=1
s=sum(o)

print(s-m1)

Solution (Python):
import numpy as np

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

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

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

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

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

Solution (Python):
order_list = []
for _ in range(5):
    order_list.append(int(input()))
    
a = []
b = []
for i in range(5):
    a.append(((order_list[i]-1)//10+1)*10)
    b.append((order_list[i]-1)%10)
    
if min(b) != 9:
    ans = sum(a) + min(b) - 9
else:
    ans = sum(a)
print(ans)

Solution (Python):
import math


def solve():
    abcde = [int(input()) for _ in range(5)]
    if any([str(i)[-1] != "0" for i in abcde]):
        last = min([i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])))
    else:
        last = min(abcde)
    hoge = sum([math.ceil(i / 10) * 10 for i in abcde]) - (math.ceil(last / 10) * 10)
    print(hoge + last)


if __name__ == "__main__":
    solve()

Solution (Python):
array = []
for i in range(5):
  array.append(int(input()))
  
ichi = list(map(lambda x: x%10,array))
ichi = list(map(lambda x: 10 if x==0 else x,ichi))

minichi = min(ichi)

sum = 0
for i in range(5):
  sum += ((array[i]+10-1)//10)*10

if minichi != 10:
  print(sum-10+minichi)
else:
  print(sum)

Solution (Python):
L = []
L2 = []
for _ in range(5):
    a = input()
    if a[-1] == "0":
        L.append(int(a))
    else:
        last = int(a[-1])
        L.append(int(a) + 10 - last)
        L2.append(last)
if not L2:
    print(sum(L))
else:
    print(sum(L) + min(L2) - 10)

Solution (Python):
def int_ceil(x):
  last=int(str(x)[-1])
  return([x+10-last,last])

dishes =[0]*5
min=10
for i in range(5):
  x=(int(input()))
  if x % 10 != 0:
    ceiled=int_ceil(x)
    if ceiled[1] < min:
      min=ceiled[1]
    dishes[i]=ceiled[0]
  else:
    dishes[i]=x
print(sum(dishes) - 10 + min)

Solution (Python):
a = [int(input()) for _ in range(5)]
b = 0
c = []
for s in a:
    b = 10 - s % 10
    if b == 10:
        b = 0
    c.append(b)
d = zip(c,a)
e = sorted(d)
ans = 0
count = 0
for x,y in e:
    count += 1
    if count == 5:
        ans = ans + y
        break
    ans = ans + x + y

print(ans)

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

min_r = 10
min_dish = 0
for i in range(5):
    if dish[i] % 10 != 0 and min_r > dish[i] % 10:
        min_r = dish[i] % 10
        min_dish = i

ans = 0
for i in range(5):
    if i == min_dish or dish[i] % 10 == 0:
        ans += dish[i]
    else:
        ans += (dish[i]//10+1)*10

print(ans)

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

min1 = 10
minval = 0 
for i in range(5):
    n = AList[i] % 10
    if n != 0 and min1 > n:
        min1 = n
        minval = AList[i]

sum1 = 0
if minval != 0:
    AList.remove(minval)
    sum1 = minval

for i in range(len(AList)):
    n = AList[ i ] + 9
    sum1 += (n // 10) * 10
print(sum1)

Solution (Python):
import itertools
import math
import sys
input = sys.stdin.readline
abcde = [int(input()) for _ in range(5)]

min_time = 2**24
for perm in itertools.permutations(abcde):
  time = 0
  for x in perm[0:-1]:
    time = math.ceil((time + x) / 10) * 10
  time += perm[-1]
  min_time = min(time, min_time)

print(min_time)

Solution (Python):
time=map(int,open(0).read().split())

def dist(n,th):
  amari=n%th
  if amari == 0:
    return amari
  else:
    return th-amari

arr=sorted([[dist(t,10),t] for t in time] ,key=lambda x: x[0])
print(sum([sum(x) for x in arr[:-1]])+arr[-1][1])

Solution (Python):
time=map(int,open(0).read().split())

arr=[]
for t in time:
  amari=t % 10
  if amari == 0:
    d=amari
  else:
    d=10-amari
  arr.append([d, t])

arr.sort(key=lambda x: x[0])

total=0
for x in arr[:-1]:
  total+=sum(x)
print(total+arr[-1][1])

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

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

print(-(-a//10*10)-(-b//10*10)-(-c//10*10)-(-d//10*10)-(-e//10*10)-max((10-a)%10,(10-b)%10,(10-c)%10,(10-d)%10,(10-e)%10))

Solution (Python):
import math
import copy















a = 5
inputList=[]
for i in range(a):
    inputNum = input()
    inputList.append(inputNum)

inputList = [int(n) for n in inputList]




itemInfo = []
tmp = []

for i in range(a):
    tmp.append(int(math.floor(inputList[i]/10))*10)
    tmp.append(int(math.ceil(inputList[i]/10))*10)
    tmp.append(inputList[i]%10)
    itemInfo.append(copy.deepcopy(tmp))
    tmp.clear()

tmpList = sorted(itemInfo, key = lambda x:x[2])

flg = False
sum = 0
for i in range(len(tmpList)):
    if flg == False and tmpList[i][2] != 0:
        flg = True
        sum += tmpList[i][0] + tmpList[i][2]
    else:
        sum += tmpList[i][1]

print(sum)

Solution (Python):
t=0
s=10
for i in range(5):
    k=int(input())
    if k%10==0:
        t+=k
    else:
        t+=((k//10)+1)*10
        if k%10<s:
            s=k%10

if s!=10:
    print(t-10+s)
else:
    print(t)

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





import math
a=10*(math.ceil(A/10))
b=10*(math.ceil(B/10))
c=10*(math.ceil(C/10))
d=10*(math.ceil(D/10))
e=10*(math.ceil(E/10))
Q=max(a-A,b-B,c-C,d-D,e-E)
if Q==a-A:
    print(b+c+d+e+A)
elif Q==b-B:
    print(a+c+d+e+B)
elif Q==c-C:
    print(a+b+d+e+C)
elif Q==d-D:
    print(a+b+c+e+D)
elif Q==e-E:
    print(a+b+c+d+E)

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

min = 10
for i in range(5):
    if min > A[i] % 10 and A[i] % 10 != 0:
        min = A[i] % 10
        tmp = i

ans = 0
for i in range(5):
    if A[i] % 10 == 0 or i == tmp:
        ans += A[i]
    else:
        ans += A[i] + (10 - A[i] % 10)

print(ans)

Solution (Python):
import math

minMod = 10
minModNum = 0
numList = []
for i in range(0, 5):
    numList.append(int(input()))
    if ((numList[i] % 10 != 0) & (numList[i] % 10 < minMod)):
        minMod = numList[i] % 10
        minModNum = i

sum = 0
for i in range(0, 5):
    if i != minModNum:
        sum += int(math.ceil(numList[i]/10)*10)
    else:
        sum += numList[i]
print(sum)

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

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

order_list = []
for x in X:
    priority = x % 10
    if priority == 0:
        priority = 10
    order_list.append([x, priority])

order_list.sort(key=lambda order: order[1])

total_time = 0
for time, priority in order_list[1:]:
    plus10 = 0
    if time % 10 > 0:
        plus10 = 10
    actual_time = time//10*10 + plus10
    total_time += actual_time
    

order = order_list.pop(0)
time = order[0]
total_time += time

print(total_time)

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

def calc_time(ll,idxlist):
	time = 0
	for _ in range(4):
		time += ll[idxlist[_]]
		while time % 10 != 0:
			time += 1
	time += ll[idxlist[4]]
	return time

time_min = 10**(3)
for i in range(5):
	for j in range(5):
		if i == j:
			continue
		for k in range(5):
			if j == k or i == k:
				continue
			for l in range(5):
				if k == l or j == l or i == l:
					continue
				for m in range(5):
					if l == m or k == m or j == m or i == m:
						continue
					time = calc_time(ll,[i,j,k,l,m])
					if time < time_min:
						time_min = time
print(time_min)

Solution (Python):
time_list=[int(input()) for _ in range(5)]
mod10_list=[]
for i in time_list:
  if i%10==0:
    mod10_list.append(10)
  else:
    mod10_list.append(i%10)
for i in range(5):

  if time_list[i]%10==0:
    pass
  else:
    time_list[i]=((time_list[i]//10)+1)*10
ans=sum(time_list)-10+min(mod10_list)
print(ans)

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

Solution (Python):
ans = 0
r = 10
for i in range(5):
  a = int(input())
  if a%10 == 0:
    ans += a
  else:
    r = min(r,a%10)
    ans += (a//10)*10+10
ans += r-10
print(ans)

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

lost_time = [0]*5
for i in range(5):
    lost_time[i] = 9 - ((dishes[i] - 1) % 10)

print(sum(dishes)+sum(lost_time)-max(lost_time))

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

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

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

min_value = b[0]
for i in range(len(a)):
    if min_value == 0 and b[i] != 0:
        min_value == b[i]

    if b[i] != 0 and b[i] < min_value:
        min_value = b[i]

cnt = 0
flag = 0
for i in range(len(a)):
    if b[i] == min_value and flag == 0:
        flag = 1
        cnt += a[i]
    else:
        if b[i] != 0:
            cnt += (a[i] + 10 - b[i])
        else:
            cnt += a[i]

print(cnt)

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

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

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

print(m)

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

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

t = 0
ss = []
for i in s:
    if i%10 != 0:
        ss.append(i)
    else:
        t += i

if len(ss) > 0:
    mx = ss[0]
    m1 = ss[0]%10
    for i in ss:
        if i%10 < m1:
            m1 = i%10
            mx = i
    ss.remove(mx)
    for i in range(0,len(ss)):
        t += ss[i] + (10-ss[i]%10)
    t += mx

print(t)

Solution (Python):
a = []
for i in range(5):
    b = int(input())
    c = b % 10 if b % 10 != 0 else 9
    d = (b + 10 - 1) // 10 * 10
    a.append([b, c, d])
a = sorted(a, key=lambda x: x[1], reverse=True)
total = 0
for i in range(len(a)):
    total += a[i][2]
print(total - a[i][2] + a[i][0])

Solution (Python):
ActualTiming=[]
Timecost=[]
for i in range(5):
	A=int(input())
	ActualTiming.append(A)
for i in range(5):
	X=0
	while X<ActualTiming[i]:
		X=X+10
	Timecost.append(X)
M=max(Timecost[j]-ActualTiming[j] for j in range(5))
print(sum(Timecost)-M)

Solution (Python):
mlist = [int(input()) for i in range(5)]
minmin = 10
cnt = 0
for i in mlist:
  if i%10 != 0:
    minmin = min(minmin,i%10)
  else:
    cnt+=1
ans = 0
for i in mlist:
  if i%10 != 0:
    ans += (i//10 +1)*10
  else:
    ans +=i
if cnt <5:
  ans = ans + minmin - 10
else:
  ans = sum(mlist)
print(ans)

Solution (Python):
A = [int(input()) for _ in range(5)]
ans = 0
m = 0
for a in A:
    tmp = 0
    while (a + tmp) % 10 != 0: tmp += 1
    ans += a + tmp
    if m < tmp: m = tmp
print(ans-m)

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


minIdx = 0
minV = 9


for i in range(5):
    temp = A[i] % 10
    if 0 < temp and temp < minV:
        minIdx = i
        minV = temp

ans = 0

for i in range(5):
    if i == minIdx:
        ans += A[i]
    else:
        if A[i] % 10 == 0:
            ans += A[i]
        else:
            ans += A[i] + 10 - (A[i] % 10)

print(ans)

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

a = [((i - 1) // 10 + 1) * 10 for i in M]
b = [(i - 1) % 10 for i in M]

ans = sum(a) + min(b) - 9
print(ans)

Solution (Python):
A=[]
for _ in range(5):
  A.append(int(input()))
  
B=list(map(lambda x:(int((x-1)//10)+1)*10,A))
C=list(map(lambda x:int((x-1)%10),A))

ans=sum(B)+min(C)-9
print(ans)

Solution (Python):
A = []
for i in range(5):
  A.append(int(input()))
B = list(map(lambda x : (int((x - 1) // 10) + 1) * 10, A))
C = list(map(lambda x : int((x - 1) % 10), A))
ans = sum(B) - 9 + min(C)
print(ans)

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

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

min_time = float('inf')


for order in list(permutations([0,1,2,3,4])):
    total = 0
    for i in range(5):
        total += time_list[order[i]]
        if i!=4:
            total = ceil(total / 10) * 10
    min_time = min(min_time, total)
   
  
print(min_time)

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

Solution (Python):

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

diff = []
result = 0
for i in cooks:
    result += i
    x = 10 - (i % 10)
    if x == 10:
        x = 0

    diff.append(x)

diff.sort()
last = diff.pop()
result += sum(diff)

print(result)

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

Solution (Python):

sum=0
m=10
for i in range(5):
  dish=int(input())
  if dish%10==0:
    sum+=dish
  else:
    sum+=dish+10-dish%10
    m=min(m,dish%10)
    
print(sum-10+m)

Solution (Python):
def round_up(i):
    if i % 10 == 0:
        return i
    return 10 - i % 10 + i


minutes = [int(input()) for i in range(5)]
m = [round_up(i) for i in minutes]
last = min((minutes[l] - 1) % 10 for l in range(5)) + 1

print(sum(m) + last - 10)

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

n = 0
m = 10
for idx, i in enumerate(F):
    if i % 10 == 0:
        continue
    if i % 10 < m:
        m = i % 10
        n = idx

T = F[n]
for idx, i in enumerate(F):
    if idx == n:
        continue
    T += (int(i) + 9) // 10 * 10

print(T)

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

l=[a,b,c,d,e]
s=sum(l)
ll=[10-a%10,10-b%10,10-c%10,10-d%10,10-e%10]
for i in range(5):
        if ll[i]==10:
                ll[i]=0
ll.sort()

print(s+sum(ll[:4]))

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

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
Ts = [A, B, C, D, E]
Ts.sort(key=lambda T: (T-1)%10)

def c(T):
  return (T+9)//10*10
r = Ts[0]
r += c(Ts[1])
r += c(Ts[2])
r += c(Ts[3])
r += c(Ts[4])
print(r)

Solution (Python):
import numpy as np

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

time = 0
drem_min = 100
for d in dishes:
	if d%10 == 0:
		tmp = d
	else:
		if d%10 < drem_min:
			drem_min = d%10 
		tmp = (d//10+1)*10
	time += tmp

if drem_min<10:
	time = time - 10 + drem_min
print(time)

Solution (Python):



time_list = []

for _ in range(5):
    time_list.append(int(input().split()[0]))


ichi_list = [int(str(x)[-1]) for x in time_list]
sabun_list = [10 - int(str(x)[-1]) if int(str(x)[-1]) != 0 else 0 for x in time_list]




last_order_time = max(sabun_list)
last_order_time_index = sabun_list.index(last_order_time)

total = 0
i = last_order_time_index 
total = sum(time_list[:i] + time_list[i+1:])
total += sum(sabun_list[:i] + sabun_list[i+1:])
total += time_list[i]
print(total)

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

target = [A,B,C,D,E]
num_list = [1,2,3,4,5,6,7,8,9,0]

ans_sur  = num_list.index(0)
ans = int()



for i in target:
	number = num_list.index(i%10)
	if ans_sur >= number:
		ans_sur = number
		ans = i

target.pop(target.index(ans))
target00 = list()


for i in target:
	if i % 10 != 0:
		
		target00.append(i+(10-i%10))
	else:
		
		target00.append(i)

target00.append(ans)
print(sum(target00))

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

Solution (Python):
x = []
y = 100
for i in range(5):
	x.append(int(input()))
	if x[-1] % 10 == 0:
		y = min(y,10)
	else:
		y = min(y, x[-1]%10)

sum = 0
for i in range(5):
	if x[i] % 10 == 0:
		sum += x[i]
	else:
		sum += x[i] + 10 - (x[i]%10)
sum -= 10 - y
print(sum)

Solution (Python):
time = [int(input()) for i in range(5)]
lst = []
for i in time:
  lst.append(i%10)
lst.sort()
while 0 in lst:
  lst.remove(0)
times = []
for i in lst[1:]:
  times.append(10-i)
total = sum(time) + sum(times)
print(total)

Solution (Python):
def five_dishes(a,n):
    b = []
    ttime = 0
    maxnum,opt,pos = 0,0,0
    for i in range(n):
        if a[i]%10 == 0:
            pass
        else:
            opt = 10 - a[i]%10
        if maxnum < opt:
            maxnum = opt
            pos = i
    tmp = a.pop(pos)
    for i in range(n-1):
        if a[i]%10 == 0:
            ttime += a[i]
        else:
            ttime += a[i] + 10 - a[i]%10
 
    else:
        ttime += tmp
 
    print("%d"  %ttime)
 
if __name__ == '__main__':
    a = [int(raw_input()) for i in range(5)]
    five_dishes(a,len(a))

Solution (Python):
ABCDE = [int(input()) for _ in range(5)]
ABCDE_ = [(ABCDE[i] + 9) // 10 * 10 for i in range(5)]

s = sum(ABCDE_)
m = float('inf')
for i in range(5) :
    m = min(m, s - (ABCDE_[i] - ABCDE[i]))
    
print(m)

Solution (Python):
import math
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
sm = math.ceil(a/10)*10+math.ceil(b/10)*10+math.ceil(c/10)*10+math.ceil(d/10)*10+math.ceil(e/10)*10
mi = max((10-a%10)%10,(10-b%10)%10,(10-c%10)%10,(10-d%10)%10,(10-e%10)%10)
print(sm-mi)

Solution (Python):
import copy
a = [int(input()) for i in range(5)]
b = copy.deepcopy(a)
for i in range(len(a)):
    if str(a[i])[-1] != "0":
        a[i] = (a[i]//10+1)*10
l = [a[i]-b[i] for i in range(len(a))]
print(sum(a)-max(l))

Solution (Python):
import math
cookT = {}
lastOrder = 0

for i in range(5):
  cookT[i] = int(input())
  
lastOrder = max(cookT.items(), key=lambda x:(10-x[1]%10)%10)[0]

totalT = 0
for i in range(5):
  if i == lastOrder:
    totalT += cookT[lastOrder]
  else:
    tempX = cookT[i]
    tempY = math.ceil(tempX%10 / 10)*10
    totalT += tempX//10 *10 + tempY
print(totalT)

Solution (Python):
li = [int(input()) for _ in range(5)]
 
s = 0
temp = 10
for i in range(5):
    if li[i]%10 != 0 and li[i]%10 < temp:
        temp = li[i]%10
        s = i
else:
    t = li.pop(s)
    
ans = 0

for i in li:
    if i%10 == 0:
        ans += i//10
    else:
        ans += 1 + i//10
        
print(ans * 10 + t)

Solution (Python):
import math

menu = [int(input()) for i in range(5)]
last_menu_index = min([[i, x % 10 ] for i, x in enumerate(menu) if x % 10 != 0 ]+[[123,123]], key=lambda x: x[1])[0]
print(sum([math.ceil(x / 10) * 10 if last_menu_index != i else menu[last_menu_index] for i, x in enumerate(menu)]))

Solution (Python):
menu=[None]*5
min=None
min_i=-1
for i in range(5):
  menu[i]=int(input())
  wait = menu[i]%10
  if min==None or (min > wait and wait != 0):
    min=wait
    min_i=i
    
sum = 0
for i in range(5):
  if i==min_i:
    sum = sum + menu[i]
  else:
    sum = sum + (menu[i]%10!=0)*10+(menu[i]//10)*10

print(sum)

Solution (Python):
li = []
ans = 0
for i in range(5):
    num = int(input())
    ans += num
    if num % 10 == 0:
        continue
    else:
        p = num//10
        li.append((10*(p+1))-num)
li = sorted(li)
print(ans + sum(li[:-1]))

Solution (Python):
items = [int(input()) for _ in range(5)]
items = sorted(items, key=lambda x:x%10)
flag = False
for i in range(len(items)):
    if items[i] % 10 == 0:
        continue
    elif flag is False:
        flag = True
        continue
    tmp = items[i] // 10
    items[i] = tmp * 10 + 10


print(sum(items))

Solution (Python):
x=[int(input()) for _ in range(5)]
a=0
b=0

for i in range(5):
    if x[i]%10!=0:
        a+=x[i]-(x[i]%10)+10
        
        if b <= 10-x[i]%10:
            b=10-x[i]%10
        
    else:
        a+=x[i]

print(a-b)

Solution (Python):
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
a=A%10
b=B%10
c=C%10
d=D%10
e=E%10
A+=bool(a)*10-a
B+=bool(b)*10-b
C+=bool(c)*10-c
D+=bool(d)*10-d
E+=bool(e)*10-e
print(A+B+C+D+E-max(-a%10,-b%10,-c%10,-d%10,-e%10))

Solution (Python):
def main():
    dish = [int(input()) for i in range(5)]
    dish_10 = [ [dish[i]%10, dish[i]] for i in range(5)]
    for i in range(len(dish_10)):
    	if (dish_10[i][0]==0):
    		dish_10[i][0] = 10
    dish_10.sort()
    ans = 0
    for i in range(1,5):
        ans += ceiling_10(dish_10[i][1])
    ans += dish_10[0][1]
    print(ans)
 
def ceiling_10(i):
    if (i%10 == 0):
        return i
    else:
        return (i//10+1)*10
main()

Solution (Python):
b = 0
c = []

for i in range(5):
    a = int(input())
    
    if a%10 == 0:
        pass
    else:
        b = max(b,10-a%10)
        a = a//10*10+10
    c.append(a)
print(sum(c)-b)

Solution (Python):
a = []
b = []
min = 10
minutes = 0
min_index = 0

for i in range(5):
    a.append(int(input()))
    if 0 < a[i] % 10 < min:
        min = a[i] % 10
        min_index = i

a[4], a[min_index] = a[min_index], a[4]

for i in range(4):
    if a[i] % 10 != 0:
        minutes += (a[i] // 10 + 1) * 10
    else:
        minutes += a[i]

minutes += a[4]

print(minutes)

Solution (Python):
res = 0
minS = 10
for i in range(5):
  N = int(input())
  s = N % 10
  t = N // 10
  if s == 0:
    res = res + t * 10
  else:
    minS = min(minS, s)
    res = res + (t + 1)*10
if minS != 10:
  minS -= 10
else:
  minS = 0
print(minS + res)

Solution (Python):
lis = [int(input()) for _ in range(5)]
jud = []
fixed = 0
fixed_index = 0
for i in range(5):
  jud.append(lis[i]%10)
for k in range(5):
  if jud[k] == 0:
    jud[k] += 9
for j in range(5):
  if min(jud) == jud[j]:
    fixed = lis[j]
    fixed_index = j
    break
for m in range(5):
  if lis[m]%10 != 0:
    lis[m] = (lis[m]//10+1)*10
lis[fixed_index] = fixed
print(sum(lis))

Solution (Python):
t=[int(input()) for _ in range(5)]
s=[]
for i in range(5):
    s.append(t[i]%10)
    t[i]=-(-t[i]//10)*10
S=sorted(s)[-5+s.count(0)]
if S==0:
    print(sum(t))
else:print(sum(t)-10+S)

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

import numpy as np

y=[0]*5

for i in range(5):
	if x[i]%10==0:
		y[i]=9
	else:
		y[i]=x[i]%10

res=0

for i in range(5):
	if i==np.argmin(y) or x[i]%10==0:
		res+=x[i]
	else:
		res+=x[i]+10-x[i]%10
  
print(res)

Solution (Python):
time_list = []
loss_time_list = []
for i in range(5):
  time_list.append(int(input()))
  loss_time_list.append((10-time_list[i]%10)%10)

print(sum(time_list)+sum(loss_time_list)-max(loss_time_list))

Solution (Python):
*a,=map(int,open(0));print(-max(-j%10for j in a)-sum(-i//10for i in a)*10)

Solution (Python):
t = [int(input()) for _ in range(5)]
ans = 0
min_b = 10
for i in range(5):
  a = t[i]//10
  b = t[i]%10
  if b == 0:
    ans += a
  else:
    if min_b > b:
      min_b = b
    ans += a+1
print(ans*10 - (10-min_b))

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

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

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

a, b, c, d, e = sorted((a, b, c, d, e), key=lambda x: x%10 if x%10>0 else 10, reverse=True)

ans = int(math.ceil(a / 10))*10 \
        + int(math.ceil(b / 10))*10 \
        + int(math.ceil(c / 10))*10 \
        + int(math.ceil(d / 10))*10 \
        + e
print(ans)

Solution (Python):
lmod = []
l = []
for i in range(5):
    l.append(int(input()))
    if l[i]%10 != 0:
        lmod.append(10 - l[i]%10)
    else:
        lmod.append(0)
lmod.pop(lmod.index(max(lmod)))
s = sum(l) + sum(lmod)
print(s)

Solution (Python):
import math

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

min1 = map(lambda x: x % 10, t)
min1 = min([10 if i == 0 else i for i in min1])

print(sum(map(lambda x: math.ceil(x) * 10, [i/10 for i in t])) - (10 - min1))