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:
# coding = utf-8
list1 = []
list2 = []

time = 0
for n in range(5):

    list1.append(int(input()))

for n in list1:
    q = n // 10
    mod = n % 10
    time += 10 * q + 10
    if mod != 0:
        list2.append(mod)

time = time -10 + min(list2)
print int(time)

Submission status: Runtime Error

Solution code:
a = [int(i) for i in input().split()] 
sum = 0;
res = 0; 
temp = 0;
num = 0;
for i in range(5):
  if(a[i]%10==0):
    sum+=a[i]
  else:
    temp = (a[i]%10 +1)*10-a[i];
    if temp>res:
      sum = sum + res 
      res =temp
      sum+=a[i]
    else:
      sum = sum+a[i]+temp
print(sum)

Submission status: Runtime Error

Solution code:
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
num_lst = [A, B, C, D, E]

mods = [n % 10 for n in num_lst]
mod = min(m for m in mods if m != 0)
mod_i = mods.index(mod)

times = sum(math.ceil(v/10)*10 for i, v in enumerate(num_lst) if i != mod_i)
print(times + num_lst[mod_i])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
 
num = [int(input()) for _ in range(5)]
num2 = [n if n % 10 == 0 else n - (n%10) + 10  for n in num]

c = []
for i, j  in enumerate(num):
	n = j
	for k,l in enumerate(num2):
		if  k == i:
			continue
        else:
			n += l
	c.append(n)

print(min(c))

Submission status: Runtime Error

Solution code:
import math
 
num = [int(input()) for _ in range(5)]
num2 = [n if n % 10 == 0 else n - (n%10) + 10  for n in num]

c = []
for i, j  in enumerate(num):
    n = j
    for k,l in enumerate(num2):
        if  k == i:
            continue
        else:
            n += l
	c.append(n)
print(min(c))

Submission status: Runtime Error

Solution code:
import math
 
num = [int(input()) for _ in range(5)]
num2 = [n if n % 10 == 0 else n - (n%10) + 10  for n in num]

c = []
for i, j  in enumerate(num):
    n = j
    for k,l in enumerate(num2):
        if  k == i:
            continue
        else:
            n += l

print(min(c))

Submission status: Runtime Error

Solution code:
a = list(map(int,[input() for i in range(5)]))
b = []
c = []
d = False
for i in a:
	b.append(10-i % 10)
for i,j in zip(b,a):
	if max(b) != i:
		c.append(i+j)
	elif not d:
		c.append(j)
    else:
        c.append(i+j)
print(sum(c))

Submission status: Runtime Error

Solution code:
b = []
c = []
for i in a:
	b.append(10-i % 10)
for i,j in zip(b,a):
	if max(b) != i:
		c.append(i+j)
	else:
		c.append(j)
print(sum(c))

Submission status: Runtime Error

Solution code:
a = list(map(int,[input() for i in range(5)]))
b = []
c =[]
for i in a:
	b.append(10 - i % 10)
for i,j in zip(b,a):
	if max(b) != i:
		c.append(i+j)
    else:
        c.append(j)
print(sum(c))

Submission status: Runtime Error

Solution code:
a = list(map(int,[input() for i in range(5)]))
b = []
c =[]
for i in a:
	b.append(10-i % 10)
for i,j in zip(b,a):
	if max[b] != i:
		c.append(i+j)
print(sum(c))

Submission status: Runtime Error

Solution code:
n, h, w = [int(i) for i in input().split()]
print(sum(h <= a and w <= b for a, b in ([int(i) for i in input().split()] for _ in range(n))))

Submission status: Runtime Error

Solution code:
n, h, w = [int(i) for i in input().split()]
r = [h <= a and w <= b for a, b in ([int(i) for i in input().split()] for _ in range(n))]
print(sum(r))

Submission status: Runtime Error

Solution code:
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
num_lst = [A, B, C, D, E]

mods = [n % 10 for n in num_lst]
mod = min(m for m in mods if m != 0)
mod_i = mods.index(mod)

