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 = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [a,b,c,d,e]
min_MOD = 9
min_ind = -1
for i in range(5):
    x = l[i]%10
    if x <= min_MOD and x != 0:
        min_ind = i
        min_MOD = x

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

Solution (Python):



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

one = [(i-1)%100 %10 for i in ls]
one.index(min(one))
ten = [ls[i] + (10 - one[i] - 1) if i != one.index(min(one)) else ls[i] for i in range(len(ls))]
print(sum(ten))

Solution (Python):
dish=[]
d1=[]
dif=[]
for i in range(5):
    dish.append(int(input()))
for j in range(5):
    d1.append((-(-dish[j]//10))*10)
for k in range(5):
    dif.append(d1[k]-dish[k])
    
print(sum(d1)-max(dif))

Solution (Python):
n=[int(input()) for i in range(5)]
ans=sum([(i//10+1)*10 if i%10!=0 else i for i in n])
k=10


for i in n:
    i2=str(i)
    i2=i2[len(i2)-1]
    if i2!="0" and int(i2)<k:
        k=int(i2)

print(ans-(10-k))

Solution (Python):
time = []
time_up = []
time_amari = []
for _ in range(5):
    t = int(input())
    if t%10!=0:
        t_up = (t//10+1)*10
        t_amari = t_up-t
    else:
        t_up = t
        t_amari = -1
    time.append(t)
    time_up.append(t_up)
    time_amari.append(t_amari)
s = sum(time_up)
pos = time_amari.index(max(time_amari))
print(s-time_up[pos]+time[pos])

Solution (Python):
def zan(n):
	return 0 if n%10==0 else 10-n%10

def marume(n):
	return n if n%10==0 else n//10*10+10
def resolve():
	a=[int(input()) for i in range(5)]
	l=list(map(zan,a))
	mx=max(l)
	print(sum(list(map(marume,a)))-mx)
	
resolve()

Solution (Python):
def main():
    time = []
    ans = 0
    min_time = 10
    for i in range(5):
        time.append(int(raw_input()))
    for i in time:
        if i%10 == 0:
            ans += i
        else:
            ans += ((i//10)+1)*10
            min_time =min(min_time,i%10)
    print(ans + min_time - 10)



if __name__ == "__main__":
    main()

Solution (Python):
a = [[int(input()), 0]for i in range(5)]
for i in range(5):
    if a[i][0] % 10 == 0:
        a[i][1] = 9
    else:
        a[i][1] = a[i][0] % 10
a = sorted(a, key=lambda x: x[1], reverse=True)
b = 0
for i in range(5):
    if i == 4:
        b += a[i][0]
    else:
        b += (a[i][0] + 9) // 10 * 10
print(b)

Solution (Python):
T=list(int(input()) for _ in range(5))
tmin=10
ans=0
for t in T:
    ans+=(-(-t//10))*10
    if t%10!=0:
        tmin=min(tmin,t%10)

print(ans+tmin-10)

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

lst = sorted(lst, key =lambda x: 10 if x%10==0 else x%10, reverse = 1)
ans = 0
for l in lst[:4]:
    if l%10 == 0:
        ans += l
    else:
        ans += l//10*10 + 10
ans += lst[4]
print(ans)

Solution (Python):
def tenmod(n,c=0):
    if (n+c) % 10 == 0:
        return (n,c)
    return tenmod(n,c+1)

lst = list(map(int,[input() for i in range(5)]))
order_sort = sorted(list(map(tenmod,lst)),key=lambda x: x[1])
print(sum([x+y for x,y in order_sort[:4]])+order_sort[4][0])

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

n_ = [0]
for i in n:
    if i % 10 == 0:
        continue
    n_.append(10 - i % 10)

print(sum(n) + sum(n_) - max(n_))

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

ans = []

for p in itertools.permutations(l):
  t = p[0]
  for i in range(1, 5):
    t = math.ceil(t/10)*10
    t += p[i]
  ans.append(t)
print(int(min(ans)))

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

import math

print(sum([math.ceil(i/10) * 10 for i in l]) - max([math.ceil(i/10) * 10 - i for i in l]))

Solution (Python):
l = [int(input()) for i in range(5)]
mod = [l[i] % 10 for i in range(5)]
time = 0
if max(mod) == 0:
    print(sum(l))
else:
    min = 0
    for i in range(5):
        if mod[i] != 0:
            time += l[i] + (10 - mod[i])
            if min < 10 - mod[i]:
                min = 10 - mod[i]
        else:
            time += l[i]
    print(time - min)

Solution (Python):
meal = [int(input()) for i in range(5)]
mod = [meal[i]%10 for i in range(5)]
time = 0
if max(mod) == 0:
  for i in range(5):
    time += meal[i]
  print(time)
else:
  min = 0
  for i in range(5):
    if mod[i] != 0:
      time += meal[i] + (10-mod[i])
      if min < 10 - mod[i]:
        min = 10-mod[i]
    else:
      time += meal[i]
  print(time - min)

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

dif = []
for i in range(5):
  if dish[i] % 10 != 0:
    dif.append(10 - (dish[i] % 10))
  else:
    dif.append(0)

max_dif = max(dif)
k = dif.index(max_dif)

sum_time = 0
for i in range(5):
  if i == k:
    sum_time += dish[i]
  else:
    if dif[i] != 0:
      sum_time += ((dish[i] // 10) + 1) * 10
    else:
      sum_time += dish[i]
    
print(sum_time)

Solution (Python):
def addTime(n):
    keta = n%10
    if keta == 0:
        return n
    return n+10 - keta

def calcKeta(n):
    if n%10!=0:
        return n%10
    return 10

food = [int(input()) for _ in range(5)]
foods = sorted(food,key=calcKeta)
min_food_time = foods[0]
foods.remove(min_food_time)
print(sum(list(map(addTime,foods)))+min_food_time)

Solution (Python):
a=[]
mv=10
for i in range(5):
    n=input()
    if n[-1]!='0':
        mv=min(mv,int(n[-1]))
    a.append(int(n))

mvb=True
ans=0
t=0
for i in range(5):
    if str(a[i])[-1]==str(mv) and mvb:
        mvb=False
        t=a[i]
        continue
    ans+=a[i]
    while ans%10!=0:
        ans+=1
print(ans+t)

Solution (Python):
lst = [int(input()) for i in range(5)]
dit=[]
time=0
for i in range(5):
    x = lst[i]
    if lst[i]%10==0:
        y=0
    else:
        y=10-lst[i]%10
    dit.append([x,y])
dit_sorted=sorted(dit,key=lambda x:x[1])
for i in range(4):
    if dit_sorted[i][1]==0:
        time += dit_sorted[i][0]
    else:
        time += (dit_sorted[i][0]//10+1)*10
time += dit_sorted[4][0]
print(time)

Solution (Python):
lst = [int(input()) for i in range(5)]
dit=[]
time=0
for i in range(5):
    x = lst[i]
    if lst[i]%10==0:
        y=0
    else:
        y=10-lst[i]%10
    dit.append([x,y])
dit_sorted=sorted(dit,key=lambda x:x[1])
for i in range(4):
    if dit_sorted[i][1]==0:
        time += dit_sorted[i][0]
    else:
        time += (dit_sorted[i][0]//10+1)*10
time += dit_sorted[4][0]
print(time)

Solution (Python):
ABCDE=[]
modABCDE=[]
for i in range(5):
  ABCDE+=[int(input())]
  if ABCDE[i]%10!=0:
    modABCDE+=[ABCDE[i]%10]  
if modABCDE!=[]:
  MIN=min(modABCDE)
else:
  MIN=10  
ans=sum(ABCDE)-sum(modABCDE)+(len(modABCDE)-1)*10+MIN
print(ans)

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

price = sorted(price, key=lambda x: x % 10)
ret = float('inf')

for i in range(5):
    s = sum(map(lambda x: x // 10 * 10 + (10 if x % 10 > 0 else 0), price[:i] + price[i + 1:])) + price[i]

    ret = min(ret, s)

print(ret)

Solution (Python):
dish = []
ans = 0
for _ in range(5):
    cost = int(input())
    rest = 10 - cost % 10
    if rest == 10:
        rest = 0
    dish.append((rest, cost))

dish.sort()
for r, c in dish:
    ans += r + c
print(ans-dish[4][0])

Solution (Python):
import sys
import math

def input(): return sys.stdin.readline()[:-1]
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 MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
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

def main():
    minv = 10
    sumv = 0
    for i in range(5):
        tmp = INT()
        if tmp % 10 > 0:
            minv = min(minv, tmp%10)
        sumv += math.ceil(tmp/10) * 10
    print(sumv - 10 + minv)



if __name__ == '__main__':
    main()

Solution (Python):

num_list = [int(input()) for i in range(5)]
max_list = []
count = 0
min_num = 0
for j in range(5):
    max_list.append(int((num_list[j] + 9) / 10) * 10)
    
    if max_list[j] - num_list[j] > count:
        count = max_list[j] - num_list[j]
        min_num = j
    else:
        pass

s = sum(max_list) - max_list[min_num] + num_list[min_num]
print(s)

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

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

z = [10-(x[i]%10) for i in range(len(x))]
zz = [0 if z[i] == 10 else z[i] for i in range(len(z))]

ans = sum(x)+sum(zz)-max(zz)

print(ans)

Solution (Python):

import time
import re
import math
import fractions

def main():
    lst=[int(input()) for a in range(5)]
    index=0
    mx=0
    total=0
    for a in range(len(lst)):
        if math.ceil(lst[a]/10)*10-lst[a]>mx:
            mx=math.ceil(lst[a]/10)*10-lst[a]
            index=a
    
    for a in range(len(lst)):
        if a==index:
            total+=lst[a]
        else:
            total+=math.ceil(lst[a]/10)*10
    print(total)
    
start=time.time()
main()

Solution (Python):
time=[];timeloss=[];ans=0
for i in range(5):
    a=input()
    if int(a[-1])==0:
        ans+=int(a)
    else:
        time.append(int(a))
        timeloss.append(10-int(a[-1]))
while len(time)>0:
        for i in range(len(time)):
            if timeloss[i]==min(timeloss):
                ans+=time[i]
                if not len(time)==1:
                    ans+=timeloss[i]
                del time[i];del timeloss[i];break
print(ans)

Solution (Python):
time=[];timeloss=[];ans=0
for i in range(5):
    a=input()
    if int(a[-1])==0:
        ans+=int(a)
    else:
        time.append(int(a))
        timeloss.append(10-int(a[-1]))
while len(time)>0:
        for i in range(len(time)):
            if timeloss[i]==min(timeloss):
                ans+=time[i]
                if not len(time)==1:
                    ans+=timeloss[i]
                del time[i];del timeloss[i];break
print(ans)

Solution (Python):
r = 10
s = 0
for _ in range(5):
	x = int(input())
	if x%10 == 0:
		s += x
	else:
		s += (x//10+1)*10
		r = min(r, x%10)
if r != 10:
	s -= 10 - r
print(s)

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

time = 0
flag = 0
Loss = []

for i in range(5):
    if L[i]%10 == 0:
        time+=L[i]
        Loss.append(0)
    else:
        time+=(L[i]-L[i]%10+10)
        Loss.append(10-L[i]%10)

time -= max(Loss)
print(time)

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

l = [(x+9)//10*10 for x in [a,b,c,d,e]]
ans=sum(l)
ans-=max([abs(x-y) for x,y in zip(l, [a,b,c,d,e])])
print(ans)

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

f_list = []
for i in lists:
	f_list.append(i[-1])

mins = 10
if not "0" in f_list:
    mins = int(min(f_list))
elif len(set(f_list)) == 1:
    pass
else:
    mins = int(sorted(set(f_list))[1])
sums = 0
for i in lists:
	sums += int((int(i)+9)/10)*10


print(sums-10+mins)

Solution (Python):



LI = [int(input()) for _ in range(5)]
LI2 = [LI[i] % 10 for i in range(5)]

x = [(LI[i],LI2[i]) for i in range(5)]


ans = 0
x = sorted(x, key = lambda x:x[1],reverse = True)
for i in range(5):
    if x[i][1] == 0:
        t = x[i]
        x.remove(t)
        x.insert(0,t)


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

Solution (Python):
a=[int(input()) for _ in range(5)]
b=[10-a[i]%10 for i in range(5)]
c=[-(-a[i]//10) for i in range(5)]
d=[0]
for i in range(5):
    if b[i]!=10:
        d.append(b[i])
print(sum(c)*10-max(d))

Solution (Python):
from sys import stdin

x = []
x.append(int(stdin.readline().rstrip()))
x.append(int(stdin.readline().rstrip()))
x.append(int(stdin.readline().rstrip()))
x.append(int(stdin.readline().rstrip()))
x.append(int(stdin.readline().rstrip()))

time = []
min = 0
for i in range(0,5):
    if x[i] %10 == 0:
        time.append(x[i])
    else:
        time.append(x[i] - (x[i]%10) + 10)
    if ((x[min]-1) % 10) > ((x[i]-1) % 10):
        min = i

time[min] = x[min]

sum_time = 0
for i in range(0,5):
    sum_time += time[i]

print(sum_time)

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

m = 0
total = 0

for i in time:
    mod = i%10
    if mod != 0:
        t = 10 - mod
    else:
        t = 0

    total += i + t

    m = max(m, t)

print(total - m)

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

mod = []
for i in time:
    mod.append(i % 10)

mod = [i for i in mod if i != 0]

for i in range(len(mod)):
    mod[i] = 10 - mod[i]

if len(mod) == 0:
    add = 0
else:
    add = sum(mod) - max(mod)

print(sum(time) + add)

Solution (Python):
import math

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

aa = 10*math.ceil(a/10)
bb = 10*math.ceil(b/10)
cc = 10*math.ceil(c/10)
dd = 10*math.ceil(d/10)
ee = 10*math.ceil(e/10)

adif = aa-a
bdif = bb-b
cdif = cc-c
ddif = dd-d
edif = ee-e

ans = aa+bb+cc+dd+ee - max(adif,bdif,cdif,ddif,edif)
print(ans)

Solution (Python):
import itertools
import math
i1 = []
i1.append(int(input()))
i1.append(int(input()))
i1.append(int(input()))
i1.append(int(input()))
i1.append(int(input()))


p_list = list(itertools.permutations(i1, 5))

tt = []
for i in p_list:
  tt.append((math.ceil(i[0]/10)+math.ceil(i[1]/10)+math.ceil(i[2]/10)+math.ceil(i[3]/10))*10+(i[4]))
  
print(min(tt))

Solution (Python):
def solve(string):
    *abcde, = map(int, string.split())
    abcde.sort(key=lambda x: (x-1) % 10)
    return "{}".format(abcde[0] + sum([((i - 1) // 10 + 1) * 10 for i in abcde[1:]]))


if __name__ == '__main__':
    print(solve('\n'.join([input() for _ in range(5)])))

Solution (Python):
A = [0] * 5

A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())

maximum = 0
for i in range(5):
  tmp = (A[i] // 10 + 1) * 10 - A[i]
  if tmp == 10:
    tmp = 0
  else:
    A[i] = (A[i] // 10 + 1) * 10
  if tmp > maximum:
    maximum = tmp
    
print(sum(A) - maximum)

Solution (Python):
import math

lst = list(map(int,[input() for i in range(5)]))

lst_10 = sorted([i%10 for i in lst])
if sum(lst_10)==0:
    print(sum(lst))
    exit()
sum_time = sum([math.ceil(i/10)*10 for i in lst])
min_list=0
while min_list==0:
    min_list = lst_10.pop(0)
print(sum_time-10+min_list)

Solution (Python):
S = 0
mns = 0
for i in range(5):
    tmp = int(input())
    S += (tmp + 9) // 10 * 10
    if tmp % 10:
        mns = max(10 - tmp % 10, mns)
print(S - mns)

Solution (Python):
import math
a = [[] for i in range(5)]
min_inp = 0
for i in range(5):
    inp = int(input())
    inp_ceil = math.ceil(inp/10)*10
    first = inp - int(inp/10) * 10
    if first == 0:
        first = 10
    a[i].append(inp)
    a[i].append(inp_ceil)
    a[i].append(first)
a = sorted(a, key=lambda x: x[2])
ans = a[0][0]

for i in range(4):
    ans += a[i+1][1]

print(ans)

Solution (Python):
list1 = []
cnt = 0
bit = 9
switch = 0
for i in range(5):
  list1.append(int(input()))
for i in range(5):
  amari = list1[i] % 10
  if amari == 0:
    cnt += 1
  else:
    switch = 1
    bit = min(bit,amari)
    list1[i] += 10-amari
if switch ==1:
  
  print(sum(list1)-10+bit)
else:
  print(sum(list1))

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

time = 0
amari = 10
for a in A:
    am = a % 10
    if am == 0:
        time += (a // 10) * 10
    else:
        time += (a // 10 + 1) * 10
        if am < amari:
            amari = am
k = 0 if amari == 10 else 10 - amari
time -= k
print(time)

Solution (Python):
F = [int(input()) for k in range(5)]
t = 0
r = 10
for k in range(5):
    if F[k]%10 != 0:
        if F[k]%10 < r:
            r = F[k]%10
            t = k
ans = 0
for k in range(5):
    if k == t or F[k]%10 == 0:
        ans += F[k]
    else:
        ans += F[k] + (10-F[k]%10)
print(ans)

Solution (Python):

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
dish_list = [a,b,c,d,e]
count = 0
modmin = [10, -1]
for i in range(5):
    if dish_list[i] % 10 != 0:
        count += 1
        if  dish_list[i] % 10 < modmin[0]:
            modmin[0] = dish_list[i] % 10
            modmin[1] = i

if modmin[1] == -1:
    ans = sum(dish_list)
else:
    ans = 0
    for i in range(5):
        if dish_list[i] % 10 != 0 and i != modmin[1]:
            b = dish_list[i] + (10- (dish_list[i] % 10))
        else:
            b = dish_list[i] 
        ans += b

print(ans)

Solution (Python):
a=[int(input()) for i in range(5)]
mi = min(map(lambda x:(x-1)%10,a))+1
print(sum(map(lambda x:(x+9)//10*10,a))-(10-mi))

Solution (Python):
def abc():
    from math import ceil
    menus = []
    for i in range(5):
        t = int(input().rstrip())
        next = ceil(t / 10) * 10
        wait = next - t
        menus.append((t, next, wait))
    menus.sort(key=lambda x: x[2])
    progress = 0
    for i in range(4):
        progress += menus[i][1]
    progress += menus[4][0]
    print(progress)


abc()

Solution (Python):
import math
L1=[int(input())/10 for i in range(5)]
L2=[]
for i in L1:
  L2.append(math.ceil(i)*10)
L3=[]
for i in range(5):
  L3.append(sum(L2)-L2[i]+L1[i]*10)
print(int(min(L3)))

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

ceiled = [(x+9)//10*10 for x in A]
can_save = [y - x for x,y in zip(A,ceiled)]

answer = sum(ceiled) - max(can_save)
print(answer)

Solution (Python):
import math
l = [int(input()) for i in range(5)]
e = 10
for i in l:
    re = i%10
    if re !=0:
        e = min(e, re)
l = [math.ceil(i/10)*10 for i in l]
print(sum(l)-(10-e))

Solution (Python):
import sys

input = sys.stdin.readline

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

exist_remainder_list = [(food, food % 10) for food in foods if food % 10 != 0]

if len(exist_remainder_list) != 0:
    last = min(exist_remainder_list, key=lambda value: value[1])
    foods.remove(last[0])

    ans = 0

    for index, food in enumerate(foods):
        ans += food
        while True:
            if ans % 10 == 0:
                break
            else:
                ans += 1

    print(ans + last[0])
else:
    ans = 0

    for index, food in enumerate(foods):
        ans += food
        while True:
            if ans % 10 == 0:
                break
            else:
                ans += 1

    print(ans)

Solution (Python):
import math
li = [int(input()) for _ in range(5)]
ans = 0
m = 0
for x in li:
  if x % 10 == 0:
      t = 0
  else:
      t = 10 - x % 10
  ans += x + t

  m = max(m,t)

print(ans-m)

Solution (Python):
na1 = []

for i1 in range(5):
    na1.append(int(input()))

r1 = 0
n1 = 0
for i1 in range(5):
    r1 += ((na1[i1] + 9) // 10) * 10
    if (na1[i1] % 10) != 0:
        if n1 == 0:
            n1 = (na1[i1] % 10)
            r1 -= 10 
        elif n1 > (na1[i1] % 10):
            n1 = na1[i1] % 10

r1 += n1
print(r1)

Solution (Python):
import itertools

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
dish = [a, b, c, d, e]
dishp = list(itertools.permutations(dish, 5))
t = []
x = 0
for i in range(0,120):
    x = 0
    for j in range(0,4):
        if dishp[i][j] %10 == 0:
            x += dishp[i][j]
        else:
            x += (dishp[i][j] // 10 +1) * 10
    x += dishp[i][4]
    t.append(x)
print(min(t))

Solution (Python):
import numpy
x=numpy.array([int(input())for _ in[0]*5])
print(sum(((x-1)//10+1)*10)+min((x-1)%10)-9)

Solution (Python):
import math

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

a_1 = 9 if int(a[-1]) == 0 else int(a[-1])
b_1 = 9 if int(b[-1]) == 0 else int(b[-1])
c_1 = 9 if int(c[-1]) == 0 else int(c[-1])
d_1 = 9 if int(d[-1]) == 0 else int(d[-1])
e_1 = 9 if int(e[-1]) == 0 else int(e[-1])

m = min(a_1, b_1, c_1, d_1, e_1)
ans = 0

if a_1 == m:
    ans = math.ceil(int(b) / 10) * 10 + math.ceil(int(c) / 10) * 10 + math.ceil(int(d) / 10) * 10 + math.ceil(int(e) / 10) * 10 + int(a)
elif b_1 == m:
    ans = math.ceil(int(a) / 10) * 10 + math.ceil(int(c) / 10) * 10 + math.ceil(int(d) / 10) * 10 + math.ceil(int(e) / 10) * 10 + int(b)
elif c_1 == m:
    ans = math.ceil(int(b) / 10) * 10 + math.ceil(int(a) / 10) * 10 + math.ceil(int(d) / 10) * 10 + math.ceil(int(e) / 10) * 10 + int(c)
elif d_1 == m:
    ans = math.ceil(int(b) / 10) * 10 + math.ceil(int(c) / 10) * 10 + math.ceil(int(a) / 10) * 10 + math.ceil(int(e) / 10) * 10 + int(d)
else:
    ans = math.ceil(int(b) / 10) * 10 + math.ceil(int(c) / 10) * 10 + math.ceil(int(d) / 10) * 10 + math.ceil(int(a) / 10) * 10 + int(e)

print(ans)

Solution (Python):


import math

def rnd(n):
    return math.ceil(n / 10) * 10

if __name__ == '__main__':
    meal = [int(input()) for _ in range(5)]
    ans = 0
    for i in meal:
        if i % 10 == 0:
            ans += i
            meal.remove(i)
    m = sorted(meal, key=lambda x: x % 10, reverse=True)
    for i in m[:-1]:
        ans += rnd(i)
    ans += m[-1]

    print(ans)

Solution (Python):
import sys
import math

input = sys.stdin.readline

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
time_list = [a, b, c, d, e]
round_sum = 0
round_list = []
for t in time_list:
    if t%10 > 0:
        round_sum += t + 10-(t%10)
        round_list.append(t + 10-(t%10))
    else:
        round_sum += t
        round_list.append(t)
cnt_list = []
for r, t in zip(round_list, time_list):
    cnt_list.append(round_sum - r + t)
print(min(cnt_list))

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

ans = float("inf")
for order in itertools.permutations(C, 5):
    total = 0
    for c in order:
        if total % 10 != 0:
            total = (total // 10 + 1) * 10
        total += c

    ans = min(total, ans)

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
num = []
iti = []

for temp in range(5):
    temp2 = input()
    temp3 = int(temp2)
    if temp3 >= 10 and temp2[-2] != "0":
        num.append((int(temp2[0:-2])+1)*10)
    elif temp2[-2] == "0":
        num.append(int(temp2[0:-2])*10)
    else:
        num.append(10)
    if int(temp2[-2]) != 0:
        iti.append(int(temp2[-2]))

if iti == []:
    last = 10
else:
    last = min(iti)
print(sum(num)-10+last)

Solution (Python):
A = str(input())
B = str(input())
C = str(input())
D = str(input())
E = str(input())
a = int(A[-1:])
b = int(B[-1:])
c = int(C[-1:])
d = int(D[-1:])
e = int(E[-1:])
F = [a,b,c,d,e]
G = F.count(0)
H = (10-a)+(10-b)+(10-c)+(10-d)+(10-e)
p = 9 if a == 0 else a
q = 9 if b == 0 else b
r = 9 if c == 0 else c
s = 9 if d == 0 else d
t = 9 if e == 0 else e
I = min([p,q,r,s,t])
J = int(A) +int(B) +int(C) + int(D) + int(E)
K = I -10*G -10
if G==5:
  print(J)
else:
  print(H+J+K)

Solution (Python):
s=0
rs=0
m=9
for i in range(5):
    n=int(input())
    rs+=n%10
    if n%10!=0:
        m=min(m,n%10)
        n=(n//10+1)*10
    s+=n
if rs==0:
    m=10
print(s-10+m)

Solution (Python):
cuisine = [int(input()) for _ in ' '*5]
time = [ ((a+9)//10*10)-a for a in cuisine ]
print(sum(time) + sum(cuisine) - max(time))

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

ans = float("inf")
for order in itertools.permutations(C, 5):
    total = 0
    for c in order:
        if total % 10 != 0:
            total = (total // 10 + 1) * 10
        total += c

    ans = min(total, ans)

print(ans)

Solution (Python):
A=[0]*5
A[0]=int(input())
A[1]=int(input())
A[2]=int(input())
A[3]=int(input())
A[4]=int(input())
hikubun=0
for i in range(5):
    hikubun=max(-A[i]%10,hikubun)
    A[i]=(A[i]//10+(A[i]%10!=0))*10
    
ans=sum(A)-hikubun
print(ans)

Solution (Python):
ls = [int(input()) for i in range(5)]
ans = []
num = 0
minNum = 10
flag = True
    
for j in ls:
    x = j % 10
    if x < minNum and x > 0:
        num = j
        minNum = x
    elif minNum == 10 and j == ls[-1]:
        flag = False
if flag:
    ans.append(num)
    ls.pop(ls.index(num))

for i in ls:
    y = ((i + 9) // 10) * 10
    ans.append(y)

print(sum(ans))

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

Solution (Python):
a=0
c=9
for i in range(5):
    b=int(input())
    a+=((b-1)//10+1)*10
    c=min((b-1)%10,c)
print(a-9+c)

Solution (Python):

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


def ten_time(x):
    return (x + 9) // 10 * 10


def rem(x):
    return ten_time(x) - x


ans = 0
for i in range(len(time)):
    ans += ten_time(time[i])

ans -= rem(max(time, key=rem))

print(ans)

Solution (Python):

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


def tkey(x):
    rem = x % 10
    return 0 if rem == 0 else 10 - rem


time.sort(key=tkey)

ans = 0
for i in range(len(time)):
    if i != 4 and time[i] % 10 != 0:
        time[i] = 10 * (time[i] // 10 + 1)
    ans += time[i]

print(ans)

Solution (Python):
a=[]
for _ in range(5):
    a.append(int(input()))
ans=1000
b=[]
for i in range(5):
    if a[i]%10!=0:
        b.append(a[i]-a[i]%10+10)
    else:
        b.append(a[i])
for i in range(5):
    ans = min(ans,sum(b)-b[i]+a[i])
print(ans)

Solution (Python):
one = []

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

for i in range(5):
    one.append(10 - menu[i] % 10)

for i in range(5):
    if one[i] == 10:
        one[i] = 0

total = 0
cnt = 0
for i in range(5):
    if cnt == 0 and one[i] == max(one):
        total += menu[i]
        cnt = 1
    else:
        total += menu[i]
        total += one[i]

print(total)

Solution (Python):










import numpy as np
import math
import copy

l = []
for _ in range(5):
    l.append(int(input()))

target_idx = -1
dig_1_min  = 10
for a in l:
    dig_1 = a % 10
    if dig_1 != 0 and dig_1 < dig_1_min:
        dig_1_min = dig_1
        target_idx = l.index(a)

total = 0
for i in range(len(l)):
    val = l[i]
    dig_1 = val % 10
    if dig_1 != 0 and i != target_idx:
        val += 10
        val -= dig_1
    total += val

print(total)

Solution (Python):
import sys
import numpy as np
import math

def ReadInputNum():
    input_num=[]
    for i in range(5):
        input_num.append(int(input()))
    return tuple(input_num)

def CheckRangeInput(*argv):
    for num in argv:
        if 1<=num<=123 and isinstance(num,int):
            pass
        else:
            print("input"+ num +"is unexpected.")
            sys.exit()


def SumTotalTime(Tuple_Input):
    list_input=list(Tuple_Input)
    amari=[]
    
    
    

    for i in list_input:
        amari.append((i-1) % 10)

    
    last_one=min(amari)
    last_one=list_input.pop(amari.index(last_one))
    
    

    out_put=0
    for i in list_input:
        out_put += math.ceil(i/10)*10
    
    print(out_put+last_one)




A,B,C,D,E = ReadInputNum()
CheckRangeInput(A,B,C,D,E)
tuple_input = (A,B,C,D,E)
SumTotalTime(tuple_input)

Solution (Python):
l1=[int(input()) for i in range(5)]
l2=[0 if item%10==0 else 10-item%10 for item in l1]

t=0
c=0
for i in range(5):
  if l2[i]==max(l2) and c==0:
    t+=l1[i]
    c+=1
  else:
    t+=(l1[i]+l2[i])
    
print(t)

Solution (Python):
x=[int(input()) for _ in range(5)]
y=[x[_]%10 for _ in range(5)]
y.sort()
s=0
a=0
for _ in range(5):
  if y[_]!=0:
    a=y[_]
    s=-1
    break
for _ in range(5):
  s=s-(-x[_] // 10)
print((s)*10+a)

Solution (Python):
import math
import sys
import numpy

a = []
for _ in range(5):
    a.append(int(input()))

ans = 0
Q = []
for i in a:
    if i % 10 != 0:
        Q.append(10 - i%10)
    ans += i
Q.sort(reverse=True)
print(ans + sum(Q[1:]))

Solution (Python):
A = [int(input()) for i in range(5)]
B = [a - a % 10 + 10 if a % 10 != 0 else a for a in A]
diff = [(b - a) for a, b in zip(A, B)]
print(sum(B)-max(diff))

Solution (Python):






import math
ds = [int(input()) for i in range(5)]
"""
29
20
7
35
120
"""





s1 = [d%10 for d in ds if d%10!=0]
if s1:
    m1 = min(s1)
else:
    m1 = 10





sum_ = 0
for d in ds:
    sum_ += math.ceil(d/10)*10





print(sum_-10+m1)

Solution (Python):
l = [int(input()) for i in range(5)]
m = []
flag = l[0]%10
cnt = 0
for i in range(1,5):
    if l[i]%10 < flag and l[i]%10 != 0:
        cnt = i
for i in range(5):
    if i == cnt or l[i]%10 == 0:
        m.append(l[i])
    else:
        m.append(l[i]+(10-(l[i]%10)))
print(sum(m))

Solution (Python):
L=[]
for _ in range(5):
   L.append(int(input())) 
   
ans=0
Lamari=[]
   
for i in L:
    if i%10!=0:
        Lamari.append(10-i%10)
    ans+=i

Lamari.sort(reverse=True)

print(ans+sum(Lamari[1:]))

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

total = 0

for i in M:
    if i % 10 == 0:
        total += i
    else:
        total += i
        total += 10 - (i%10)
        li.append(i%10)

print(total - (10 - (10 if not li else min(li))))