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:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))

lasttime = 10
for a in ls:
    b = a%10
    if b < lasttime:
        lasttime = b
        ans =a

ls.remove(ans)
sum =0
for i in ls:
    if i%10 ==0:
        sum +=i
    else:
        p = i//10
        sum += (p+1)*10

print(int(sum + ans)

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))

lasttime = 10
for a in ls:
    b = a%10
    if b < lasttime:
        lasttime = a

ls.pop(a)
sum =0
for i in ls:
    if i%10 ==0:
        sum +=i
    else:
        p = i//10
        sum += (p+1)*10

print(sum)

Submission status: Runtime Error

Solution code:
a = int(input())
a1 = a%5
a2 = a + (5-a1)%5
b = int(input())
b1=b%5
b2 = b + (5-b1)%5
c = int(input())
c1=c%5
c2 = c + (5-c1)%5
d = int(input())
d1=d%5
d2 = d + (5-d1)%5
e = int(input())
e1=e%5
e2 = e + (5-e1)%5
if min(a1,b1,c1,d1,e1) == 0:
    ans = sum(a2,b2,c2,d2,e2)
else:
    ans = sum(a2,b2,c2,d2,e2) -5 +min(a1,b1,c1,d1,e1)
print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())
a1 = a%5
a2 = a + (5-a1)%5
b = int(input())
b1=b%5
b2 = b + (5-b1)%5
c = int(input())
c1=c%5
c2 = c + (5-c1)%5
d = int(input())
d1=d%5
d2 = d + (5-d1)%5
e = int(input())
e2 = e + (5-e1)%5
if min(a1,b1,c1,d1,e1) == 0:
    ans = sum(a2,b2,c2,d2,e2)
else:
    ans = sum(a2,b2,c2,d2,e2) -5 +min(a1,b1,c1,d1,e1)
print(ans)

Submission status: Runtime Error

Solution code:
menew=[int(input()) for i in range(5)]
small=0
jo=10
for i in range(5):
    if menew[i]%10<jo and menew[i]%10!=0:
        jo=menew[i]%10
        small=menew[i]
menew.remove(small)
ans=0
for i in range(4):
    if menew[i]%10==0:
        p=0
    else:
        p=10-menew[i]%10
    ans+=menew[i]+p
    
ans+=small
print(ans)

Submission status: Runtime Error

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

best_min = 10
for idx, i in enumerate(num):
    if i % 10 != 0:
        if i % 10 < best_min:
            best_min = i % 10
            index = idx
count = 0
for idx, i in enumerate(num):
    if idx == index:
        count += i
    else:
        if i % 10 == 0:
            count += i
        else:
            count += i + 10 - (i%10)
print(count)

Submission status: Runtime Error

Solution code:
numberOfToorists = int(input())

minimumCapacity = 10.0**16

for i in range(5):
	vehicleCapacity = int(input())
	minimumCapacity = min(minimumCapacity, vehicleCapacity)

bottleNeckTime = numberOfToorists / minimumCapacity
if numberOfToorists % minimumCapacity > 0:
	bottleNeckTime += 1

requiredTime = bottleNeckTime + 4

print(requiredTime)

Submission status: Runtime Error

Solution code:
import numpy as np

nums = []
sortedNums = [0,0,0,0,0]
sortedRemainders = [0,0,0,0,0]
for i in range(5):
	nums.append(int(input()))

remainders = [0,0,0,0,0]
for i in range(5):
	if nums[i] % 10 == 0:
		remainders[i] = 10
	else:
		remainders[i] = nums[i] % 10

sortedRemaindersIndex = np.ndarray.tolist(np.argsort(remainders))

for i in range(5):
	sortedNums[i] = nums[sortedRemaindersIndex[i]]

elapsedTime = 0
for i in range(4):
	if sortedNums%10 == 0:
		elapsedTime += sortedNums[i]
	else:
		elapsedTime += (sortedNums[i]/10 +1) * 10

elapsedTime += sortedNums[0]