times = sum(math.ceil(v/10)*10 for i, v in enumerate(num_lst) if i != mod_i)
print(times + num_lst[mod_i])

Submission status: Runtime Error

Solution code:
import math

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

mods = [n % 10 for n in num_lst]
mod = min(m for m in mods if m != 0)
mod_i = mods.index(mod)

times = sum(math.ceil(v/10)*10 for i, v in enumerate(num_lst) if i != mod_i)
print(times + num_lst[mod_i])

Submission status: Runtime Error

Solution code:
import math

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

mods = [n % 10 for n in num_lst]
mod = min(m for m in mods if m != 0)
mod_i = mods.index(mod)

times = sum(math.ceil(v/10)*10 for i, v in enumerate(num_lst) if i != mod_i)
print(times + num_lst[mod_i])

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]
sub = 10 - min([i%10 for i in l if i%10!=0 ])
M = []
for i in l:
  if i%10 == 0:
    M.append(i)
  else:
    M.append(((i//10)+1)*10)
print(sum(M)-sub)

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]
sub = 10 - min([i%10 for i in l if i%10!==0])
M = []
for i in l:
  if i%10 == 0:
    M.append(i)
  else:
    M.append(((i//10)+1)*10)
print(sum(M)-sub)

Submission status: Runtime Error

Solution code:
import sys

args = [int(input()) for i in range(6)]
#args = [29,20,7,35,120]
smallest = 10
i = 0
sum = 0
arg_num = 0

for tmp in args[:4]:
    if tmp % 10 < smallest:
        if tmp % 10 != 0:
            smallest = tmp % 10
            arg_num = i
    i+=1

print("smallest:" + str(arg_num))

for i in range(5):
    if i != arg_num:
        if args[i] % 10 != 0:
            args[i] = args[i] + (10 - args[i] % 10)
    print("args[" + str(i) + "]:" + str(args[i]))
    sum += args[i]

print(sum)

Submission status: Runtime Error

Solution code:
from sys import exit

time = [int(input()), int(input()), int(input()), int(input()), int(input())]

total = 0
loss = []

for t in time:
    total += t
    if t % 10 != 0:
        loss.append(10 - t % 10)

total += sum(loss) - max(loss)

print(total)

Submission status: Runtime Error

Solution code:
list = []
indent = 0
memory = 9
for i in range(5):
  list.append(int(input()))
  if memory > list[i] % 10 and list[i] % 10 > 0:
  	indent = i
    memory = list[i] % 10
 
count = 0
for i in range(5):
  if i == indent:
    count += list[i]
  else:
    count += 10 * (int(list[i]/10) + 1)
 
print(count)

Submission status: Runtime Error

Solution code:
list = []
indent = 0
for i in range(5):
  memory = 9
  list.append(int(input()))
  if memory > list[i] % 10 and list[i] % 10 > 0:
  	indent = i
    memory = list[i]
 
count = 0
for i in range(5):
  if i == indent:
    count += list[i]
  else:
    count += 10 * (int(list[i]/10) + 1)
 
print(count)

Submission status: Runtime Error

Solution code:
list = []
indent = 0
for i in range(5):
  memory = 9
  list.append(int(input()))
  if memory > list[i] % 10 && list[i] % 10 != 0:
  	indent = i
 
count = 0
for i in range(5):
  if i == indent:
    count += list[i]
  else:
    count += 10 * (int(list[i]/10) + 1)
 
print(count)

Submission status: Runtime Error

Solution code:
a=[int(input()) for i in range (5)]
m=[]
s=0
for i in range(5):
    x=a[i]%10
    if x!=0:
        s+=a[i]+10-x
    else:
        s+=a[i]
for k in range(5):
    y=a[k]%10
    b=s
    if y!=0:
        n=10-y
        b=s-n
        m.append(b)
    else:
        m.append(b)
print(min(m)

Submission status: Runtime Error

Solution code:
import math
dish = [int(input()) for _ in range(5)]
sm = 9
smin = 0
for item in dish:
  r = item % 10
  if 1 <= r <= 10:
    if sm > r:
      sm = r
      smin = item
ans = 0    
for cnt, item in enumerate(dish):
  if cnt == smin:
    ans += item
  else:
    ans += math.ceil(item, -1)
print(ans)

Submission status: Runtime Error

Solution code:
import math
dish = [int(input()) for _ in range(5)]
sm = 9
for item in dish:
  r = item % 10
  if 1 <= r <= 10:
    sm = min(sm, r)
    smin = item
ans = 0    
for cnt, item in enumerate(dish):
  if cnt == smin:
    ans += item
  else:
    ans += math.ceil(item)
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
A=[int(input()) for i in range(5)]
B=[]
for i in range(5):
    if int(str(A[i])[-1])!=0 and len(str(A[i]))>2:
        B.append(int(str(A[i])[:-3]+str(A[i]+1)+'0'))
    elif int(str(A[i])[-1])!=0 and len(str(A[i]))==2:
        B.append(int(str(int(str(A[i])[0])+1)+'0'))
    elif int(str(A[i])[-1])!=0 and len(str(A[i]))==1:
        B.append(10)
    else:
        B.append(int(A[i]))
a=np.array(A)
b=np.array(B)
np.array(B)-np.array(A)
tmp=np.sort(b-a)
return sum(tmp)+sum(a)-tmp[-1]

Submission status: Runtime Error

Solution code:
a = []

for x in range(5):
    l = int(input())
    a.append(l)
    
b = []
b0 = []
for i in a:
    if i % 10 == 0:
        b0.append(i)
    else:
        b.append(i)

c = []
c0 = []
for n in b:
    div ,mod = divmod(n,10)
    c.append(mod)
    c0.append(div)

mm  = min(c)
cc = sum(c0) + (len(c) -1)
dd = sum(b0)

print(cc*10 + dd + mm)

Submission status: Runtime Error

Solution code:
from math import ceil
a = [int(input()) for _ in range(5)]
b = [ceil(i / 10) * 10 for i in a]
print(min([sum([a[i]] + [b[j] for j in range if i != j]) for i in range(5)]))

Submission status: Runtime Error

Solution code:
def Main():
  	A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    
    Last = A
    
    if Last%10 > B%10:
      Last = B
    
    if Last%10 > C%10:
      Last = C
      
    if Last%10 > D%10:
      Last = D
      
    if Last%10 > E%10:
      Last = E
    
    BeforeTotal = (A/10+1)*10+(B/10+1)*10+(C/10+1)*10+(D/10+1)*10+(E/10+1)*10
    AfterTotal = BeforeTotal - (Last10+1)*10 +Last
    
    print(AfterTotal)
    
Main()

Submission status: Runtime Error

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

dishes=[I() for i in range(0,5)]
rounded = []
for i in dishes:
    if i%10 != 0:
        i += 10 - i % 10
    rounded.append(i)
result=10**10
for i in range(len(dishes)):
    # order i in the end
    result = min(result, sum([r for ridx, r in rounded if ridx != i]) + dishes[i])
    
print(result)

Submission status: Runtime Error

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

dishes=[I() for i in range(0,5)]
rounded = []
for i in dishes:
    if i%10 != 0:
        i += 10 - i % 10
    rounded.append(i)
result=10**10
for i in range(len(dishes)):
    # order i in the end
    result = min(result, sum([r for ridx, r in rounded if ridx != i] + dishes[i])
    
print(result)

Submission status: Runtime Error

Solution code:
l=[int(input()) for i in range(5)]
m=[c%10 for c in l if c%10>0]

def f(c):
    if c%10>0:
        return c+10-c%10
    else:
        return c

t=[f(c) for c in l]

ans=sum(t)
if len(l)>0:
  ans-=10-min(m)
print(ans)

Submission status: Runtime Error

Solution code:
a=[int(input()) for _ in range(5)]
a.sort()
a=[i*10 + j for i, j in enumurate(a)]
print(max(a))

Submission status: Runtime Error

Solution code:
p={} #調理時間
r={} #注文-次の注文までの時間
for i in range(5):
    p[i] = int(input())
    if p[i] % 10 != 0:
        r[i] = p[i] + 10 - p[i] % 10

lastnum = 0
for i in range(1,5):
    if r[lastnum] - p[lastnum] < r[i] - p[i]:
        lastnum = i

#print(lastnum)

time = 0
for i in range(5):
    if i != lastnum:
        time += r[i]
    else:
        time += p[i]

print(time)

Submission status: Runtime Error

Solution code:
p={} #調理時間
r={} #注文-次の注文までの時間
for i in range(5):
    p[i] = int(input())
    if p[i] % 10 != 0:
        r[i] = p[i] + 10 - p[i] % 10

lastnum = 0
for i in range(1,5):
    if r[lastnum] - p[lastnum] < r[i] - p[i]:
        lastnum = i

print(lastnum)

time = 0
for i in range(5):
    if i != lastnum:
        time += r[i]
    else:
        time += p[i]

print(time)

Submission status: Runtime Error

Solution code:
p={} #調理時間
q={} #調理時間/10のあまり
r={} #注文-次の注文までの時間
for i in range(5):
    p[i] = int(input())
    q[i] = p[i] % 10
    if q[i] != 0:
        r[i] = p[i] + 10 - q[i]

maxloss = 0
maxlossnum = 0
for i in range(5):
    if maxloss < r[i] - p[i]:
        maxloss = r[i] - p[i]
        maxlossnum = i

time = int(0)
for i in range(5):
    if i != maxlossnum:
        time += r[i]
    else:
        time += p[i]

print(time)

Submission status: Runtime Error

Solution code:
inputs=[int(input()) for i in range(5)]
summ=0
k=0
for i in inputs:
    if i%10==0:
        summ=summ+i
    else:
        s,m=divmod(i,10)
        summ=summ+(s+1)*10
		if 10-m>10-k:
          k=m
summ=summ-10+k
print(summ)

Submission status: Runtime Error

Solution code:
import itertools

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

final_time = inf
for v in itertools.permutations(don):
  time = 0
  for j in v:
    while(time % 10 != 0):
      time += 1
    time += j
  final_time = min(final_time, time)
print(final_time)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n
# def zeros(n): return np.zeros(n, dtype=np.longlong)
def zeros2(n, m): return [zeros(m) for i in range(n)] # obsoleted zeros((n, m))で代替

INF = 10**18

class Debug():
    def __init__(self):
        self.debug = True
 
    def off(self):
        self.debug = False
 
    def dmp(self, x, cmt=''):
        if self.debug:
            if cmt != '':
                w = cmt + ': ' + str(x)
            else:
                w = str(x)
            print(w)
        return x

def prob():
    d = Debug()
    d.off()
    N = 5
    dish = zeros(N)
    for i in range(N):
        dish[i] = int(input())
    d.dmp((dish),'dish')
    minDigit1 = 10
    idx = N
    time = 0
    for i in range(N):
        if dish[i] % 10 > 0 and minDigit1 > dish[i] % 10:
            idx = i
            minDigit1 = dish[i] % 10
        time += (dish[i]+9)//10*10
        d.dmp((time),'time')
    d.dmp((time),'time')
    d.dmp((idx),'idx')
    time -= (dish[idx]+9)//10*10
    time += dish[idx]
    return time
    

ans = prob()
print(ans)

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc123/tasks/abc123_b

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


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


def last_order(nums):
    cnt = 130
    num = 0

    for i in nums:
        if i % 10 != 0:
            if cnt > int(str(i)[-1]):
                cnt = int(str(i)[-1])
                num = i

    return num


def move_up(num):
    if num % 10 != 0:
        return  num + (10 - (num % 10))
    else:
        return num

last = last_order(orders)
orders.remove(last)

total_time = 0

for i in orders:
    total_time = total_time + move_up(i)

print(total_time + last)

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc123/tasks/abc123_b

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


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


def last_order(nums):
    cnt = 130
    num = 130

    for i in nums:
        if i % 10 != 0:
            if cnt > int(str(i)[-1]):
                cnt = int(str(i)[-1])
                num = i

    return num


def move_up(num):
    if num % 10 != 0:
        return  num + (10 - (num % 10))
    else:
        return num

last = last_order(orders)
orders.remove(last)

total_time = 0

for i in orders:
    total_time = total_time + move_up(i)

print(total_time + last)

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]
mod = []
ten = []

for i in range(5):
    m = list[i]%10
    X = list[i]-m
    if m != 0:
        X += 10
    if m != 0:
        mod.append(m)
    ten.append(X)
    
print(sum(ten)+min(mod)-10)

Submission status: Runtime Error

Solution code:
array1 = [int(input()) for i in range(5)]
array2 = [i for i in array1 if i % 10 == 0]
array3 = [i for i in array1 if i % 10 =! 0]
array4 = [i % 10 for i in array3]
sum1 = 0
sum2 = sum(array2)
if (len(array3) != 0):
  idx = array4.index(min(array4))
  for k, i in enumerate(array3):
    if (k == idx):
      sum1 += i
    else:
      sum1 += i + (10 - i % 10)
print(sum1 + sum2)

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]
mod = []
ten = []

for i in range(5):
    m = list[i]%10
    X = list[i]-m
    if m != 0:
        X += 10
    if m != 0:
        mod.append(m)
    ten.append(X)
    
print(mod)
print(ten)
print(sum(ten)+min(mod)-10)

Submission status: Runtime Error

Solution code:
array1 = [int(input()) for i in range(5)]
array2 = [i for i in array1 if i % 10 == 0]
array3 = [i for i in array1 if i % 10 != 0]
array4 = [i % 10 for i in array3]
idx = array4.index(min(array4))
sum1 = 0
sum2 = sum(array2)
for k, i in enumerate(array3):
  if (k == idx):
    sum1 += i
  else:
    sum1 += i + (10 - i % 10)
print(sum1 + sum2)

Submission status: Runtime Error

Solution code:
array1 = [int(input()) for i in range(5)]
array2 = [i for i in array1 if i % 10 == 0]
array3 = [i for i in array1 if i % 10 =! 0]
array4 = [i % 10 for i in array3]
idx = array4.index(min(array4))
sum1 = 0
sum2 = sum(array2)
for k, i in enumerate(array3):
  if (k == idx):
    sum1 += i
  else:
    sum1 += i + (10 - i % 10)
print(sum1 + sum2)

Submission status: Runtime Error

Solution code:
array1 = [int(input()) for i in range(5)]
array2 = [i % 10 for i in array1]
array3 = [i for i in array2 if i != 0]
idx = array3.index(min(array3))
sum1 = 0
sum2 = sum(array2)
for k, i in enumerate(array3):
  if (k == idx):
    sum1 += i
  else:
    sum1 += i + (10 - i % 10)
print(sum1 + sum2)

Submission status: Runtime Error

Solution code:
import math

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

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

def mod(n):
    return n % 10

low = map(mod, [A,B,C,D,E])
top = map(roof, [A,B,C,D,E])

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

if low == None: low = [0]

ans = sum(top) + min(low) - 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())

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

def mod(n):
    return n % 10

low = map(mod, [A,B,C,D,E])
top = map(roof, [A,B,C,D,E])

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

ans = sum(top) + min(low) - 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())

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

def mod(n):
    return n % 10

low = map(mod, [A,B,C,D,E])
top = map(roof, [A,B,C,D,E])

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

ans = sum(top) + min(low)
print(ans)

Submission status: Runtime Error

Solution code:
L = []
for _ in range(5):
    n = int(input())
    L.append([n%10, n])

L.sort()
l = 0
for i in range(5):
    if L[i][0] != 0:
        la = L[i][1]
        l = i
        break

tot = 0
for i in range(5):
    if i != l:
        if L[i][1] % 10 != 0:
            k = L[i][1]//10 + 1
        else:
            k = L[i][1]//10
        tot += k*10
tot += la
print(tot)

Submission status: Runtime Error

Solution code:
L = []
for _ in range(5):
    n = int(input())
    L.append([n%10, n])

L.sort()
for i in range(5):
    if L[i][0] != 0:
        la = L[i][1]
        l = i
        break

tot = 0
for i in range(5):
    if i != l:
        if L[i][1] % 10 != 0:
            k = L[i][1]//10 + 1
        else:
            k = L[i][1]//10
        tot += k*10
tot += la
print(tot)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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]
l_times_ten = []
amari_list = []
for i in range(len(l)):
    amari = l[i] % 10
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        amari_list.append(amari)
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)
max_total_time = sum(l_times_ten)
adding = 10 - min(amari_list)
min_total_time = max_total_time - adding
print(min_total_time)

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]
l_times_ten = []
amari_list = []
time = 0
for i in range(len(l)):
    amari = l[i] % 10
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        amari_list.append(amari)
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)
max_total_time = sum(l_times_ten)
adding = 10 - min(amari_list)
min_total_time = max_total_time - adding
print(min_total_time)

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]
l_times_ten = []
amari_list = []
time = 0
for i in range(len(l)):
    amari = l[i] % 10
    if amari == 0:
        l_times_ten.append(l[i])
    elif amari != 0:
        amari_list.append(amari)
        l_tmp =  l[i] +(10 - amari)
        l_times_ten.append(l_tmp)
