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 = []
x = []
for _ in range(5):
    l = int(input())
    L.append(l)
    x.append((10-(l%10))%10)

ans = 0
for i in range(len(L)):
    ans += L[i]+x[i]

ans = ans - max(x)
print(ans)

Solution (Python):
L=[int(input()) for _ in range(5)]
sum=0
modL=[(L[i]-1)%10 for i in range(5)]
last = modL.index(min(modL))
for i in range(5):
    if L[i]%10==0:
        sum += L[i]
    else:
        sum += (int(L[i]//10)+1)*10
if L[last]%10!=0:
    sum -= 10 - L[last]%10
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]
ansl=[]
import itertools
for v in itertools.permutations(l,5):
  orderl=list(v)
  
  t=0
  for order_time in orderl:
    if t%10!=0:
      t=((t//10)+1)*10
    t+=order_time
  ansl.append(t)
print(min(ansl))

Solution (Python):
def p_b():
    x = [int(input()) for _ in range(5)]
    m = 10
    idx = -1
    for i, e in enumerate(x):
        tmp = int(str(e)[-1])
        if tmp == 0:
            continue
        if m > tmp:
            m = tmp
            idx = i
    ans = 0
    for i, e in enumerate(x):
        if i == idx:
            ans += e
        else:
            ans += (e + 9) // 10 * 10

    print(ans)
p_b()

Solution (Python):
import math

A = [0] * 5
amari = [0] * 5
jikann = [0] * 5

for i in range(5):
    A[i] = int(input())
    amari[i] = A[i] % 10
    jikann[i] = math.ceil(A[i] / 10)




if 0 in amari:
    amari.remove(0)
min_index = amari.index(min(amari))

jikann.pop(min_index)
print(sum(jikann) * 10 + A[min_index])

Solution (Python):
k=[]

k.append(input())
k.append(input())
k.append(input())
k.append(input())
k.append(input())

m_num=9
m_index=0
for i in range(len(k)):
    if int(k[i][-1]) != 0:
        if int(k[i][-1]) < m_num:
            m_num = int(k[i][-1])
            m_index = i
            

sum=0
for i in range(len(k)):
    if i==m_index:
        sum+=int(k[i])
    else:
        sum+=((int(k[i])-1)//10 + 1) * 10
    
print(sum)

Solution (Python):

import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

l = [0]*5

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

t = [0]*5

for i in range(5):
	t[i] = l[i]%10
	if t[i] == 0:
		t[i] = 10




k = -1

k = t.index(min(t))



for i in range(5):
	if i != k and l[i]%10 != 0:
		l[i] = l[i] + (10-l[i]%10)



print(sum(l))

Solution (Python):
import sys
input = sys.stdin.readline
import numpy as np
import math
def print_ans(ar):
    """Test Case
    >>> print_ans(['29', '20', '7', '35','120'])
    215
    >>> print_ans(['101', '86', '119','108', '57'])
    481
    >>> print_ans(['123', '123', '123','123','123'])
    643
    """
    tmp_list = np.array([int(a[-1]) for a in ar])
    tmp_list[tmp_list == 0] = 10
    min_arg = tmp_list.argmin()
    ans = 0
    for i, a in enumerate(ar):
        if i != min_arg:
            tmp = math.ceil(int(a) / 10) * 10
        else:
            tmp = int(a)
        ans += tmp
    print(ans)


    

if __name__ == '__main__':
    ar = [input().rstrip() for _ in range(5)]
    print_ans(ar)

Solution (Python):
C = [int(input()) for _ in range(5)]
ans = 0
tmp = []
for c in C:
    if c % 10 == 0:
        ans += c
    else:
        tmp.append(c)
tmp.sort()
t_max = 0
for t in tmp:
    t_max = max(t_max, 10 - (t % 10))
    ans += 10 - (t % 10) + t
print(ans-t_max)

Solution (Python):
x = [int(input()) for _ in range(5)]
ran = [i for i in range(10,131,10)]
res = []

for q in x:
  low = 200
  for p in ran:
    if low>p-q and p-q>=0:
      low = p-q
  else:
    res.append(low)
res.sort()
res.pop(-1)
print(sum(x)+sum(res))

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

ans = 0
m = 10
x = 0
for i in range(5):
  if l[i]%10 < m and l[i]%10 > 0:
    m = l[i]%10
    x = i
for i in range(5):
  if i == x or l[i]%10 == 0:
    ans += l[i]
  else:
    ans += l[i] + 10 - l[i]%10
print(ans)

Solution (Python):
abcde =[ int(input()) for _ in range(5)]
output = 0
min_keta = 100
for val in abcde:
    if val%10 != 0:
        min_keta = min(val%10,min_keta)
        val = (val//10 +1)*10
    output += val
if min_keta != 100:
    print(output -10 + min_keta)
else:
    print(output)

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

t = 0
last_dish = 0

for i in range(5):
    if (ls[i] - 1) % 10 < (last_dish - 1) % 10:
        t += 10 * ((last_dish - 1) // 10 + 1)
        last_dish = ls[i]
    else:
        t += 10 * ((ls[i] - 1) // 10 + 1)
    
print(t + last_dish)

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

for i in range(5):
  if num[i]%10 == 0:
    a.append(10)
  else:
    a.append(num[i]%10)
    
num_min = min(a)
index_min = a.index(num_min)
if num[index_min]%10 != 0:
  num_minus = num[index_min]//10*10 + 10
else:
  num_minus = num[index_min]
num_plus = num[index_min]

for j in range(5):
  if num[j]%10 != 0:
    num[j] = num[j]//10*10 + 10

ans = sum(num) - num_minus + num_plus
print(ans)

Solution (Python):
import math

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

keta_1 = []

def roundup(arg_num):
    return math.ceil(arg_num/10)*10

for i in range(5):
    if str(list_aaa[i])[-1:] =="0":
        keta_1.append("9")
    else:
        keta_1.append(str(list_aaa[i])[-1:])
aaa_index = (keta_1.index(min(keta_1,key= lambda x: int(x))))



aaa =list_aaa.pop(aaa_index)
bbb =list(map(lambda x: round(x,-1),list_aaa))



sum_bbb= sum(list(map(lambda x: roundup(x),list_aaa)))


print(sum_bbb+aaa)

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

def main():
    dish = np.array(sys.stdin.read().split())

    minute = [int(dish[i][-1]) for i in range(5)]
    m = min(x for x in minute if x > 0) if minute.count(0) != 5 else 10

    res = (np.ceil(dish.astype(np.int64) / 10) * 10).sum() - 10 + m

    print(int(res))

if __name__ == "__main__":
    main()

Solution (Python):
import itertools

a=[int(input()) for i in range(5)]
b=list(itertools.permutations(a))
c=[]
for i in range(120):
    summary=0
    for j in range(5):
        if j==4:
            summary=summary+b[i][j]
        elif b[i][j]%10!=0:
            summary=summary+((10-b[i][j]%10)+b[i][j])
        else:
            summary=summary+b[i][j]
    c.append(summary)

print(min(c))

Solution (Python):
a = [list(input()) for _ in range(5)]
b = [int(''.join(a[i])) for i in range(len(a))]
c = []
h = 10
y = 0
for i in range(5):
    if 0 < int(a[i][-1]) <= h:
        h = int(a[i][-1])
        y = a.index(a[i])
r = b[y]
b[y] = 0
for i in range(5):
    while b[i] % 10 != 0:
        b[i] += 1

print(sum(b) + r)

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

a = list(map(lambda x: x % 10, l))
for i in range(len(a)):
    if a[i] == 0:
        a[i] = 10
a
mini = min(a)
index = a.index(mini)
def calc(x):
    if x % 10 == 0:
        return x
    else:
        return 10 + (x // 10) * 10
ans = 0
for i in range(len(l)):
    if i == index:
        
        ans += l[i]
    else:
        add = calc(l[i])
        
        ans += add
print(ans)

Solution (Python):
A = []
B = []
for i in range(5):
    a = int(input())
    A.append(a)
    B.append((a+9)-(a+9)%10)
ans = A[0] + sum(B) - B[0]
for i in range(1,5):
    ans = min(ans, A[i] + sum(B) - B[i])
print(ans)

Solution (Python):
import math
time = [int(input()) for _ in range(5)]
bad = 9
def swap(i):
  time[i],time[-1] = time[-1],time[i]
for i in time:
  if i % 10 == 0:
    continue
  else:
    if bad % 10 > i % 10:
      bad = i
if bad in time:
  index = time.index(bad)
  swap(index)
for i in range(4):
  if time[i] % 10 != 0:
    time[i] = time[i] + (10 - time[i] % 10)
print(sum(time))

Solution (Python):
five_dish = [int(input()) for _ in range(5)]
idx = 0
maxdiff = 0
result = 0
for i in range(len(five_dish)):
    tmp = five_dish[i] % 10
    if tmp != 0:
        if 10 - tmp > maxdiff:
            maxdiff = 10 - tmp
            idx = i
for j in range(len(five_dish)):
    if j == idx:
        continue
    else:
        if five_dish[j] % 10 == 0:
            result += five_dish[j]
        else:
            result += five_dish[j] + (10 - (five_dish[j] % 10))
result += five_dish[idx]
print(result)

Solution (Python):
dish = [0]*5
dish = [list(input()) for i in range(len(dish))]
time = 0
sumtime = 0

dish_sort = sorted(dish, key=lambda x:x[-1],reverse=True)
dish_sort = [''.join(dish_sort[i]) for i in range(len(dish))]
dish_sort = [int(i) for i in dish_sort]
dish1 = [i for i in dish_sort if i%10==0]
dish2 = [i for i in dish_sort if not i%10==0]
dish3 = dish1 + dish2

if len(dish2)==0:
    dish2.append(dish3[-1])
for i in range(len(dish3)-1):
    while dish3[i] > time:
        time += 10
    sumtime += time
    time = 0
print(sumtime+dish2[-1])

Solution (Python):
import numpy as np
X=[]
Y=[]
Z=[]
for i in range(5):
  x=int(input())
  X += [x]
for i in range(5):
  Y +=[-(-X[i]//10)*10]

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

answer=sum(Y)-max(Z)

print(answer)

Solution (Python):
A = []
for _ in range(5):
    A.append(int(input()))
ans = 0
maxx = 0
for i in A:
    x = 0
    if str(i)[-1] != '0':
        x = 10 - int(str(i)[-1])
        if x > maxx:
            maxx = x
    ans += (i + x)
print(ans - maxx)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    l=[int(input()) for i in range(5)]
    l2=list(map(lambda x: x%10 if x%10!=0 else 10,l))
    l3=list(map(lambda x: -(-x//10)*10,l))
    print(sum(l3)-(10-sorted(l2)[0]))

if __name__ == '__main__':
    main()

Solution (Python):
A = [int(input()) for i in range(5)]
li = 6
m = 10
for i in range(5):
    v = A[i] % 10
    if not v == 0:
        if v < m:
            m = v
            li = i

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

print(ans)

Solution (Python):
import math

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

li = [[0, a], [1, b], [2, c], [3, d], [4, e]]
idx = sorted(list(map(lambda x: [x[0], (x[1] % 10) + 10] if (x[1] % 10) == 0 else [x[0], (x[1] % 10)], li)), key=lambda x: x[1])[0][0]
print(sum(map(lambda x: li[x][1] if x == idx else math.ceil(li[x][1] * 0.1) * 10, [0, 1, 2, 3, 4])))

Solution (Python):
import math

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

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

idx = sorted(list(map(lambda x: [x, x[1] + 10] if x[1] == 0 else x, [[0, (a % 10)], [1, (b % 10)], [2, (c % 10)], [3, (d % 10)], [4, (e % 10)]])), key=lambda x: x[1])[0][0]
print(sum(map(lambda x: li[x] if x == idx else math.ceil(li[x] * 0.1) * 10, [0, 1, 2, 3, 4])))

Solution (Python):
l = []
x = 2147483647
index = 0
for i in range(5):
   l.append( int(input()) )
   n = int(l[i]%10)
   if n>0 and n<x:
      x = n
      index = i

ans = 0
for i in range(5):
    if i == index:
        ans += l[i]
    elif l[i]%10 != 0:
        ans += int(l[i]/10)*10 +10
    else:
        ans += l[i]

print(ans)

Solution (Python):
l=[int(input()) for _ in range(5)]
l_1=[]
for i in l:
  if i%10!=0:
    l_1.append(((i+9)//10)*10)
  else:l_1.append(i)
nnn=9999999    
for i in range(5):
  num_1=0
  for j in range(5):
    if i==j:
      num_1+=l[j]
    else:num_1+=l_1[j]
  nnn=min(nnn,num_1)
print(nnn)

Solution (Python):
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    ls = []
    for i in range(5):
        n = int(input().rstrip('\n'))
        ls.append([n, 0 if n % 10 == 0 else 10 - n % 10, (n + 10 - 1) // 10 * 10])
    ls.sort(key=lambda x: x[1])
    t = 0
    for i in range(4):
        t += ls[i][2]
    print(t + ls[-1][0])


if __name__ == '__main__':
    solve()

Solution (Python):
import math

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



diff = [0 if (ai%10)==0 else 10-(ai%10) for ai in a]
max_diff=max(diff)

a10 = [math.ceil(ai/10)*10 for ai in a]

ret=sum(a10)-max_diff

print(ret)

Solution (Python):

from math import ceil

time_for_serve = [int(input()) for _ in range(5)]
time_for_serve_ceil = [ceil(s / 10) * 10 for s in time_for_serve]
time_to_multiple_ten = [s % 10 for s in time_for_serve]

for i in range(len(time_to_multiple_ten)):
    if time_to_multiple_ten[i] == 0:
        time_to_multiple_ten[i] = 10

print(sum(time_for_serve_ceil) - time_for_serve_ceil[time_to_multiple_ten.index(min(time_to_multiple_ten))] + time_for_serve[time_to_multiple_ten.index(min(time_to_multiple_ten))])

Solution (Python):
a=[int(input()) for i in range(5)]
ans=0
b=sorted([a[i]%10 for i in range(5)])
for i in range(5):
    
    ans+=((a[i]+9)//10)*10
for i in range(5):
    if b[i]!=0:
        ans+=b[i]-10
        break
print(ans)

Solution (Python):
dish = [int(input()) for x in range(5)]

loss_max = 0
loss_total = 0
for i in dish:
    if i%10 != 0:
        loss_total+=(10 - i%10)
        if loss_max < 10 - i%10:
            loss_max = 10 - i%10

print(sum(dish) + loss_total - loss_max)

Solution (Python):
import itertools,math
A = [int(input()) for _ in range(5)]
p = 2 ** 10 - 1
tens = 0
for i in range(5):
    if 0 < A[i] % 10 < p:
        p = A[i] % 10
    tens += math.ceil(A[i]/10)
if p == 2 ** 10 - 1:
    print(tens * 10)
else:
    print((tens-1) * 10 +p)

Solution (Python):
from math import ceil
cook = [int(input()) for _ in range(5)]
a = sorted([((mod-1) % 10, i) for i, mod in enumerate(cook)])
ans = cook.pop(a[0][1])

for _ in range(4):
    tmp = cook.pop()
    ans += ceil(tmp/10)*10

print(ans)

Solution (Python):
a = [input() for _ in range(5)]
ans = 0
n = 10
N = 0
for i in range(5):
  if int(a[i]) % 10 == 0:
    ans += int(a[i])
  else:
    if n > int(a[i][-1]):
      n = int(a[i][-1])
      if N != 0:
        ans += N + 10 - N%10
        N = int(a[i])
      else:
        N = int(a[i])
    else:
      ans += int(a[i]) + 10 - int(a[i][-1])
print(ans + N)

Solution (Python):
import math
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=[a%10,b%10,c%10,d%10,e%10]
g=[]
if len(f)-f.count(0)==0:
    print(10*math.ceil(a/10)+10*math.ceil(b/10)+10*math.ceil(c/10)+10*math.ceil(d/10)+10*math.ceil(e/10))
else:
    for i in f:
        if i >0:
            g.append(i)
    print(10*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+min(g))

Solution (Python):
lst = [int(input()) for i in range(5)]
i1,i2 = 0,0
for i,x in enumerate(lst):
    i3 = 10 - (x % 10)
    if i3 >= i1 and not(i3 == 10):

        i1 = i3
        i2 = i


lst.append(lst.pop(i2))

ans = 0
for i in range(4):

    if lst[i] % 10 == 0:
        ans = ans + lst[i]

    else:
        ans = ans + ((lst[i] // 10 + 1)*10)


print(ans+lst[-1])

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

Solution (Python):
l=[int(input()) for I in range(5)]
p=sorted([d%10 for d in l if d%10!=0])
if len(p)==0:print(sum(l))
else:
  a=p[0]
  print(sum(l)+(len(p)-1)*10-sum(p)+a)

Solution (Python):

import sys










def main():
    dishes = [int(x) for x in sys.stdin.read().split()]
    

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

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

if __name__ == "__main__":
    main()

Solution (Python):
h=[int(input()) for i in range(5)]
h=sorted(h, key=lambda x:x%10)
total=0
frag=True
for i in h:
    if i%10==0:
        total+=i
    elif frag==True and i%10!=0:
        total+=i
        frag=False
    else:
        i=i//10
        i=i*10+10
        total+=i
print(total)

Solution (Python):
import math

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

ra = math.ceil(a / 10) * 10 - a
rb = math.ceil(b / 10) * 10 - b
rc = math.ceil(c / 10) * 10 - c
rd = math.ceil(d / 10) * 10 - d
re = math.ceil(e / 10) * 10 - e

ans = a + b + c + d + e + ra + rb + rc + rd + re - max(ra, rb, rc, rd, re)

print(ans)

Solution (Python):
import math 

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

tmp = 11
log = -1
for idx,a in enumerate(al):
    point = a % 10
    if point == 0:
        point = 10
    if tmp > point:
        tmp = point
        log = idx

ans = 0
for idx, a in enumerate(al):
    if idx != log:
        ans += math.ceil(a / 10) * 10
    else:
        ans += a
    
print(ans)

Solution (Python):
a=[]
b=[10]
x=0
ans=0
for i in range(0,5):
  a.append(int(input()))
  

for j in range(0,5):
  ans+=a[j]
  if a[j]%10>0:
    ans+=(10-(a[j]%10))
    b.append(a[j]%10)
        
if min(b)!=0:
  x=min(b)
    
print(ans-10+x)

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

m = 10
l = 0

for i in [A,B,C,D,E]:
    j = i // 10
    l += j * 10
    if i % 10 != 0:
        m = min(i%10,m)
        l += 10
        
l += m - 10
print(l)

Solution (Python):
List= [int(input()) for i in range(5)]
amari =9
time = 0
flag = False;
for i in List:
    if(i%10 != 0):
        time += 10 - i%10
        amari = min(amari,i%10)
        flag = True
output = sum(List) + time
if(flag):
    output -= 10 - amari
print(output)

Solution (Python):
b=10
d=[]
ans=[]
k=-10000
for i in range(5):
  a=int(input())
  d.append(a)
  if b>a%10 and a%10!=0:
    b=a%10
    k=i
  if a%10==0:
    ans.append(a)
  else:
    ans.append((a//10+1)*10)
if k!=-10000:
  ans[k]=d[k]
print(sum(ans))

Solution (Python):
l = list([int(input()) for _ in range(5)])
 
ans = 0
ml = []
 
for i in range(len(l)):
  ans += l[i]
  if ans % 10 == 0:
    pass
  else:
    ans += 10 - (ans % 10)

for i in range(len(l)):
  ml.append(l[i] % 10)
  if ml[i] == 0:
    ml[i] = 10
  
ans -= 10 - min(ml)
print(ans)

Solution (Python):

import numpy as np
T = np.zeros(5, dtype=int)
T[0] = int(input())
T[1] = int(input())
T[2] = int(input())
T[3] = int(input())
T[4] = int(input())
res = np.argsort(T%10)
selected_index = 0
for i in range(5):
  if(T[res[i]]%10 > 0):
    selected_index = res[i]
    break
tim = (T//10 + (T%10 != 0))*10
tim[selected_index] = T[selected_index]
print(sum(tim))

Solution (Python):
arr = []
arr.append(int(input()))
arr.append(int(input()))
arr.append(int(input()))
arr.append(int(input()))
arr.append(int(input()))

y = []
for i in range(len(arr)):
    next_time = ((arr[i] + 10) // 10) * 10
    diff = next_time - arr[i]
    if diff == 10:
        y.append([arr[i], 0])
    else:
        y.append([arr[i], diff])

y.sort(key=lambda x: -x[1])

ans = 0
for i in range(len(y)):
    if i == 0:
        ans += y[i][0]
    else:
        ans += y[i][0] + y[i][1]

print(ans)

Solution (Python):
l=[int(input()) for i in range(5)]
ans=[]
ans1=[]
for i in l:
    if i%10==0:
        ans+=[i]
    else:
        ans1+=[i]
ans2=[]
amari=[]
for i in ans1:
    amari+=[i%10]
    i=((i//10)+1)*10
    ans2+=[i]

amari.sort()
print(sum(ans+ans2)-(10-amari[0]) if len(amari)!=0 else sum(ans+ans2) )

Solution (Python):
l = [ int(input()) for _ in range(5) ]
r = sorted([ 10-((10-i)%10) for i in l ])
u = [ -(-i//10)*10 for i in l ]
print(sum(u)-(10-r[0]))

Solution (Python):
li = list()
li2 = list()
for _ in range(5):
    tmp = int(input())
    if(tmp % 10 == 0):
        li2.append(tmp)
    else:
        li.append(tmp)
li.sort(key=lambda x: x % 10, reverse=True)
li2.sort()
ans = sum(li2)
if(len(li)!=0):
    for i in range(len(li)-1):
        ans = ans + ((li[i] // 10 + 1) * 10)
    ans += li[-1]
print(ans)

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

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

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




last = 256

for x in t:
  if x%10 ==0:
    total+=x
    t.pop(t.index(x))
  elif last>200 or x%10<last%10:
    last = x
if last < 200:
  t.pop(t.index(last))
  t.append(last)
for i in range(len(t)):
  temp = total
  if i==0:
    total+=t[i]
  else:
    if t[i-1]%10 == 0:
      total += t[i]
    else:
      total += t[i] + (10 - t[i-1]%10)
print(total)

Solution (Python):
X = [int(input()) for _ in range(5)]
Y = [-(-a//10)*10 for a in X]
Z = [Y[i]-X[i] for i in range(5)]
print(sum(Y) - max(Z))

Solution (Python):
x=[]
y=[]
count=10
a=0
for i in range(5):
    x.append(int(input()))
for k in range(5):
    y.append(x[k])
for j in range(5):
    y[j]=y[j]%10

for m in range(5):
    if y[m]!=0:
        if count>y[m]:
            count=y[m]
            a=m

for w in range(5):
    if y[w]==0 or w==a:
        continue
    x[w]+=10-y[w]
print(sum(x))

Solution (Python):
from math import ceil
wg = [int(input()) for _ in range(5)]
wg.sort(key=lambda x: -x % 10)
wait = 0
for w in wg[:-1]:
    wait += ceil(w / 10) * 10
print(wait + wg[-1])

Solution (Python):
def main():
    array = [int(input()) for _ in range(5)]

    min_ones_place = 10
    for i in range(5):
        ones_place = array[i]%10
        temp = 10 - ones_place
        if temp ==10:
            continue
        array[i] += temp
        min_ones_place = min(min_ones_place, ones_place)
    print(sum(array)-(10-min_ones_place))


if __name__ == '__main__':
    main()

Solution (Python):

A = []
B = []
for i in range(5):
    A.append(int(input()))
    B.append((10 - A[-1] % 10)%10)
B.sort()
print(sum(A) + sum(B[:-1]))

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

time = 0
result = 0

for food in foods:
  if food % 10 == 0:
    result += food
  else:
    result += (food // 10 + 1) * 10
    if (10 - (food % 10)) > time:
      time = 10 - food % 10

print(result - time)

Solution (Python):
from itertools import permutations
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

min_time = float('inf')
for combo in permutations([a,b,c,d,e], r=5):
    t = 0
    for val in combo:
        if t % 10 != 0:
            t = ((t // 10)+1)*10
        t+=val
    if t < min_time:
        min_time = t
print(min_time)

Solution (Python):
from sys import stdin

li = [int(stdin.readline().rstrip()) for _ in range(5)]
lin = []

for i in range(5):
    amari = li[i]%10
    if amari == 0:
        amari = 10
    lin.append(amari)

sai = lin.index(min(lin))
point = 0
for i in range(5):
    if i == sai:
        point += li[i]
    else:
        if lin[i] == 10:
            point += li[i]
        else:
            point += li[i] + (10-lin[i])
print(point)

Solution (Python):
import numpy as np
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

time_array = np.array([A, B, C, D, E])
ten_array = np.ceil(time_array / 10)

tentimes_array = ten_array * 10
sum_time = int(sum(tentimes_array)) 
dif_array = tentimes_array - time_array
max_dif = int(max(dif_array))

print(sum_time - max_dif)

Solution (Python):
import math
t = []
for i in range(5):
  t.append(int(input()))
ct = [math.ceil(x/10)*10 for x in t]
fraction = [x%10 for x in t]
fraction = list(filter(lambda x: x > 0, fraction))
if len(fraction) > 0:
  min_fraction = min(fraction)
else:
  min_fraction = 10
print(sum(ct) - 10 + min_fraction)

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

ans = float('inf')

for i in range(5):
	cur = 0
	for j in range(5):
		if i == j: continue
		cur += A[j]
		cur = (cur + 9) // 10 * 10
	cur += A[i]
	
	ans = min(ans, cur)

print(ans)

Solution (Python):
import math
list_str = []
list1 = []
for i in range(5):
	a = input()
	list_str.append(list(a))
	list1.append(int(a))


abs_max = 10
count = 0
for i in range(5):
	if int(list_str[i][-1]) != 0 and int(list_str[i][-1]) < abs_max:
		abs_max = int(list_str[i][-1])
for i in range(5):
	count += math.ceil(list1[i]/10)

if abs_max == 10:
	print(int(count*10))
else:
	print(int(count*10)-10+abs_max)

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

for i in range(5):
    if time[i] % 10 == 0:
        time[i] = 0
    else:
        time[i] = abs((time[i] % 10) - 10)

time_m = max(time)
print(a + b + c + d + e + sum(time) - time_m)

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

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



    ans = 0
    mi = float("inf")

    for a in A:
        if a % 10 != 0:
            mi = min(mi, a % 10)
        ans += (-(-a // 10)) * 10

    if mi == float("inf"):
        print(ans)
        exit()
    print(ans - (10 - mi))



if __name__ == '__main__':
    main()

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

def main():
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())

    ans = 0
    mi = float("inf")

    if A % 10 != 0:
        mi = min(mi, A % 10)
    if B % 10 != 0:
        mi = min(mi, B % 10)
    if C % 10 != 0:
        mi = min(mi, C % 10)
    if D % 10 != 0:
        mi = min(mi, D % 10)
    if E % 10 != 0:
        mi = min(mi, E % 10)


    ans += (-(-A // 10)) * 10
    ans += (-(-B // 10)) * 10
    ans += (-(-C // 10)) * 10
    ans += (-(-D // 10)) * 10
    ans += (-(-E // 10)) * 10

    if mi == float("inf"):
        print(ans)
        exit()
    print(ans - (10 - mi))



if __name__ == '__main__':
    main()

Solution (Python):
meals = []
a = 0

for i in range(5) :
    meal = int(input())
    if meal % 10 == 0 :
        meals.append(meal)
    else :
        if 10 - (meal % 10) > a :
            a = 10 - (meal % 10)
        meals.append(meal + 10 - (meal % 10))

print(sum(meals) - a)

Solution (Python):
l=[]
total=0
a=0
for i in range(5):
    t=int(input())
    if t%10 == 0:
        total +=t
    else:    
        total +=(t//10+1)*10
        a=max(a,10-(t%10))
print(total-a)

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

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

b = [-(-x // 10) * 10 for x in a]

import numpy as np

aa = np.array(a)
bb = np.array(b)

c = max(bb - aa)

print(sum(bb) - c)

Solution (Python):
dishes = [int(input()) for i in range(5)]
print(sum(map(lambda x : ((x//10)+1)*10 if x%10!=0 else x ,dishes)) - (10-min(map(lambda x:x%10 if x%10!=0 else 10, dishes))))

Solution (Python):
import math
l = [int(input()) for _ in range(5)]
s = [math.ceil(i/10)*10-i for i in l]
print(sum(l)+sum(s)-max(s))

Solution (Python):
import math
L = [input() for _ in range(5)]
lm = int(L[0][-1])
v = int(L[0])
for l in L:
  if int(l[-1])<lm and l[-1]!='0':
    lm = int(l[-1])
    v = int(l)
t = 0
L.remove(str(v))
for l in L:
  t += math.ceil(int(l)/10)*10
print(t + v)

Solution (Python):
X=[int(input()) for i in range(5)]
ans=0
W=[]
Y=0
for i in range(5):
    if X[i]%10 == 0:
        ans+=X[i]
    else:
        ans+=(X[i]//10)*10+10
        W.append(X[i]%10)
        Y=10-min(W)
ans -= Y
print(ans)

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

X=[A,B,C,D,E]
ans=0

Y=10

for i in range(len(X)):
    if X[i]%10 == 0:
        ans+=X[i]
    else:
        Y=min(Y,X[i]%10)
        ans+=(X[i]//10)*10+10

ans +=-10+Y
print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
from math import ceil
tmp1 = [A,B,C,D,E]
tmp2 = list()
for j in range(5):
    if tmp1[j]%10 == 0:
        tmp2.append(0)
    else:
        tmp2.append(10 - tmp1[j]%10)
for i in range(5):
    tmp1[i] = ceil(tmp1[i]/10)*10
print(sum(tmp1)-max(tmp2))

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

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

t = 0
ord = 0
loss = []
for i in range(5):
	t2 = 0
	while t2 < tm[i]:
		t2 += 10
	t += t2
	loss.append(t2 - tm[i])

print(t-max(loss))

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

L = []

for k in K:
    if int(k[-1]) == 0:
        pass
    else:
        L.append(int(k[-1]))

K_int = [int(k) for k in K]

if len(L) == 0:
    ans = sum(K_int)
else:
    ans = sum(K_int) + len(L)*10 -sum(L) - (10 - min(L))

print(ans)

Solution (Python):
lst = [int(input()) for _ in range(5)]
tmp = [(l+9)%10 for l in lst]
last_index = tmp.index(min(tmp))
ans = 0
for i, l in enumerate(lst):
    if (i == last_index):
        ans += l
    else:
        ans += ((l+9)//10)*10
print(ans)

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

import math
p = [a, b, c, d, e]
pa = []
for i in range(len(p)):
    if p[i]%10 == 0:
        pa.append(0)
    else:
        pa.append(10 - p[i]%10)

ans = 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 - max(pa)
print(ans)