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.



Sample input:
29
20
7
35
120


Sample output:
215

Submission status: Runtime Error

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

list_inp = [a,b,c,d,e]
min_last = 100
for index, inp in enumerate(list_inp):
  tmp = int(str(inp)[-1])
  if tmp == 0:
    continue
  
  if tmp <= min_last:
    min_last = tmp
    min_last_index = index

# 全部の料理がちょうど１０分単位だった場合
if min_last == 100:
  min_last = 0

# 切り上げ
def ceil(src,range):
  if str(src)[-1] == '0':
    return src
  else:
    return ((int)(src / range) + 1 ) * range

ans = 0
for index,value in enumerate(list_inp):
  if index == min_last_index:
    continue
  else:
    ans += ceil(value, 10)


print(ans + list_inp[min_last_index])

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
import math

A = [input() for i in range(5)]
min = 9
min_dish = ''
for a in A:
    if int(a[-1]) < min and int(a[-1]) != 0:
        min = int(a[-1])
        min_dish = a
sum = int(min_dish)
A.remove(min_dish)
for a in A:
    if a[-1] == '0':
        sum += int(a)
    else:
        sum += int(a) + 10 - int(a[-1])
print(int(sum))

Submission status: Runtime Error

Solution code:
import sys

M = []
N = []
for i in range(5):
    l = int(raw_input().split()[0])
    if l % 10 == 0:
        M.append(l)
    else:
        N.append(l)
N = sorted(N,  key=lambda x: 10 - (x % 10))
# print(M, N)

ret = 0
for m in M:
    ret += m
for n in N:
    ret += n
    ret += (10 - (n % 10))
ret -= (10 - (N[-1] % 10))
print(ret)

Submission status: Runtime Error

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

orders = [A, B, C, D, E]
max_fp = 10
time = 0

for i, order in enumerate(orders):
    if order % 10 < max_fp and order % 10 != 0:
        max_fp = order % 10
        last_order = i