# print(l_times_ten)
# print(amari_list)
max_total_time = sum(l_times_ten)
# print(min(amari_list))
adding = 10 - min(amari_list)
min_total_time = max_total_time - adding
print(min_total_time)

Submission status: Runtime Error

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

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())
# 届く時間を1の位で切り上げたとき、届く時間の和
Menu = [A,B,C,D,E]
L1=[0]
L2=[]
time_max=0
extra=[]
"""
解答1
"""
for i in Menu:
    if i%10==0:
        L1.append(i)
    else:
        L2.append(i + 10 - int(i%10))
        extra.append(i%10)
tmp = 10 - min(extra)
time_max=sum(L1)+sum(L2)
print(time_max-tmp)

Submission status: Runtime Error

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

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

mindiv10 = min(list(filter(lambda n:n>0, [x%10 for x in cooking_time])))

# search
last_food = 0
for x in cooking_time:
    if x%10 == mindiv10:
        last_food = x
        
cooking_time.remove(last_food)

time = 0
for x in cooking_time:
    time += x + (0 if x%10==0 else 10-x%10)

time += last_food

print(time)

Submission status: Runtime Error

Solution code:
B = [int(input()) for _ in range(5)]
A = [10-int(str(B[i])[-1]) for i in range(5) if str(B[i])[-1] != "0"]
A.remove(max(A))
print(sum(B)+sum(A))

