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:
#

import sys
from math import ceil
input=sys.stdin.readline

def main():
    t=[int(input()) for i in range(5)]
    tp10=[t[i]%10 for i in range(5) if t[i]%10!=0]
    ans=0
    for i in range(5):
        ans+=ceil(t[i]/10)*10
    print(ans-10+min(tp10))
    
if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
A = list(map(int, open(0).read().split()))

last_order = A[min([(x%10, i) for i,x in enumerate(A) if x%10!=0])[1]]
import numpy as np
print(sum(A) + sum(10 - np.array([x%10 for x in A if x%10!=0])) - (10 - min([x%10 for x in A if x%10!=0])))

Submission status: Runtime Error

Solution code:
A = [int(input()) for _ in range(5)]
ans = 0

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

print(ans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[13]:


abcde = []
for _ in range(5):
    abcde.append(int(input()))
print(sum(-(-x//10)*10 for x in abcde) + min(x%10 for x in abcde if x%10 != 0) - 10)


# In[ ]:

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
// }}} End Header

int main() {
	vector<int> a(5);
	int max = 0;
	int kazu = 0;
	rep(i,5){
		cin >> a[i];
		int amari;
		if(a[i]%10 == 0) amari = 0;
		else amari = 10-(a[i]%10);
		if(amari >= max){
			max = amari;
			kazu = i;
		}
	}
	int ans = 0;
	rep(i,5){
		if(i == kazu) continue;
		else{
			if(a[i]%10 == 0) ans+=a[i];
			else ans+= ((a[i]/10)*10 + 10);
		}
	}
	cout << ans+a[kazu] << endl;
	return 0;
}

Submission status: Runtime Error

Solution code:
import math

lis = []
for _ in range(5):
    lis.append(int(input()))
    
def roundup(x):
    return int(math.ceil(x/10)) * 10
    

    
minind = 9
tmp2 = 0
for i in range(5):
    tmp = str(lis[i])
    if tmp[-1] != "0":
        minind = min(minind, int(tmp[-1]))
        if minind == int(tmp[-1]):
            tmp2 = lis[i]
lis.remove(tmp2)

for j in range(4):
    lis[j] = roundup(lis[j])
        
print(sum(lis)+tmp2)

Submission status: Runtime Error

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

ans = 0
r =[]
for i in range(5):
  if d[i]%10!=0:
    r.append(d[i]%10)
    ans += d[i]-(d[i]%10)+10
  else:
    ans += d[i]

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
aa = 10 * ((a + 9) // 10)
bb = 10 * ((b + 9) // 10)
cc = 10 * ((c + 9) // 10)
dd = 10 * ((d + 9) // 10)
ee = 10 * ((e + 9) // 10)
x = min(set([a%10,b%10,c%10,d%10,e%10]) - {0})
# print(x)
print(aa+bb+cc+dd+ee-(10-x))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
aa = 10 * ((a + 9) // 10)
bb = 10 * ((b + 9) // 10)
cc = 10 * ((c + 9) // 10)
dd = 10 * ((d + 9) // 10)
ee = 10 * ((e + 9) // 10)
x = min(set([a%10,b%10,c%10,d%10,e%10]) - {0})
print(x)
print(aa+bb+cc+dd+ee-(10-x))

Submission status: Runtime Error

Solution code:
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10

	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	#print(min_r,min_d,i,sm)


print(sm - (10-min_r))

Submission status: Runtime Error

Solution code:
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10
		
	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	#print(min_r,min_d,i,sm)


print(sm - (10-min_r))

Submission status: Runtime Error

Solution code:
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10
		
	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	print(min_r,min_d,i,sm)


print(sm - (10-min_r))

Submission status: Runtime Error

Solution code:
import math
a=list[int(input()) for _ in range(5)]
x=0
y=0
for i in a:
  x+=math.ceil(i)
  if i%10>y:
    y=i%10
print(x+y-10)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
aa = (a - 1) // 10 + 1
bb = (b - 1) // 10 + 1
cc = (c - 1) // 10 + 1
dd = (d - 1) // 10 + 1
ee = (e - 1) // 10 + 1

aaa = a % 10
bbb = b % 10
ccc = c % 10
ddd = d % 10
eee = e % 10

print(((aa + bb + cc + dd + ee) * 10) -
      (10 - sorted(set([aaa, bbb, ccc, ddd, eee, 0]))[1]))

Submission status: Runtime Error

Solution code:
import math
fp = 10
ans = 0
for i in range(5):
    a = int(input())
    ans+= math.ceil(a/10)*10
    if a%10!=0:
    fp =  min(fp, a%10)
print(ans+fp-10 if fp@!=10 else ans )

Submission status: Runtime Error

Solution code:
def last_num(a):
    while a//10!=0:
        a=a%10
    return a

def marume(a):
    b=a
    while a//10!=0:
        a=a%10
    if a!=0:
        b=b-a+10
    return b

A=[int(input())for _ in range(5)]
last_order=9
ans=0
for i in range(5):
    if 0 < last_num(A[i]) < last_order:
        last_order=last_num(A[i])
        order_num=i
for j in range(5):
    if j !=order_num:
        ans+=marume(A[j])
    else:
        ans+=A[j]
print(ans)

Submission status: Runtime Error

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

nxt_time = [0]*n
for i in range(n):
    if ae[i] % 10 == 0:
        nxt_time[i] = ae[i]
    else:
        nxt_time[i] = ae[i] - ae[i] % 10 + 10
    # nxt_time[i] = (ae[i]+9) // 10 * 10
best_time = 99999999
for i in range(n):
    sumtime = 0
    for j in range(n):
        if i == j:
            sumtime += ae[i]
        else:
            sumtime += nxt_time[i]
    
    best_time = min(best_time, sumtime)

print(best_time)

Submission status: Runtime Error

Solution code:
import math
a = input()
b = input()
c = input()
d = input()
e = input()
l = []
if a[-1] != '0': l.append(a[-1])
if b[-1] != '0': l.append(b[-1])
if c[-1] != '0': l.append(c[-1])
if d[-1] != '0': l.append(d[-1])
if e[-1] != '0': l.append(e[-1])
min_l = min(l)
p = [ a,b,c,d,e ]
o = []
len_p = len(p)
tmp_p = ''
for i in range(0, len_p):
  if p[i][-1] == min_l:
    tmp_p = int(p.pop(i))
    break
new_p = 0
for i in p:
  new_p += math.ceil(int(i)/10)*10
print(new_p+tmp_p)

Submission status: Runtime Error

Solution code:
import math
a = input()
b = input()
c = input()
d = input()
e = input()
min_l = min(l)
p = [ a,b,c,d,e ]
o = []
len_p = len(p)
tmp_p = ''
for i in range(0, len_p):
  if p[i][-1] == min_l:
    tmp_p = int(p.pop(i))
    print(i)
    break
new_p = 0
for i in p:
  new_p += math.ceil(int(i)/10)*10
print(new_p+tmp_p)

Submission status: Runtime Error

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

temp=[10-i for i in l if i%10!=0]

print(sum(l)-max(li))

Submission status: Runtime Error

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

li=[i%10 for i in l]
minimum=min([i for i in li if i!=0])
ans=l.pop(li.index(minimum))
for i in l:
  ans+=math.ceil(i/10)*10

print(ans)

Submission status: Runtime Error

Solution code:
li,lia = [],[]
total = 0
for i in range(5):
    a = input()
    li.append(a)
for i in range(5):
    lia.append(li[i][-1])
lib = [int(s) for s in lia]
b = lib.count(0)
for i in range(b):
    lib.remove(0)
for i in range(5):
    total += (int(li[i])//10+1)*10
total -= 10*(1+b)
total += min(lib)
print(total)

Submission status: Runtime Error

Solution code:
*l=map(int,open(0))
while len(l)==0:
	ans=max(ans,max(l))
	l.remove(max(l))
	map(lambda x:x+10,l)
print(ans)

Submission status: Runtime Error

Solution code:
import math
l=[int(input()) for i in range(5)]
t=[]
for ll in l:
  t.append(math.ceil(t//10))
lis=[]
for i in range(5):
  lis.append(t[i]*10-l[i])
m=max(lis)
sum=0
for i in range(5):
  sum+=t[i]*10
print(sum-m)

Submission status: Runtime Error

Solution code:
def main():
    K = [int(input()) for _ in range(5)]
    ans = []
    A = []
    for k in K:
        a = k % 10
        if a == 0:
            ans.append(k)
        else:
            ans.append(k + (10 - a))
            A.append(a)
    print(sum(ans) - (10 - min(A)))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
l=list()
L=list()
for i in range(5):
  n=int(input())
  if n%10==0:
    l.append(n)
  else:
    L.append(n)
    
LL=list()
for n in L:
  N=n%10
  LL.append(N)
key=min(LL)
LL.remove(key)

x=len(LL)*10

M=list()
for n in L:
  nn=n//10*10
  M.append(nn)
  
  
print(sum(l)+sum(M)+x+key)

Submission status: Runtime Error

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

print(time-(10-min(l)))

Submission status: Runtime Error

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

print(time-(10-min(l)))

Submission status: Runtime Error

Solution code:
A = []
for i in range(5):
  a = int(input())
  A.append(a)
B = []
for i in range(5):
  b = A[i]%10
  B.append(b)
C =[]
for i in range(5):
  if B[i] != 0:
    c = A[i]+10-B[i]
  else:
    c = A[i]
  C.append(c)
t = 0  
for i in range(5):
  t += C[i]
B.sort()
z = set(B)
if min(z) == 0:
  z.remove(0)
print(t-10+min(z))

Submission status: Runtime Error

Solution code:
import math
A = [int(input()) for _ in range(5)]
print(sum([math.ceil(i/10)*10 for i in A])  -max([10-i for i in [ (i % 10) for i in A] if i != 0]))

Submission status: Runtime Error

Solution code:
import math
A = [int(input()) for _ in range(5)]
A.sort()
print([(i//10+1)*10 for i in A])
print(sum([math.ceil(i/10)*10 for i in A])  -max([10-i for i in [ (i % 10) for i in A] if i != 0]))

Submission status: Runtime Error

Solution code:
import numpy as np, math
A = [int(input()) for _ in range(5)]
A.sort()
print([(i//10+1)*10 for i in A])
print(sum([math.ceil(i/10)*10 for i in A])  -max([10-i for i in [ (i % 10) for i in A] if i != 0]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

time_list = list()

for _ in range(5):
    time_list.append(int(input()))


def key_func(x):
    if x < 100:  # 2桁 or 1桁の場合
        if x % 10 == 0:
            return 10
        return x % 10  # ex: 19の場合は9を返す
    else:
        if x % 100 == 0:
            return 10
        return x % 100  # ex: 123の場合は3を返す


time_list.sort(key=key_func, reverse=True)

# print(time_list)

ans = sum
for i, time in enumerate(time_list):
    if i < len(time_list) - 1:
        ans += math.ceil(time / 10) * 10
    else:
        ans += time

print(ans)

Submission status: Runtime Error

Solution code:
import math

time_list = list()

for _ in range(5):
    time_list.append(int(input()))


def key_func(x):
    if x < 100:
        if x % 10 == 0:
            return 10
        return x % 10  # ex: 19の場合は9を返す
    else:
        if x % 100 == 0:
            return 10
        return x % 100  # ex: 123の場合は3を返す


time_list.sort(key=key_func, reverse=True)

print(time_list)

ans = sum
for i, time in enumerate(time_list):
    if i < len(time_list) - 1:
        ans += math.ceil(time / 10) * 10
    else:
        ans += time

print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
A, B, C, D, E = [int(input()) for i in range(5)]

x = np.array([A, B, C, D, E])
ans = int((np.ceil((x / 10)) * 10).sum())
x = x %10
tmp = 10 - x[np.where(x>0)].min()
ans = ans - tmp

print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
A, B, C, D, E = [int(input()) for i in range(5)]

x = np.array([A, B, C, D, E])
ans = x.round(-1).sum()
x = x %10
tmp = 10 - x[np.where(x>0)].min()
ans = ans - tmp

print(ans)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
ls = [A,B,C,D,E]

#1の位
A1 = int(str(A)[-1])
B1 = int(str(B)[-1])
C1 = int(str(C)[-1])
D1 = int(str(D)[-1])
E1 = int(str(E)[-1])

flag=0
ls1 = [A1,B1,C1,D1,E1]
if ls1 == [0,0,0,0,0]:
    flag=1
j=0
for i in ls1:
    if i==0:
        ls1[j]=9
    j+=1

j=0
last = min(ls1)
for i in  ls1:
    #print(i)
    if i == last:
        las = j  #最後に注文するやつのindex
    j+=1

k=0
for i in ls:
    for j in range(1,14):
        if i <= j*10:
            ls[k] = j*10
            break
    k+=1

ls[las] -= (10 - last)
#print(ls)
if flag==0:
    print(sum(ls))
else:
    print(sum(A,B,C,D,E))

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
x=[a,b,c,d,e]
jikoku=0
def saisyou(x):
    s=9
    t=9
    p=0
    q=0
    for i in range(5):
        if x[i]<99:
            if 0<x[i]%10<s:
                s=x[i]%10
                p=x[i]
        else:
            if 0<(x[i]-100)%10<t:
                t=(x[i]-100)%10
                q=x[i]
    if s<=t:
        x.remove(p)
        return p
    else:
        x.remove(q)
        return q
jikoku+=saisyou(x)
for i in range(len(x)):
    if x[i]<99:
        if x[i]%10==0:
            jikoku+=x[i]
        else:
            jikoku+=(x[i]//10+1)*10
    else:
        if (x[i]-100)%10==0:
            jikoku+=x[i]
        else:
            jikoku+=(x[i]//10+1)*10
print(jikoku)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
x=[a,b,c,d,e]
jikoku=0
def saisyou(x):
    s=9
    t=9
    p=0
    q=0
    for i in range(5):
        if x[i]<99:
            if 0<x[i]%10<s:
                s=x[i]%10
                p=x[i]
        else:
            if 0<(x[i]-100)%10<t:
                t=(x[i]-100)%10
                q=x[i]
    if s<=t:
        x.remove(p)
        return p
    else:
        x.remove(q)
        return q
jikoku+=saisyou(x)
for i in range(len(x)):
    if x[i]%10==0:
        jikoku+=x[i]
    else:
        jikoku+=(x[i]//10+1)*10
print(jikoku)

Submission status: Runtime Error

Solution code:
a = [0]*(5)
for l in range(5):
    a[l] = str(input())
ls = [a[0],a[1],a[2],a[3],a[4]]
new = [0]*(5)
s = 0
for i in range(5):
    new[i] = int(a[i][-1])
ans = min([e for e in new if e !=0])
for p in ls:
    if int(p) % 10 ==0:
        s += int(p)
    else:
        s += ((int(p)//10) + 1) *10
print(s-10+ans)

Submission status: Runtime Error

Solution code:
menu = [int(input()) for _ in range(5)]
last = 10**18
last_menu = 0
for i in range(5):
  if menu[i]%10 != 0:
    last = min(last, menu[i]%10)
  if last == menu[i]%10:
    num = i
last_menu = menu.pop(num)

time = 0
for j in range(len(menu)):
  if menu[j]%10 == 0:
    time += menu[j]
  else:
    time += menu[j] + (10 - menu[j]%10)
time += last_menu

print(time)

Submission status: Runtime Error

Solution code:
menu = [int(input()) for _ in range(5)]
last = 10**18
last_menu = 0
for i in range(5):
  if menu[i]%10 != 0:
    last = min(last, menu[i]%10)
  if last == menu[i]%10:
    num = i
last_menu = menu.pop(num)

time = 0
for j in range(4):
  if menu[j]%10 == 0:
    time += menu[j]
  else:
    time += menu[j] + (10 - menu[j]%10)
time += last_menu

print(time)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
li1 = []
ans = 0
count = 0
for i in range(5):
    a = int(input())
    li1.append(a)
if sum(li1) == 0:
    print(0)
else:
    for i in range(5):
        if li1[i] % 10 == 0:
            ans += li1[i]
            count += 1
            li1[i] = 0
    for i in range(count):
        li1.remove(0)
    li2 = [s % 10 for s in li1]
    ans += min(li2)-10
    for i in range(len(li1)):
        ans += (li1[i] // 10 + 1) * 10
    print(ans)

Submission status: Runtime Error

Solution code:
li1 = []
ans = 0
count = 0
for i in range(5):
    a = int(input())
    li1.append(a)
for i in range(5):
    if li1[i] % 10 == 0:
        ans += li1[i]
        count += 1
        li1[i] = 0
for i in range(count):
    li1.remove(0)
li2 = [s % 10 for s in li1]
ans += min(li2)-10
for i in range(len(li1)):
    ans += (li1[i] // 10 + 1) * 10
print(ans)

Submission status: Runtime Error

Solution code:
arr = [0]*5
for i in range(5):
    arr[i] = int(input())
time = 0
for ar in arr:
    time += (-(-ar//10))*10
amari = []
for i in arr:
    amari.append(i%10)
amari.sort()
while 0 in amari:
    amari.remove(0)
print(time - (10-amari[0]))

Submission status: Runtime Error

Solution code:
arr = [0]*5
for i in range(5):
  arr[i] = int(input())
time = 0
for ar in arr:
  time += -(-ar//10)
amari = []
for i in arr:
  amari.append(i%10)
amari.sort()
print(time - (10-amari[0])

Submission status: Runtime Error

Solution code:
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
# = [list(map(int, input().split())) for i in range(N)]
List = [A, B, C, D, E]
Time = []
Cost = []
answer = 0

for i in range(5):
    Time.append(List[i]%10)
    Cost.append(math.ceil(List[i]/10)*10)

for i in range(5):
    answer += Cost[i]

Time = list(set(Time))
if Time[0] == 0:
    Time.remove(0)

answer = answer - (10-min(Time))

print(answer)

Submission status: Runtime Error

Solution code:
n = [int(input()) for hoge in range(5)]
c = 0
t = 0
a = []
while t < 5:
  if n[t]%10 == 0:
    c += n[t]
  else:
    c += (n[t]//10 + 1)*10
    a.append(n[t]%10)
  t += 1
c -= (10-min(a))
print(c)

Submission status: Runtime Error

Solution code:
#nyuuryoku
food=[]
for i in range (5):
  food.append(int(input()))
time = 0

#1keta toru 10 watte amari dasu
#amari wo dasu
machi = []
for i in range (5):
  if food[i]%10 == 0:
    time += food[i]
  else:
    time += food[i]+(10-(food[i]%10))
    machi.append(10-(food[i]%10)) 
    
print(time-max(machi))

Submission status: Runtime Error

Solution code:
l=list(int(input()) for _ in range(5))
s=list(10-i%10 for i in l)
for i in range(s.count(10)):
  s.remove(10)
s.remove(max(s))
print(sum(l)+sum(s))

Submission status: Runtime Error

Solution code:
a = [int(input()) for i in range(5)]
key = a[0]%10
last =10-a[0]
for i in range(1,5):
    x=10-a[i]%10
    if x >= key:
        if a[i]>=last:
            last=a[i]
        key=x
a.pop(a.index(last))
modtotal=0
for i in a:
    modtotal+=10-i%10
total=sum(a)+modtotal+last
print(total)

Submission status: Runtime Error

Solution code:
import math
list=[int(input()) for x in range(5)]
list.sort(key=lambda x:x%10)
count=0
for l in list:
  if l%10==0:
    count+=1
if count==0:
  print(sum(list))
else:
  a=list[count]
  del list[count]
  ans=[]
  for t in list:
    ans.append(math.ceil(t/10)*10)
  print(sum(ans)+a)

Submission status: Runtime Error

Solution code:
import math
list=[int(input()) for x in range(5)]
list.sort(key=lambda x:x%10)
count=0
for l in list:
  if l%10==0:
    count+=1
a=list[count]
del list[count]
ans=[]
for t in list:
  ans.append(math.ceil(t/10)*10)
print(sum(ans)+a)

Submission status: Runtime Error

Solution code:
A=list(int(input()) for _ in range(5))
B=[]
C=[]
for i in A:
    if i%10!=0:
        B.append(i%10)
        C.append((i//10+1)*10)
    else:
        C.append(i)
c=10-min(B)
print(sum(C)-c)

Submission status: Runtime Error

Solution code:
import math
a=[input() for i in range(5)]
b,c=10,0
for i in range(5):
    if 0<int(a[i][-1])<b:
        b=int(a[i][-1])
        d=i
for i in range(5):
    if i==d:
        c+=int(a[i])
    else:
        if int(a[i][-1])==0:
            c+=int(a[i])
        elif int(a[i])<=10:
            c+=10
        else:
            c+=(int(a[i][0:-1])+1)*10
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
lst = []
for i in range(5):
  lst.append(int(input()))
minu = 9
for j in range(5):
  if int(str(lst[j])[-1]) < minu and int(str(lst[j])[-1]) > 0:
    minu = int(str(lst[j])[-1])
    temp = lst[j]
lst.remove(temp)
time = 0
for k in range(4):
  kari = math.ceil(int(lst[k])/10)
  time += int(kari * 10)
time += temp
print(time)

Submission status: Runtime Error

Solution code:
import math
lst = []
for i in range(5):
  lst.append(int(input()))
minu = 9
for j in range(5):
  if int(str(lst[j])[-1]) < minu and int(str(lst[j])[-1]) > 0:
    minu = int(str(lst[j])[-1])
    temp = lst[j]
lst.remove(temp)
time = 0
for k in range(4):
  time += int(math.ceil(lst[k]/10) * 10)
time += temp
print(time)

Submission status: Runtime Error

Solution code:
import math
lst = []
for i in range(5):
  lst.append(int(input()))
minu = 9
for j in range(5):
  if int(str(lst[j])[-1]) < minu and int(str(lst[j])[-1]) > 0:
    minu = int(str(lst[j])[-1])
    temp = lst[j]
lst.remove(temp)
time = 0
for k in range(4):
  time += math.ceil(lst[k]/10) * 10
time += temp
print(time)

Submission status: Runtime Error

Solution code:
import math
lst = []
for i in range(5):
  lst.append(int(input()))
minu = 9
temp = 0
for j in range(5):
  if int(str(lst[j])[-1]) < minu and int(str(lst[j])[-1]) > 0:
    minu = int(str(lst[j])[-1])
    temp = lst[j]
lst.remove(temp)
time = 0
for k in range(4):
  time += math.ceil(lst[k]/10) * 10
time += temp
print(time)

Submission status: Runtime Error

Solution code:
aaa = [int(input()) for i in range(5)]

i = list()
b = 0
for a in aaa:
  n = 0
  n = 10 - int(str(a)[-1])
  if n % 10 != 0:i.append(n)
print(sum(aaa) + sum(i) - max(i))

Submission status: Runtime Error

Solution code:
aaa = [int(input()) for i in range(5)]

i = list()
b = 0
for a in aaa:
  n = 0
  n = 10 - int(str(a)[-1])
  if n % 10 != 0:i.append(n)
print(i)
print(sum(aaa) + sum(i) - max(i))

Submission status: Runtime Error

Solution code:
ret=0
m=10
for _ in range(6):
  y=int(input())
  ret+=(y+9)//10
  if y%10!=0:
    m=min(m,y%10)
print(ret-(10-m))

Submission status: Runtime Error

Solution code:

a = [int(input()) for _ in range(5)]
b = []
for i in range(len(a)):
    if a[i] % 10 == 0:
        b.append(0)
    else:
        b.append(10 - (a[i] % 10))
        c = b.index(max(b))

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def resolve():
    import math
    a = [int(input()) for _ in range(5)]
    b = []
    for i in range(5):
        if a[i]%10 != 0:
            b.append(a[i]%10)
    if b == []
        amin = 0
    else:
        amin = min(b)
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
    print(ans-10+amin)

resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    import math
    a = [int(input()) for _ in range(5)]
    b = []
    for i in range(5):
        if a[i]%10 != 0:
            b.append(a[i]%10)
    amin = min(b)
    ans = 0
    for i in range(5):
        ans += math.ceil(a[i]/10)*10
    print(ans-10+amin)

resolve()

Submission status: Runtime Error

Solution code:
li = [int(input()) for i in range(5)]
a,b,c,d,e = li[0],li[1],li[2],li[3],li[4]
a1,b1,c1,d1,e1 = int(str(a)[-1]),int(str(b)[-1]),int(str(c)[-1]),int(str(d)[-1]),int(str(e)[-1])
for i in range(1,11):
    if a1 == i:
        plus = i+(li[0])//10*10
        li.remove(li[0])
        break
    if b1 == i:
        plus = i+(li[1])//10*10
        li.remove(li[1])
        break
    if c1 == i:
        plus = i+(li[2])//10*10
        li.remove(li[2])
        break
    if d1 == i:
        plus = i+(li[3])//10*10
        li.remove(li[3])
        break
    if e1 == i:
        plus = i+(li[4])//10*10
        li.remove(li[4])
        break
for i in range(4):
    if li[i] % 10 != 0:
        li[i] = (li[i] // 10 + 1)*10
print(sum(li)+plus)

Submission status: Runtime Error

Solution code:
import math

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

ceil = lambda number: math.ceil(number / 10) * 10
ceiled_A = ceil(A)
ceiled_B = ceil(B)
ceiled_C = ceil(C)
ceiled_D = ceil(D)
ceiled_E = ceil(E)

maximum_diff = None
for minitues in [A, B, C, D, E]:
    ceiled = ceil(minitues)
    diff = ceiled - minitues
    if diff == 0: continue

    if maximum_diff is None or diff > maximum_diff:
        maximum_diff = diff

answer = ceiled_A + ceiled_B + ceiled_C + ceiled_D + ceiled_E - maximum_diff
    
print(answer)

Submission status: Runtime Error

Solution code:
l = [int(input()) for _ in range(5)]
ans = 0
m = []
for i in range(5):
    if l[i] % 10 != 0:
        m.append(l[i] % 10)
m.sort()
for i in l:
    if i % 10 != 0:
        ans += ((i // 10) + 1) * 10
    else:
        ans += i
print(ans - 10 + m[0])

Submission status: Runtime Error

Solution code:
dishes = []
serve = []
for i in range(5):
    dish = int(input())
    dishes.append(dish)
    if dish % 10 != 0:
        time = 10 - dish%10
        serve.append(time)
sort_serve = sorted(serve)
sort_serve.remove(sort_serve[len(sort_serve)-1])
if sort_serve == []:
    print(sum(dishes))
else:
    ans = sum(dishes) + sum(sort_serve)
    print(ans)

Submission status: Runtime Error

Solution code:
dishes = []
serve = []
for i in range(5):
    dish = int(input())
    dishes.append(dish)
    if dish % 10 != 0:
        time = 10 - dish%10
        serve.append(time)
sort_serve = sorted(serve)
sort_serve.remove(sort_serve[len(sort_serve)-1])
ans = sum(dishes) + sum(sort_serve)
print(ans)

Submission status: Runtime Error

Solution code:
A = [int(input()) for _ in range(5)]
cnt = 0
Max = 10
for i in range(len(A)):
    if 0 < A[i]%10 < Max:
        Max = A[i]%10
        Max_i = i
for i in range(len(A)):
    if i != Max_i:
        cnt += A[i]
    while cnt%10 != 0:
        cnt += 1
print(cnt+A[Max_i])

Submission status: Runtime Error

Solution code:
def main():
    menu = [ input() for a in range(5)]
    time = 0
    for i in range(len(menu)):
        if int(menu[i]) % 10 == 0:
            time += int(menu[i])
            menu[i] = "0"
    if len(menu) > 0:
        for i in range(menu.count("0")):
            menu.remove("0")

        menu.sort(key = (lambda x: 10 - int(x[-1])))

        for i in range(len(menu) - 1):
            time += int(menu[i]) + 10 - int(menu[i][-1])
        time += int(menu[-1])
    print(time)
main()

Submission status: Runtime Error

Solution code:
foods = [int(input()) for i in range(5)]

li = []
for i in range(5):
    if foods[i] % 10 != 0:
        li.append(10-foods[i]%10)
        foods[i] += (10-foods[i]%10)
if li = []:
    ans = sum(foods)
else:    
    ans = sum(foods) - max(li)
print(ans)

Submission status: Runtime Error

Solution code:
foods = [int(input()) for i in range(5)]

li = []
for i in range(5):
    if foods[i] % 10 != 0:
        li.append(10-foods[i]%10)
        foods[i] += (10-foods[i]%10)
ans = sum(foods) - max(li)
print(ans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
l = [input() for _ in range(5)]
m = 9
ans = 0
for i in range(len(l)):
    n = int(l[i][-1])
    if n == 0: n = 10
    if n < m:
        m = n
        ind = i
for t in range(len(l)):
    if t == ind:
        ans += int(l[t])
    else:
        n = int(l[t][-1])
        if n == 0: n = 10
        ans += (int(l[t]) + 10 - n)
print(ans)

Submission status: Runtime Error

Solution code:
# AtCoder

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

n = len(lst)
diffs = []
for i in range(n):
    dif = 10 - int(str(lst[i])[-1])
    diffs.append(dif)

s = []
for i in diffs:
    if i == 10:
        continue
    s.append(i)
mx = max(s)
s.remove(mx)
print(sum(s)+sum(lst))