print(elapsedTime)

Submission status: Runtime Error

Solution code:
import numpy as np

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

remainders = [0,0,0,0,0]
for i in range(5):
	remainders[i] = nums[i] % 10

sortedRemainders = np.argsort(remainders)

for i in range(5):
	sortedNums[i] = nums[sortedRemainders[i]]

elapsedTime = 0
for i in range(4):
	if sortedRemainders[i] == 0:
		elapsedTime += sortedNums[i]
	else:
		elapsedTime += sortedNums[i] + 10 - sortedRemainders

elapsedTime += sortedNums[4]

print(elapsedTime)

Submission status: Runtime Error

Solution code:
from sys import stdin
import math

foods = [ stdin.readline().rstrip() for _ in range(5) ]
last = [ int(_[-1]) for _ in foods ]
last_sorted = sorted(last)
for i in last_sorted:
    if i == 0:
        continue
    else:
        min = i
        break
ans=0
foods_int = [ int(k) for k in foods]
for j in range(len(foods_int)):
    if j == last.index(min):
        ans+=foods_int[j]
    else:
        ans+=math.ceil(foods_int[j]/10) * 10
print(ans)

Submission status: Runtime Error

Solution code:
n = []
n[0] = int(input())
n[1] = int(input())
n[2] = int(input())
n[3] = int(input())
n[4] = int(input())

minNum = 10
array = 0
for i in range(len(n)):
	num = n[i] % 10
	if(num <= minNum):
		minNum = num
		array = i