Submission status: Runtime Error

Solution code:
l = [input() for _ in range(5)]
l_d1 = [int(li[-1]) for li in l]
num0 = l_d1.count(0)
for _ in range(num0):
    l_d1.remove(0)
min_d1 = l_d1.pop(l_d1.index(min(l_d1)))
time = sum([int(li) // 10 for li in l]) * 10
time += len(l_d1) * 10
time += min_d1
print(time)

Submission status: Runtime Error

Solution code:
a,b,c,d,e=[int(input()) for i in range(5)]
zero=[-(-a//10)*10, -(-b//10)*10, -(-c//10)*10, -(-d//10)*10, -(-e//10)*10]
mod=[a%10, b%10, c%10, d%10, e%10]
if sum(mod)==0:
    ans=a+b+c+d+e
else:
    while 0 in mod:
        mod.remove(0)
        m=min(mod)
        ans=sum(zero)-10+m
print(ans)

Submission status: Runtime Error

Solution code:
B = [int(input()) for _ in range(5)]
A = [str(B[i])[-1] for i in range(5)]
temp = A
last = A.index(min(temp.remove("0")))
diff = [10-int(A[o]) for o in range(5) if (A[o] != "0") and o != last]
print(sum(B)+sum(diff))

Submission status: Runtime Error

Solution code:
from functools import reduce
l = [int(input()) for _ in range(5)]
r = [i % 10 for i in l if i % 10 != 0]
l = [i if i % 10 == 0 else i // 10 * 10 + 10 for i in l]
print(reduce(lambda a, b: a + b, l) + (min(r) - 10 if r else 0)

Submission status: Runtime Error

Solution code:
l = [input() for _ in range(5)]
l_d1 = [int(li[-1]) for li in l]
num0 = l_d1.count(0)
for _ in range(num0):
    l_d1.remove(0)
min_d1 = l_d1.pop(l_d1.index(min(l_d1)))
time = sum([int(li) // 10 for li in l]) * 10
time += len(l_d1) * 10
time += min_d1
print(time)

Submission status: Runtime Error

Solution code:
mod0 = []
lst = []
for i in range(5):
    inp = int(input())
    if inp % 10 == 0:
        mod0.append(inp)
    else:
        lst.append([inp, inp % 10])
ans = sum(mod0)
lst.sort(key= lambda x :x[1])
last = lst.pop(0)
ans = sum(mod0)
for i,imod in lst:
    ans += (i//10 +1)*10

ans+=last[0]
print(ans)

Submission status: Runtime Error

Solution code:
from functools import reduce
l = [int(input()) for _ in range(5)]
r = [i % 10 for i in l if i % 10 != 0]
l = [i // 10 * 10 + 10 for i in l]
print(reduce(lambda a, b: a + b, l) + min(r if r else 0) - 10)

Submission status: Runtime Error

Solution code:
from functools import reduce
l = [int(input()) for _ in range(5)]
r = min([i % 10 for i in l if i % 10 != 0])
l = [i if i % 10 == 0 else i // 10 * 10 + 10 for i in l]
print(reduce(lambda a, b: a + b, l) + r - 10)

Submission status: Runtime Error

Solution code:
from functools import reduce
l = [int(input()) for _ in range(5)]
r = min([i % 10 for i in l if i % 10 != 0])
l = [i // 10 * 10 + 10 for i in l]
print(reduce(lambda a, b: a + b, l) + r - 10)

Submission status: Runtime Error

Solution code:
a,b,c,d,e=[int(input()) for i in range(5)]
zero=[-(-a//10)*10, -(-b//10)*10, -(-c//10)*10, -(-d//10)*10, -(-e//10)*10]
mod=[a%10, b%10, c%10, d%10, e%10]
while 0 in mod:
    mod.remove(0)
m=min(mod)
ans=sum(zero)-10+m
print(ans)

Submission status: Runtime Error

Solution code:
from functools import reduce
l = [int(input()) for _ in range(5)]
a = min([i % 10 for i in l if i % 10 != 0])
l = [i if i % 10 != 0 else i + 10 for i in l ]
ceil = lambda n: n // 10 * 10
print(reduce(lambda a, b: ceil(a) + ceil(b), l) + a)

Submission status: Runtime Error

Solution code:
a = []
for i in range(5):
    a.append(int(input()))
 
b = []
c = []
for j in range(5):
    if a[j] % 10 == 0:
        c.append(10)
        b.append(a[j]-10)
    else:
      　num = a[j]%10
        c.append(num)
        b.append(a[j] - c[j])
        
 
b_sum = sum(b)
c_min = min(c)
c_sum = c_min + 4*10
 
print(b_sum + c_sum)

Submission status: Runtime Error

Solution code:
menu = [int(input()) for i in range(5)]
adjust = []
total = 0

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

adjust.sort()
total -= 10-adjust[0]
print(total)

Submission status: Runtime Error

Solution code:
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
ans = 0
min1 = 10
for i in range(0,5):
    m = A[i] % 10
    if ((m > 0) and (m < min1)):
        min1 = m        
    ans += math.ceil(A[i] / 10) * 10
print(ans - (10 - min1))

Submission status: Runtime Error

Solution code:
array = [int(input()) for i in range(5)]
array_sub = [i % 10 for i in array]
new_lst = [i for i in array_sub if i != 0]
minimum = min(new_lst)
sum = 0
for i in array:
  if (i % 10 == 0):
    sum += i
  else:
    if (i % 10 == minimum):
      sum += i
    else:
      sum += (i + (10 - (i % 10)))
print(sum)