for i, order in enumerate(orders):
    if i == last_order or order % 10 == 0:
        time += order
    else:
        time += (order // 10 + 1) * 10

print(time)

Submission status: Runtime Error

Solution code:
foods = [int(input()) for i in range(5)]
time = 0
rest = list(map(lambda x: x % 10, foods))
for i in range(5):
    if rest[i] == 0:
        time += foods[i]
    else:
        time += foods[i] - rest[i] + 10

print(time - 10 + min([i for i in rest if i != 0]))

Submission status: Runtime Error

Solution code:
#n=int(input())
#li=input().split()
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
#import math
#li=list(map(int,input().split()))
#S=input()

lis=[[],[]]
for i in range(5):
    s=int(input())
    lis[0].append(s)
    lis[1].append(s%10)
for i in range(5):
    if lis[1][i]!=0:
        m=i
        break
for i in range(5):
    if lis[1][m]>lis[1][i] and lis[1][i]!=0:
        m=i
ans=0
for i in range(5):
    if i!=m:
        if lis[1][i]!=0:
            ans+=(lis[0][i]-lis[1][i]+10)
        else:
            ans+=lis[0][i]
ans+=lis[0][m]
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np

num = [] #５個の料理の必要時間
total = 0
mini = 10
for i in range(5): #入力
    a = input()
    a = int(a)
    b = a % 10 #bにはaの１の桁が０になったものが入る
    total += a - b + 10
    if b == 0:
        total -=10
    else:
        if b < mini:
            mini=b

total -=10
if mini= 10:
    print(total)
else:
    print(total + mini)

Submission status: Runtime Error

Solution code:
arr=[]
for i in range(5):
	t=int(input())
	arr.append(t)
ans=0
arr2=[]
for i in range(5):
	if(arr[i]%10==0):
		ans+=arr[i]
	else:
		ans+=((arr[i]//10)+1)*10
		arr2.append(arr[i]%10)
ans-=10
ans+=min(arr2)
print(ans)

Submission status: Runtime Error

Solution code:
A = [int(input()) for _ in range(5)]
B = [a%10 for a in A]
C = [10 - b for b in B]
while (10 in C):
  C.remove(10)
C.remove(max(C))
print(sum(A) + sum(C))

Submission status: Runtime Error

Solution code:
x = [int(input()) for i in range(5)]
a = []
res = 0
for i in x:
    if i%10!=0:
        a.append(10-i%10)
b = max(a)
c = sum(a)-b
print(sum(x)+c)

Submission status: Runtime Error

Solution code:
times = [int(input()) for i in range(5)]
cost = 0
p_times = [time % 10 for time in times]
if sum(p_times) == 0 and min(p_times) > 0:
    last_order = False
else:
    last_order = min([i for i in p_times if i > 0])
    last_order_idx = p_times.index(last_order)

if last_order:
    cost = times.pop(last_order_idx)

for time in times:
    if time % 10 == 0:
        cost += time
    else:
        cost += time + (10 - time % 10)

print(cost)

Submission status: Runtime Error

Solution code:
a = []

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


def ceil10(n):
    if n % 10 == 0:
        return n
    else:
        return (n // 10) * 10 + 10


def min_1(a):
    a2 = list(filter(lambda a: a > 0, (map(lambda e: e % 10, a))))

    return min(a2)


ans = sum(map(ceil10, a)) - 10 + min_1(a)
print(ans)

Submission status: Runtime Error

Solution code:
from math import ceil
def fanc(x):
    return round((ceil(x/10))*10)
menu = [int(input()) for _ in range(5)]
menu.sort(key=lambda x:x%10)
for i in range(5):
    if menu[i]%10:
        ans = menu.pop(i)
        break
menu = list(map(fanc, menu))
print(ans+sum(menu))

Submission status: Runtime Error

Solution code:
l=[]
m=[]
n=[]
for i in range(5):
  s=int(input())  
  m.append(round(int(s+5),-1))
  if s%10 != 0:
    l.append(s%10)
print(sum(m)+min(l)-10)

Submission status: Runtime Error

Solution code:
X = [str(input()) for _ in range(5)]
endzero = 0
elesnum = []
for x in X:
  if x[-1] == "0":
    endzero += int(x)
  else:
    elesnum.append(x)
elesnum.sort(key = lambda x: x[-1])
min_ = int(elesnum[0])
for e in elesnum[1:]:
  endzero += (int(e)//10+1)*10
print(endzero+min_)

Submission status: Runtime Error

Solution code:
import math
time_list=[]

for _ in range(5):
    time_list.append(int(input()))
# print(1, time_list)

time_list2=[]
for x in time_list:
    m = x % 10
    time_list2.append(x+(10-m))
# print("2", time_list2)
# print(round(102,-1))

mod_list = []
for x in time_list:
    m = x % 10
    if m!=0:
        mod_list.append(10-m)
min_ = max(mod_list)
# print(mod_list)



print(sum(time_list2)-min_)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

import sys
sys.setrecursionlimit(1000000)

c = [list(map(int,input().split())) for _ in range(5)]

last = 10

for i in range(5):
    if c[i][0] % 10 ==  0:
        continue
    else:
        if last > c[i][0] % 10:
            last = c[i][0] % 10
            idx = i
    
ans = 0


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


print(ans)

Submission status: Runtime Error

Solution code:
import math 
a = [int(input())for i in range(5)]
rest = []
t = 0
for i in a:
  if i%10 == 0 :
    t+=i
  else:
    rest.append(i)

f = sorted(rest, key=lambda x:str(x)[-1] ,reverse=True)
c = [math.ceil(i/10)*10for i in f[:-1]]

t += sum(c)+f[-1]

print(t)

Submission status: Runtime Error

Solution code:
lst_str = [input() for _ in range(5)]
lst_int = [int(x) for x in lst_str]
lst_diff = []

sum_lst = sum(lst_int)
for i in lst_str:
    val = 10 - int(i[-1])#一の位
    if val != 10:
        lst_diff.append(val)
# print(lst_diff)

diff = sum(lst_diff) - max(lst_diff)

ans = sum_lst + diff
print(ans)

Submission status: Runtime Error

Solution code:
a=[]
for i in range(5):
    a.append(int(input()))
b=set(map(lambda x: x%10,a))
if 0 in b:
    b.remove(0)
print(sum(map(lambda x:(x/10+1)*10 if x%10 != 0 else (x/10)*10,a))+min(b)-10)

Submission status: Runtime Error

Solution code:
from math import ceil
def fanc(x):
    return int((ceil(x/10))*10)
menu = [int(input()) for _ in range(5)]
menu.sort(key=lambda x:x%10)
for i in range(5):
    if menu[i]%10:
        ans = menu.pop(i)
        break
menu = list(map(fanc, menu))
print(ans+sum(menu))

Submission status: Runtime Error

Solution code:
a = str(input())
b = str(input())
c = str(input())
d = str(input())
e = str(input())
X = [a, b, c, d, e]
endzero = 0
elesnum = []
for x in X:
  if x[-1] == "0":
    endzero += int(x)
  else:
    elesnum.append(x)
elesnum.sort(key = lambda x: x[-1])
min_ = int(elesnum[0])
for e in elesnum[1:]:
  endzero += (int(e)//10+1)*10
print(endzero+min_)

Submission status: Runtime Error

Solution code:
#a,b,c = map(int,inpput().split(" "))
#n = int(input())
#print(a,b,c)
t=[]
for i in range(5):
    t.append(int(input()))
#n = int(input())
def dif(x):
    s = int(a/10)
    return (s+1)*10 -x

def comp(a,b):
    a1 = dif(a)
    b1 = dif(b)
    return a1 < b1
d = sorted(t, cmp=dif(a,b), reverse=True)

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

Submission status: Runtime Error

Solution code:
nums = [int(input()) for _ in range(5)]

min1 = min([i % 10 for i in nums if i%10 != 0])

amount = 0
last = True
for i in nums:
  if last and i% 10 == min1:
    amount += i
    last = False
  else:
    amount += (i //10 + 1)*10 if i %10 != 0 else (i//10)*10
print(amount)

Submission status: Runtime Error

Solution code:
import math
ae = [int(input()) for _ in range(5)]
min_ae = 9
num = 0
for a in ae:
    s = str(a)
    if s[-1] == "0":
        pass
    else:
        min_ae = min(int(s[-1]), min_ae)
    if min_ae==int(s[-1]):
        num = a
ae.remove(num)
ceil_ae = [math.ceil(a/10)*10 for a in ae]
print(num + sum(ceil_ae))

Submission status: Runtime Error

Solution code:
import numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

A = list(str(a))
B = list(str(b))
C = list(str(c))
D = list(str(d))
E = list(str(e))

k = np.argmin([A[-1], B[-1], C[-1], D[-1], E[-1]])
sum = 0
if A[-1] == 0:
  sum += a
else:
  sum += a + (10 - int(A[-1]))
if B[-1] == 0:
  sum += b
else:
  sum += b + (10 - int(B[-1]))
if C[-1] == 0:
  sum += c
else:
  sum += c + (10 - int(C[-1]))
if D[-1] == 0:
  sum += d
else:
  sum += d + (10 - int(D[-1]))
if E[-1] == 0:
  sum += e
else:
  sum += e + (10 - int(E[-1]))
sum -= 10 - [A[-1], B[-1], C[-1], D[-1], E[-1]][k]
print(sum)

Submission status: Runtime Error

Solution code:
import math 

all_list = []

for i in range(5):
  a = int(input())

  all_list.append(a)
  
last_list = [x % 10 for x in all_list if x % 10 > 0]
last_list2 = [x for x in all_list if x % 10 > 0]
last_x = last_list2[last_list.index(min(last_list))]

all_list.remove(last_x)

sum_list = [math.ceil(x / 10) * 10 for x in all_list]

m = sum(sum_list) + last_x
print(m)

Submission status: Runtime Error

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

dish_list = [a, b, c, d, e]
min_val = 100
for i, x in enumerate(dish_list):
    if x%10 == 0:
        continue
    val = x % 10
    if val < min_val:
        min_val = val
        idx = i

ans = 0
for i, dish in enumerate(dish_list):
    if i == idx:
        continue

    wait_order =  10 - dish_list[i]%10 if dish_list[i]%10 != 0 else 0

    ans += dish_list[i] + wait_order

print(ans + dish_list[idx])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
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

aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
if k > 0:
  print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)
else:
  print(A + B + C + D + E)

Submission status: Runtime Error

Solution code:
#import numpy as np
#ins = [int(input()) for _ in range(5)] 

times = []
#for num in ins:
tmp = []
for _ in range(5):
    num = int(input())
    if num % 10 == 0:
        time = num
    else:
        time = num - num % 10 + 10
    times.append(time)
    tm = num % 10
    if tm >= 1:
        tmp.append(tm)
    #print(num)
    yobun = min(tmp)

#tmp = np.asarray(ins) % 10
#tmp = tmp[tmp >= 1]
#yobun = np.min(tmp)

if yobun == 0:
    yobun = 10

all_time = sum(times) - (10-yobun)
print(all_time)

Submission status: Runtime Error

Solution code:
a=[]
for i in range(5):
  a.append(int(input()))
m={}
for i in range(5):
  if a[i]%10!=0:
    m[a[i]%10]=a[i]
target=m[min(m.keys())]
res=0
for i in range:
  if a[i]==target:
    res+=target
  else:
    res+=math.ceil(a[i]/1)
print(res)

Submission status: Runtime Error

Solution code:
x = [int(input()) for i in range(5)]
a = []
res = 0
for i in range(5):
    if x[i]%10!=0:
        a.append(10-x[i]%10)
b = max(a)
c = sum(a)-b
print(sum(x)+c)

Submission status: Runtime Error

Solution code:
A, B, C, D, E = [int(input()) for _ in range(5)]

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

time_dig = [-(-food // 10) for food in menu]
time_min_mod_10 = min([_ % 10 for _ in menu if _ % 10 != 0])

print((sum(time_dig) - 1) * 10 + time_min_mod_10)

Submission status: Runtime Error

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

menu_kiriage = []
min_reminder = 10
for i in range(5):
    reminder = menu[i]%10
    if reminder < min_reminder and reminder != 0:
        min_reminder = reminder
        min_menu = i

total = 0
for i in range(5):
    if min_menu == i:
        total += menu[i]
    else:
        total += menu[i]+10-menu[i]%10 if menu[i]%10 != 0 else menu[i]
        
print(total)

Submission status: Runtime Error

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

ans = 0
x = []

for i in [a,b,c,d,e]:
  if i % 10 != 0:
    ans += (i//10)*10 + 10
    x.append(i%10)
  else:
    ans += i

ans -= 10-min(x)
print(ans)

Submission status: Runtime Error

Solution code:
orders = [int(input()) for _ in range(5)]

rest = []
time = 0
for order in orders:
    if order % 10 == 0:
        time += order
    else:
        rest.append(order)

rest_mods = list(map(lambda x: x % 10, rest))
min_mods_index = rest_mods.index(min(rest_mods))
for i in range(len(rest)):
    time += rest[i]
    if i != min_mods_index:
        time += 10 - rest[i] % 10
print(time)

Submission status: Runtime Error

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

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

time = 0

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

ae = [i for i in ae if i % 10 != 0]

idx = 0
for i in ae:
    time += i
    time += 10 - (i % 10)

one = []
for i in ae:
    i = [j for j in str(i)]
    one.append(int(i[-1]))

print(time-10+min(one))

Submission status: Runtime Error

Solution code:
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

l = [a,b,c,d,e]
m = min([i for i in l if i != 0])
n = l.count(0)
ans = (A//10 + B//10 + C//10 + D//10 + E//10)*10 + m + (5-n)*10-10
print(ans)

Submission status: Runtime Error

Solution code:

import math

a =  int(input())
b =  int(input())
c =  int(input())
d =  int(input())
e =  int(input())
x = []
s = 0

if a % 10 != 0:
  x.append(a % 10)
  if min(x) == a % 10:
      s = math.ceil(a/10)*10

if b % 10 != 0:
  x.append(b % 10)
  if min(x) == b % 10:
      s = math.ceil(b/10)*10

if c % 10 != 0:
  x.append(c % 10)
  if min(x) == c % 10:
      s = math.ceil(c/10)*10


if d % 10 != 0:
  x.append(d % 10)
  if min(x) == d % 10:
      s = math.ceil(d/10)*10


if e % 10 != 0:
  x.append(e % 10)
  if min(x) == e % 10:
      s = math.ceil(e/10)*10

s = 0

if min(x) !=0:
  s = 10

print(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(x) -s )

Submission status: Runtime Error

Solution code:
def up(x):
	return x+10*(x%10!=0)-x%10



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

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

m=np.array([i%10+10*(i%10==0) for i in l])
a=np.argmin(m)
out=0
for i in range(5):
	if(i==a):
		out+=l[i]
	else:
		out+=up(l[i])	

print(out)

Submission status: Runtime Error

Solution code:
ans=chk=0
d=[]
for i in range(5):
    x=int(input())
    if x%10:
        d.append((x%10,x))
    else:
        ans+=x
d.sort(reverse=True)
for i in d:
    ans+=((i[1]+10)//10)*10
ans-=10-d[-1][1]%10

print(ans)

Submission status: Runtime Error

Solution code:
abc=[]
answer=0
for i in range(5):
    d=int(input())
    if d%10==0:
        answer+=d
    else:
        answer+=(int(d/10+1))*10
        abc.append(d%10)
answer-=10-min(abc)
print(answer)

Submission status: Runtime Error

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

list_inp = [a,b,c,d,e]
min_last = 9
for index, inp in enumerate(list_inp):
  tmp = int(str(inp)[-1])
  if tmp == 0:
    continue
  
  if tmp <= min_last:
    min_last = index


    
# 切り上げ
def ceil(src, range):
    return ((int)(src / range) + 1 ) * range

ans = 0
for index,value in enumerate(list_inp):
  if index == min_last:
    continue
  else:
    ans += ceil(value, 10)


print(ans + list_inp[min_last])

Submission status: Runtime Error

Solution code:
time = []
for i in range(5):
	time.append(int(input()))
remain = []
for i in range(5):
	if time[i] % 10 != 0:
		remain.append(10 - time[i] % 10)
sum = 0
for i in range(5):
	if time[i] % 10 == 0:
		sum += time[i]
	else:
		sum += (time[i] // 10 + 1) * 10

print(sum - max(remain))

Submission status: Runtime Error

Solution code:
X = [str(input()) for _ in range(5)]

endzero = 0
elesnum = []
for x in X:
  if x[-1] == "0":
    endzero += int(x)
  else:
    elesnum.append(x)
elesnum.sort(key = lambda x: x[-1])
last = elesnum[0]
for e in elesnum[1:]:
  endzero += (int(e)//10+1)*10
print(endzero+int(last))

Submission status: Runtime Error

Solution code:
A = [int(input()) for _ in range(5)]
B = [a%10 for a in A]
C = [10 - b for b in B]
while (10 in C):
  C.remove(10)
print(sum(A) + sum(C) - max(C))

Submission status: Runtime Error

Solution code:
ts = [int(input()) for _ in range(5)]
a = [t % 10 for t in ts]
min = 10
for i in range(5):
    if a[i] != 0 and min > a[i]:
        b = i
c = True
end = 0
for i in range(5):
    if c and b == i:
        end += ts[i]
        c = False
    elif a[i] != 0:
        end += (ts[i] // 10 + 1) * 10
    else:
        end += ts[i]
print(end)

Submission status: Runtime Error

Solution code:
import numpy as np
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

aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
list=[a,b,c,d,e]
min=100
for i in range(len(list)):
    if list[i]%10!=0 and list[i]%10<min:
        memo=list[i]
        min=list[i]%10
flag=0
for k in range(len(list)):
    if list[k]==memo and flag==0:
        flag=1
    else:
        while list[k]%10!=0:
            list[k]+=1
print(sum(list))

Submission status: Runtime Error

Solution code:
x = []
y = []
for i in range(5):
    a = int(input())
    if a % 10 != 0:
        y.append(a % 10)
    if a % 10 != 0:
        a = a + (10 - (a % 10))
    x.append(a)

ans = sum(x)
s = 10 - min(y)

ans -= s

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
ins = [int(input()) for _ in range(5)] 

times = []
for num in ins:
    if num % 10 == 0:
        time = num
    else:
        time = num - num % 10 + 10
    times.append(time)
    #print(num)

tmp = np.asarray(ins) % 10
tmp = tmp[tmp >= 1]
yobun = np.min(tmp)

if yobun == 0:
    yobun = 10

all_time = np.sum(times) - (10-yobun)
print(all_time)

Submission status: Runtime Error

Solution code:
import math

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
L = list[A,B,C,D,E]
min_ = L.index(min(L)
A = math.ceil(a)
B = math.ceil(b)
C = math.ceil(c)
D = math.ceil(d)
E = math.ceil(e)
m = A+B+C+D+E
if min_ == 0:
  m = m - A + a
elif min_ == 1:
  m = m - B + b
elif min_ == 2:
  m = m - C + c
elif min_ == 3:
  m = m - D + d
elif min_ == 4:
  m = m - E + e
print(m)

Submission status: Runtime Error

Solution code:
a = [int(input()) for x in range(5)]
sum = 0
b = []
for i in range(5):
    if a[i]%10 == 0:
        sum += a[i]
    else:
        c = a[i] + (10 -a[i]%10)
        sum += c
        b.append(a[i]%10)
if b is not None:
    b.sort()
    sum -= 10 - b[0]
print(sum)

Submission status: Runtime Error

Solution code:
read = input
a = [read() for i in range(5)]
a = list(map(int, a))
if all(map(lambda x: x%10 == 0, a)):
    print(sum(a))
else :
    g10 = list(filter(lambda x:x%10 > 0 , a))
    l10 = list(filter(lambda x:x%10 == 0 , a))
    m = min(g10, key=lambda x:x%10)
    g100= list(map(lambda x:x//10*10 + 10, g10))
    print(sum([*g100  ,*l10 ,- m//10*10 + m]))

Submission status: Runtime Error

Solution code:
# -*- coding:utf-8 -*-
import math

def solve():
    menus = []
    for i in range(0, 5):
        menus.append(int(input()))
    
    # １の位が最も小さいものを最後に注文する。あとはなんでもいい
    amari = 10
    for i in range(0, 5):
        if menus[i]%10 < amari and menus[i]%10 != 0:
            last = i
            amari = menus[i]%10
    
    ans = 0
    for i in range(0, 5):
        if i == last:
            continue

        ans += menus[i]
        ans = math.ceil(ans/10) * 10
    
    ans += menus[last]
    print(ans)



if __name__ == "__main__":
    solve()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 10**10

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


    ans = min(ans , t-tt)
    t = 0
print(ans)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
x = []
for _ in range(5):
    x.append(int(input()))
t = 0
wt = []
for a in x:
    t += a
    m = a % 10
    if m > 0:
      wt.append(10-m)
wt.sort()
wt.pop()
for x in wt:
    t += x
print(t)

Submission status: Runtime Error

Solution code:
a = [int(input()) for x in range(5)]
sum = 0
b = []
for i in range(5):
    if a[i]%10 == 0:
        sum += a[i]
    else:
        c = a[i] + (10 -a[i]%10)
        sum += c
        b.append(a[i]%10)
b.sort()
sum -= 10 - b[0]
print(sum)

Submission status: Runtime Error

Solution code:
with open("td3") as f:
    open0read = f.read()
n=list(map(int,open0read.split()))
n.sort(key=lambda x:-((x-1)%10))
print(sum([((x-1)//10+1)*10 for x in n[:-1]]+[n[-1]]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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

l = [a,b,c,d,e]
m = min([i for i in l if i != 0])
n = l.count(0)
ans = (A//10 + B//10 + C//10 + D//10 + E//10)*10 + m + (5-n)*10
print(ans)

Submission status: Runtime Error

Solution code:
l =input().split()
max = 0
maxi = l[0]
for i in l:
    if i%10 > max:
        max = i%10
        maxi = i
l.remove(maxi)
time =0
for i in l:
    time += (int(i/10)+1)*10
time + maxi
print(time)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

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

    ans = 0
    B = []
    for a in A:
        if a % 10 == 0:
            ans += a
        else:
            B.append(a)

    B = sorted(B, key=lambda x: -(x%10))
    n = len(B)
    for i in range(n-1):
        ans += (B[i] // 10 + 1) * 10

    ans += B[n-1]

    return ans


if __name__ == '__main__':
    print(main())

Submission status: Runtime Error

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    A = []
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()

    max_idx = 0
    max_mod = 0
    for i in range(5):
        if abs(10 - A[i] % 10)% 10> max_mod:
            max_mod = abs(10 - A[i] % 10) % 10
            max_idx = i
    time = 0
    for i in range(5):
        if i != max_idx:
            time += A[i] + (abs(10 - A[i] % 10)% 10)
    time += A[max_idx]
    print time


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
nlist = [int(input()) for i in range(5)]
#print(nlist)
total_time=0
tail=[]
for number in nlist:
    if number % 10 == 0:
        total_time += number
    else:
        total_time += (number+10-(number%10))
        tail.append(number%10)

total_time -= (10-min(tail))
print(total_time)

Submission status: Runtime Error

Solution code:
import numpy as np
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

r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
print(A + B + C + D + E + 10*(k-1) + l)

Submission status: Runtime Error

Solution code:
import math

a =  int(input())
b =  int(input())
c =  int(input())
d =  int(input())
e =  int(input())
x = []
if a % 10 != 0:
  x.append(a % 10)

if b % 10 != 0:
  x.append(b % 10)

if c % 10 != 0:
  x.append(c % 10)

if d % 10 != 0:
  x.append(d % 10)

if e % 10 != 0:
  x.append(e % 10)

print(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(x))

Submission status: Runtime Error

Solution code:
import math


nums = list(map(int, [input() for _ in range(5)]))
s = sum(math.ceil(num / 10) * 10 for num in nums)
m = min(int(str(num)[-1]) for num in nums if num % 10 != 0)
if m != 0:
  s -= (10-m)
print(s)

Submission status: Runtime Error

Solution code:
a=[int(input()) for _ in range(5)]
ar=[[i,a[i]%10] for i in range(5)]
ar.sort(key=lambda x:x[1])
i=0
while ar[i][1]==0:
    i+=1
k=ar[i][0]
time=0
for i in range(5):
    if i!=k:
        if a[i]%10==0:
            time+=a[i]
        else:
            time+=a[i]+10-a[i]%10
time+=a[k]
print(time)