arraySum = []
for j in n:
	k = ((j + 9) // 10) * 10
	arraySum.append(k)
	
print(sum(arraySum) + n[array])

Submission status: Runtime Error

Solution code:
a = []
for i in range(5):
  a.append(int(input()) / 10)
b = 0
for i in a:
  b += (-(-a / 1) * 10)

print(b)

Submission status: Runtime Error

Solution code:
# coding: utf-8
import math
# Your code here!
menu = list()
for i in range(5):
    menu.append(int(input()))

sum_time = sum([math.ceil(x/10)*10 for x in menu])

a =  min([x%10 for x in menu if x%10 != 0])

print(sum_time-(10-a))

Submission status: Runtime Error

Solution code:
*A, = map(int, open(0).read().split())
#print(A)
B = [ A[i]%10 for i in range(5) ]
#print(B)
idx = 0
d = B[0]
for l in B:
    if l <= d:
        d=l
        idx+=1
    elif l == 0:
        idx+=1
#print(idx)
A2 = []
A2.extend(A)
for i in range(5):
    if A[i]%10 != 0:
        A2[i] = (A[i]//10+1)*10
#print(A2)
A2.pop(idx)
#print(A2)
print(sum(A2)+A[idx])
#print(A[idx])
#print(A)

Submission status: Runtime Error

Solution code:
dish_time = [int(input()) for i in range(5)]
rest=[0,0,0,0,0]
last_min=[]

for j in range(5):
    rest[j] = dish_time[j] - (dish_time[j]//10*10)
    if rest[j] != 0:
        dish_time[j] = (dish_time[j]//10 + 1 ) *10   
        last_min.append(rest[j])

sum_time =  0

for i in range(5):
    sum_time = sum_time + dish_time[i]

sum_time = sum_time + min(last_min) - 10
    
print(sum_time)

Submission status: Runtime Error

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

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

li2 = list()

for i in li:
    if i % 10 != 0:
        i = (i // 10 + 1) * 10
    li2.append(i)

# li3 = [i for i in li if i % 10 != 0]

li4 = [int(str(i)[-1]) for i in li if i % 10 != 0]

# print(li3, li4)


print(sum(li2) - 10 + min(li4))

Submission status: Runtime Error

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

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

li2 = list()

for i in li:
    if i % 10 != 0:
        i = (i // 10 + 1) * 10
    li2.append(i)

# li3 = [i for i in li if i % 10 != 0]

li4 = [int(str(i)[-1]) for i in li if i % 10 != 0]

# print(li3, li4)


print(sum(li2) - min(li4))

Submission status: Runtime Error

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

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

li2 = list()

for i in li:
    if i % 10 != 0:
        i = (i // 10 + 1) * 10
    li2.append(i)

li3 = [int(str(i)[-1]) for i in li if i % 10 != 0]

print(sum(li2) - min(li3))

Submission status: Runtime Error

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


def orders(nums):
  r = [10 - (num % 10) for num in nums if (num % 10)]
  return sum(nums) + sum(r) - max(r)

print(orders(nums))

Submission status: Runtime Error

Solution code:
a = [int(input()) for _ in range(5)]
ans = 0
for i in a:
    ans += i if i%10 == 0 else i+(10-i%10)
    mod = max(mod,i%10) if i%10 == 0 else max(mod,10-i%10)
print(ans-mod)

Submission status: Runtime Error

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

NUM_DISHES = 5
tt = 0
itvs = list()

for i in range(NUM_DISHES):
    st = int(input())
    tt += st
    if st % 10 == 0:
        itvs.append(0)
    else:
        itvs.append(10 - serve_time % 10)

itvs.sort()

for interval in range(len(itvs) - 1):
    tt += itvs[interval]

print "{}".format(tt)

Submission status: Runtime Error

Solution code:
list = [int(input()) for n in range(5)]
min = 100
for i in range(5):
  if min > list[i] % 10 and list[i] % 10 != 0:
    min = list[i] % 10
    min_arg = i
ans = 0
for i in range(5):
  if i == min_arg:
    continue
  ans += list[i]
  if ans % 10 != 0:
    ans = ans - (ans % 10) + 10
ans += list[min_arg]
print(ans)

Submission status: Runtime Error

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

sample_list = []
sample_list.append(a)
sample_list.append(b)
sample_list.append(c)
sample_list.append(d)
sample_list.append(e)

x = []
for i in sample_list:
  if i%10 == 0:
    x.append(0)
  else:
    x.append(10-(i%10))

print(sum(sample_list)+sum(x)-max(x))

Submission status: Runtime Error

Solution code:
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())
sample_list = []
sample_list.append(a)
sample_list.append(b)
sample_list.append(c)
sample_list.append(d)
sample_list.append(e)
x = []
for i in sample_list:
  if i%10 == 0:
    x.append(0)
  else:
    x.append(10-(i%10))
print(sam(sample_list)+sam(x)-max(x))

Submission status: Runtime Error

Solution code:
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())
sample_list = []
sample_list.append(a)
sample_list.append(b)
sample_list.append(c)
sample_list.append(d)
sample_list.append(e)
x = []
for i in sample_list:
  if i%10 = 0:
    x.append(0)
  else:
    x.append(10-(i%10))
print(sam(sample_list)+sam(x)-max(x))

Submission status: Runtime Error

Solution code:
from math import ceil
a,b,c,d,e = map(int,input().split())

def f(S,v):
    if S:
        res = []
        for s in S:
            res += f(S - {s}, 10 * ceil(v / 10) + s)
        return res
    else:
        return [v]
ans = min(f({a,b,c,d,e},0))
print(ans)

Submission status: Runtime Error

Solution code:
import math
a=[input() for i in range(5)]
si=min([a[i][-1] for i in range(5)if a[i][-1]!='0'])
ans=[math.ceil(int(i)/10)*10 for i in a]
print(sum(ans)+int(si)-10)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import ceil 
L=[]
M=9
X=0
for i in range(5) :
  A=int(input())
  L.append(A)
  if A%10 < M%10 and A%10!=0 :
    M=A
L.remove(M)
for i in L :
  X+=ceil(i/10)*10
print(X+M)

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

list_1 = [A, B, C, D, E]
list_2 = [a, b, c, d, e]
list_2_2 = []
for x in list_2:
    if x != 0:
        list_2_2.append(x)

smallest = min(list_2_2)

list_3 = []

count = 0
for i in range(5):
    if list_2[i] == smallest and count % 10 == 0:
        list_3.append(list_1[i])
    elif list_2[i] != 0:
        list_3.append(list_1[i] - list_2[i] + 10)
    else:
        list_3.append(list_1[i])
    count += list_3[i]

sum = 0
for x in list_3:
    sum += x
    
print(sum)

Submission status: Runtime Error

Solution code:
#include <iostream>

using namespace std;

int main(){
	int time[5];
	int ans = 0;

	for ( int i = 0; i < 5; i++){
		cin >> time[i];
		ans += time[i];
		ans = (ans+9)/10*10
	}

	cout << ans << endl;
}

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
s = [a, b, c, d, e]
u = []
v = []
ans = 0

for i in range(len(s)):
    if s[i] % 10 == 0:
        ans += s[i]
    else:
        u.append(s[i])
        v.append(s[i] % 10)

k = min(v)
for j in range(len(u)):
    ans += u[j] + 10 - v[j]
    
ans = ans - 10 + k
print(ans)

Submission status: Runtime Error

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

for i in range(5):
    amari.append([time_list[i] // 10, time_list[i] % 10])
    
small = 9
for i in range(5):
    if amari[i][1] > 0 and amari[i][1] < small:
        small = amari[i][1]
        number = i
        
#print (amari)
total_time = 0
for i in range(5):
    if i != number:
        if amari[i][1] == 0:
            total_time += amari[i][0] * 10
        else:
            total_time += amari[i][0] * 10 + 10
    else:
        total_time += time_list[i]
        
print(total_time)
#print (amari)
# print(time_list)

Submission status: Runtime Error

Solution code:
a=[int(input()) for i in range(5)]
minn=0
for i in a:
  minn=min(minn,i%10)
  summ+=(i+9)//10
print(summ+minn)

Submission status: Runtime Error

Solution code:
a=[int(input()) for i in range(5)]
minn=0
for i in a:
  minn=min(minn,i%10)
  summ+=(int(i)+9)//10
print(summ+minn)

Submission status: Runtime Error

Solution code:
a=[int(input()) for i in range(5)]
minn=0
for i in a:
  minn=min(minn,int(i[-1]))
  summ+=(int(i)+9)//10
print(summ+minn)

Submission status: Runtime Error

Solution code:
def abc(n):
    if n % 10 == 0:
        return n
    else:
        return n + 10 - (n%10)

ans = 0
mods = []

for _ in range(5):
    tmp = int(input())
    ans += abc(tmp)
    if tmp%10 != 0:
        mods.append(tmp%10)

ans -= 10
ans += min(mods)
print(ans)

Submission status: Runtime Error

Solution code:
lists = []
lists2 = []
a = int(input())
if a %10 == 0:
    lists2.append(a)
else:
    lists.append(a)
n = int(input())
if n %10 == 0:
    lists2.append(n)
else:
    if lists != None:
        for i in range(len(lists)):
            if lists[i] % 10 <= n%10:
                lists.insert(i,n)
                break
            if len(lists)-1 == i:
                lists.append(n)
    else:
        lists.append(n)
n = int(input())
if n %10 == 0:
    lists2.append(n)
else:
    if lists != None:
        for i in range(len(lists)):
            if lists[i] % 10 <= n%10:
                lists.insert(i,n)
                break
            if len(lists)-1 == i:
                lists.append(n)
    else:
        lists.append(n)
n = int(input())
if n %10 == 0:
    lists2.append(n)
else:
    if lists != None:
        for i in range(len(lists)):
            if lists[i] % 10 <= n%10:
                lists.insert(i,n)
                break
            if len(lists)-1 == i:
                lists.append(n)
    else:
        lists.append(n)
n = int(input())
if n %10 == 0:
    lists2.append(n)
else:
    if lists != None:
        for i in range(len(lists)):
            if lists[i] % 10 <= n%10:
                lists.insert(i,n)
                break
            if len(lists)-1 == i:
                lists.append(n)
    else:
        lists.append(n)
time = 0
for t in lists2:
    time += t
for t in lists[0:len(lists)-1]:
    time += (10 - t%10) + t
time +=lists[-1]
print(time)

Submission status: Runtime Error

Solution code:
import math
dishes = [int(input()) for _ in range(5)]
lead_times = [int(math.ceil(t/10))*10 - t in dishes]
max_idx = lead_times.index(max(lead_times))
result = 0
for i in range(5):
  result += dishes[i]
  if i != max_idx:
    result += lead_times[i]
print(result)

Submission status: Runtime Error

Solution code:
list = [int(input()) for i in range(5)]
min = 9
ans = 0
zero_count = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0 and amari < min:
    min = amari
    num_min = i
  elif amari == 0:
    zero_count += 1
if zero_count == 5:
  num_min = 0
for i in range(5):
  if i != num_min:
    if list[i] % 10 == 0:
      ans += list[i]
    else:
      ans += (list[i] // 10 + 1) * 10
  elif i == num_min:
    ans += list[i]
print(ans)

Submission status: Runtime Error

Solution code:
list = [int(input()) for i in range(5)]
min = 9
ans = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0 and amari < min:
    min = amari
    num_min = i
for i in range(5):
  if i != num_min:
    if list[i] % 10 == 0:
      ans += list[i]
    else:
      ans += (list[i] // 10 + 1) * 10
  elif i == num_min:
    ans += list[i]
print(ans)

Submission status: Runtime Error

Solution code:
list = [int(input()) for i in range(5)]
min = 9
ans = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0:
    if amari < min:
      min = amari
      num_min = i
for i in range(5):
  if i != num_min:
    ans += int(round(list[i], -1))
  else:
    ans += list[i]
print(ans)

Submission status: Runtime Error

Solution code:
s=[int(input()) for _ in range(5)]
k=[s[i]%10 for i in range(5)]
l=[]
for i in range(5):
    if k[i] !=0:
        l.append(10-k[i])
    else:
        l.append(0)
p=max(k)
m=sum(s)
n=sum(l)
print(int(m+n-l))

Submission status: Runtime Error

Solution code:
s=[int(input()) for _ in range(5)]
k=[s[i]%10 for i in range(5)]
l=[]
for i in range(5):
    if k[i] !=0:
        l.append(10-k[i])
    else:
        l.append(0)
l=max(k)
m=sum(s)
n=sum(l)
print(int(m+n-l))

Submission status: Runtime Error

Solution code:
a = int(input(''))
b = int(input(''))
c = int(input(''))
d = int(input(''))
e = int(input(''))
list_i = [a,b,c,d,e]

list_m = map(lambda x : 10 - x % 10 ,list_i)
list_i = [x + y if x !=10 else y for (x,y) in zip(list_m,list_i)]
list_v = filter(lambda x : x != 10 , list_m)
print sum(list_i) - max(list(list_v))

Submission status: Runtime Error

Solution code:
a = int(input())
b= int(input())
c = int(input())
d = int(input())
e = int(input())
l = [] 
for i in [a,b,c,d,e]:
    if i % 10 != 0: 
        l.append(i//10*10+10-i)
print(sum([a,b,c,d,e])+sum(sorted(l):-1]))

Submission status: Runtime Error

Solution code:
a = int(input())
b= int(input())
c = int(input())
d = int(input())
e = int(input())
 
 
la = [a-a//10*10,b//10*10+b,c//10*10+c,d//10*10+d,e//10*10+e].sort()
print(sum([a,b,c,d,e])+sum(la[:-1]))

Submission status: Runtime Error

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


la = [a//10*10-a,b//10*10-b,c//10*10-c,d//10*10-d,e//10*10-e].sort()
print(sum([a,b,c,d,e])+sum(la[:-1]))

Submission status: Runtime Error

Solution code:
x = [int(input()) for _ in range(5)]
t = 0
for i in range(x):
  t = ((t + 9) // 10) * 10
  t += x[i]
print(t)

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]
list2=[a%10,b%10,c%10,d%10,e%10]
worst=10
worstnum=0
flag=0
count=0
for i in range(5):
  if list2[i] != 0:
    if list2[i] < worst:
      worst = list2[i]
      flag = i
      worstnum=list[i]
  list[i] += 10-list[i]%10
for i in range(5):
  if i = flag:
    count += worstnum
  else:
    count += list[i]
print(count)

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]
list2=[a%10,b%10,c%10,d%10,e%10]
worst=10
worstnum
flag=0
count=0
for i in range(5):
  if list2[i] != 0:
    if list2[i] < worst:
      worst = list2[i]
      flag = i
  list[i] += 10-list[i]%10
for i in range(5):
  if i = flag:
    count += worstnum
  else:
    count += list[i]
print(count)

Submission status: Runtime Error

Solution code:
l = [int(input) in i for range(5)]
l_0 = l % 10
ar = []
for n in l_0:
  if n != 0:
    ar.append(10-n)
  else:
    ar.append(0)
s = l_0.index(max(l_0))
ans = sum(l[l.index()!=s]) + sum(l_0[l_0.index()!=s]) + l[s]
print(ans)

Submission status: Runtime Error

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

mi = min(t % 10 for t in [a, b, c, d, e] if t % 10 != 0)
# print(mi)

# print([wt + (10 - (wt % 10)) if wt % 10 != 0 else wt for wt in [a, b, c, d, e]])
print(sum([wt + (10 - (wt % 10)) if wt % 10 != 0 else wt for wt in [a, b, c, d, e]]) - 10 + mi)

Submission status: Runtime Error

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

for i in range(0,5):
    for j in range(0,5):
        if b[i]<b[j]:
            m=b[i]
            b[i]=b[j]
            b[j]=m

for i in range(0,5):
    if b[i]!=0:
        k=i
        break
    else:
        continue

s=0
for i in range(0,5):
    if i==k:
        continue
    elif b[i]==0:
        s=s+a[i]
    else:
        s=s+a[i]+10-b[i]

s=s+a[k]
print(s)

Submission status: Runtime Error

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

for i in range(0,5):
    for j in range(0,5):
        if b[i]<b[j]:
            m=b[i]
            b[i]=b[j]
            b[j]=m

for i in range(0,5):
    if b[i]!=0:
        k=i
        break
    else:
        continue

s=0
for i in range(0,5):
    if i==k:
        continue
    else:
        s=s+a[i]+10-b[i]

s=s+a[k]
print(s)

Submission status: Runtime Error

Solution code:
a = [int(input) for i in range(5)]
m = 0
n = 0
for i in a:
  if i%10 != 0:
    t = 10 - i%10
  else:
    t = 0
  n += i + t
  m = max(m,t)
print(n-m)

Submission status: Runtime Error

Solution code:
a = [int(input()) for i in range(5)]
b = []
for i in range(5):
	x = a[i]%10
	if x != 0:
	    b.append(10 - x)
ans = 0
for u in a:
    ans += u // 10 * 10
ans += len(b) * 10
ans -= max(b)
print(ans)

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))
lr = list(map(lambda x: x%10, l))
lr = [e for e in lr if e != 0]
lr = lr.sorted
print(sum(l) + sum(list(map(lambda x: 10-x, lr[1:]))))

Submission status: Runtime Error

Solution code:
# B - Five Dishes
import math

price = []

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

kiriage = [10*(math.ceil(i/10)) for i in price]

amari = [i%10 for i in price]

while min(amari) == 0:
    amari.remove(0)
    
  

print(sum(kiriage)-10+ min(amari))

Submission status: Runtime Error

Solution code:
lst = []
for i in range(5):
  lst.append(int(input())
lst.sort(reverse=True, key = lambda x : (x - 1) % 10)
s = 0
for i in lst:
    s += i
    if i != lst[4]:
        s += 10 - s % 10

print(s)

Submission status: Runtime Error

Solution code:
lst = [int(x) for x in input().split()]
lst.sort(reverse=True, key = lambda x : (x - 1) % 10)
s = 0
for i in lst:
    s += i
    if i != lst[4]:
        s += 10 - s % 10

print(s)

Submission status: Runtime Error

Solution code:
ar = []
br = []
cr = []
mn = 10
for i in range(5):
    l = input()
    if int(l) % 10 == 0:
        ar.append(int(l))
    else:
        br.append(int(l))
        if mn > int(l) % 10:
            mn = int(l) % 10
for r in br:
    if str(r)[-1] == str(mn) and len(cr) == 0:
        cr.append(r)
    else:
        r += 10 - (r % 10)
        ar.append(r)
print(sum(ar) + cr[0])

Submission status: Runtime Error

Solution code:
A=list(int(input())for i in range(5))
com=0
num=-1
for i in range(5):
    if A[i]%10==0:
        continue
    else:
        rem=10-A[i]%10
    if com<rem:
        com=rem
        num=i
        tmp=A[i]
if len(A)!=0:
    A[num]=0
ans=0
for a in A:
    if a==0:
        continue
    if a%10==0:
        ans+=a
    else:
        ans+=(a//10+1)*10
ans+=tmp
print(ans)

Submission status: Runtime Error

Solution code:
A=list(int(input())for i in range(5))
com=0
for i in range(5):
    if A[i]%10==0:
        continue
    else:
        rem=10-A[i]%10
    if com<rem:
        com=rem
        num=i
        tmp=A[i]
A[num]=0
ans=0
for a in A:
    if a==0:
        continue
    if a%10==0:
        ans+=a
    else:
        ans+=(a//10+1)*10
ans+=tmp
print(ans)

Submission status: Runtime Error

Solution code:
A=list(int(input())for i in range(5))
com=0
for i in range(5):
    if A[i]%10==0:
        continue
    rem=10-A[i]%10
    if com<rem:
        com=rem
        num=i
        tmp=A[i]
A[num]=0
ans=0
for a in A:
    if a==0:
        continue
    if a%10==0:
        ans+=a
    else:
        ans+=(a//10+1)*10
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())

sample_list = list(a,b,c,d,e)
z= sum(sample_list)
for f in sample_list:
    g = list(10 - (a % 10))

h = max(g)
i = sum(g) - h

print(z-i)

Submission status: Runtime Error

Solution code:
t = [int(input()) for i in range(5)]
T = [(-(-i//10))*10 for i in t]
t_min = [i%10 for i in t]
t_min = min([i for i in t_min if i != 0])
print(sum(T) - 10 + t_min)

Submission status: Runtime Error

Solution code:
t = [int(input()) for i in range(5)]
T = [(-(-i//10))*10 for i in t]
t_min = [i%10 for i in t]
t_min = min([i for i in t_min if i != 0])
sum(T) - 10 + t_min

Submission status: Runtime Error

Solution code:
a, b, c, d, e = [int(input()) for i in range(5)]
list = [a, b, c, d, e]
nlist = [a%10, b%10, c%10, d%10, e%10]
nlist.remove('0')

#mod10で並べた数字のうち最小のものを削除
nlist.sort() 
nlist.remove(0)
mlist = map(10 - nlist)
Sum = sum(list) + sum(mlist)
print (Sum)

Submission status: Runtime Error

Solution code:
l = list(int(input()) for i in range(5))
A=[]
sum1=0
sum2=0

for i in range(5):
    if l[i]%10 == 0:
        A.append(0)
    else:
        A.append(10-(l[i]%10))
    
if A[0]==A[1]==A[2]==A[3]==A[4]==0:
    print(sum1 = l[0]+l[1]+l[2]+l[3]+l[4])
else:
    for k in range(5):
        sum2 += l[k]+A[k]
    print(sum2-max(A))

Submission status: Runtime Error

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

minnum = 1000

for i, con in enumerate(ipt):
    if con % 10 != 0:
        if minnum > con % 10:
            minnum = con % 10
            minidx = i

print(sum([int((con+9)/10)*10 if i != minidx and con%10 != 0 else con for i,con in enumerate(ipt)]))

Submission status: Runtime Error

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

total = 0
compare = 0
largest = 0

for x in food:
    if (10 - (x % 10) > compare) and ((x % 10) != 0):
        largest = x
        compare = 10 - (x % 10)

food.remove(largest)

for i in range(len(food)):
    if food[i] % 10 != 0:
        total += round(food[i] + 5.1, -1)
    else:
        total += food[i]

print(int(total+largest))

Submission status: Runtime Error

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

total = 0
compare = 0
largest = 0

for x in food:
    if (10 - (x % 10) > compare) and ((x % 10) != 0):
        largest = x
        compare = 10 - (x % 10)

food.remove(largest)
print(largest)

for i in range(len(food)):
    if food[i] % 10 != 0:
        total += round(food[i] + 5.1, -1)
    else:
        total += food[i]

print(int(total+largest))

Submission status: Runtime Error

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

total = 0
compare = 0
largest = 0

for x in food:
    if (10 - (x % 10) and (x % 10) != 0) > compare:
        largest = x
food.remove(largest)

for i in range(len(food)):
    if food[i] % 10 != 0:
        total += round(food[i] + 5.1, -1)
    else:
        total += food[i]
print(int(total+largest))

Submission status: Runtime Error

Solution code:
A = []
for i in range(5):
  A.append(input())
B = {}
x = 0
for i in A:
  B[i[-1]] = x
  x += 1

keys = []
for key, value in B.items():
    keys.append(int(key))

p1 = 0
if 0 in keys:
    keys.remove(0)
    p1 = min(keys)
else:
    p1 = min(keys)

we = A.pop(B[str(p1)])

cnt = 0
for i in A:
    if i[-1] != 0:
        C = 10 - int(i[-1])
        cnt += C+int(i)
    else:
        cnt += int(i)
 

print(cnt + int(we))

Submission status: Runtime Error

Solution code:
waitTime = []
_time = 0
for i in range(0,5):
    t, mod = divmod(int(input()), 10)
    _time += (t * 10)
    if mod != 0:
        waitTime.append(mod)
waitTime = sorted(waitTime, reverse= True)
_time += (len(waitTime) - 1) * 10
_time += min(waitTime)
print(_time)

Submission status: Runtime Error

Solution code:
A,B,C,D,E = [int(input()) for _ in range(5)]
a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10
if a == b == c == d == e == 0:
  print(A+B+C+D+E)
else:
  print(A-a+B-b+C-c+D-d+E-e-max(10-a,10-b,10-c,10-d,10-e)

Submission status: Runtime Error

Solution code:
A,B,C,D,E=int(input()),int(input()),int(input()),int(input()),int(input())
orders = {'A': A, 'B': B, 'C': C, 'D': D, 'E': E}
orders = sorted(orders.items(), key=lambda item: item[1] % 10, reverse=True)
res = 0
while orders:
  if res % 10 != 0:
    res += (10 - res % 10)
  order = orders.pop(0)
  res += order
print(res)

Submission status: Runtime Error

Solution code:
def main() -> None:
    num = [int(input()) for _ in range(5)]
    ans = 0
    m = []
    for i in num:
        if i % 10:
            ans += i + 10 - i % 10
            m.append(10 - i % 10)
        else:
            ans += i
    print(ans - max(m))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
order = [int(input()) for i in range(5)]
diff = (sorted(map(lambda x: (x % 10), order)))
diff = [i for i in diff if i != 0]

sum_order = sum(list(map(lambda x: -(-x //10), order)))
print ((sum_order * 10) - 10 + diff[0])

Submission status: Runtime Error

Solution code:
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
    if mod != 0:
        time += 10
        list2.append(mod)

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

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
    if mod != 0:
        time += 10
        list2.append(mod)

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