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: Wrong Answer

Solution code:
import math
 
s = 0
for i in range(5):
  a = int(input())
  if i != 4:
        a = int(math.ceil(a / 10) * 10)
  s += a
  
print(s)

Submission status: Wrong Answer

Solution code:
import math
 
s = 0
for i in range(5):
  a = int(input())
  if i != 4:
        a = int(math.ceil(a / 10) * 10)
  print(a)
  s += a
  
print(s)

Submission status: Wrong Answer

Solution code:
import math

s = 0
for i in range(5):
  a = int(input())
  s += int(math.floor(a / 10) * 10)
  
print(s)

Submission status: Wrong Answer

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

def res(x):
    res_x = 0 if x % 10 == 0 else 10 - x % 10
    return res_x

def gauss(x):
    return 10 * (x // 10 + 1)

ds = [a, b, c, d, e]
ds_sort = sorted(ds, key=lambda x: res(x))
ans = sum([gauss(e) for e in ds_sort[:-1]]) + ds_sort[-1]

print(ans)

Submission status: Wrong Answer

Solution code:

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

def res(x):
    return 10 - x % 10

def gauss(x):
    return 10 * (x // 10 + 1)

ds = [a, b, c, d, e]
ds_sort = sorted(ds, key=lambda x: res(x))
ans = sum([gauss(e) for e in ds_sort[:-1]]) + ds_sort[-1]

print(ans)

Submission status: Wrong Answer

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

def res(x):
    return 10 - x//10

def gauss(x):
    return 10 * (x//10 + 1)

ds = [a, b, c, d, e]
ds_sort = sorted(ds, key=lambda x: res(x))
ans = sum([gauss(e) for e in ds_sort[:-1]]) + ds_sort[-1]

print(ans)

Submission status: Wrong Answer

Solution code:
a=[int(input()) for i in range(5)]
m=a[0]%10
s=0
for i in range(1,5):
  if m > a[i]%10 and a[i]%10 != 0 or m == 0:
    m=a[i]%10
for i in range(5):
  if a[i]%10 == 0:
    s+=a[i]
  else:
    s+=a[i]-a[i]%10+10
s-=10-m
print(s)

Submission status: Wrong Answer

Solution code:
data = [int(input()) for i in range(5)]
a = 10
ans = 0
for i in range(5):
	d = data[i]%10
	if d!=0 and a>d:
		a = d
	ans += (data[i]+9)//10

ans = (ans-1)*10
print(ans+a if a!=10 else ans)

Submission status: Wrong Answer

Solution code:
data = [int(input()) for i in range(5)]
a = 9
ans = 0
for i in range(5):
	d = data[i]%10
	if d!=0 and a>d:
		a = d
	ans += (data[i]+9)//10
print((ans-1)*10+a)

Submission status: Wrong Answer

Solution code:
data = [int(input()) for i in range(5)]
a = 9
ans = 0
for i in range(5):
	if data[i]%10 != 0:
		a = min(a,data[i]%10)
	ans += (data[i]+9)//10
print((ans-1)*10+a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
arr = []
for i in range(5):
    arr.append(int(input()))
index = 0
rem_arr = []
for i in arr:
    time = i % 10
    if time == 0:
        time += 9
    rem_arr.append(time)
last_index = min(enumerate(rem_arr), key=lambda x: x[1])[0]
last = arr[last_index]
arr.pop(last_index)
total = 0
for i in arr:
    if i < 10:
        h = 10
    else:
        h = (i // 9) * 10
    total += h
total += last
print(total)

Submission status: Wrong Answer

Solution code:

arr = []
for i in range(5):
    arr.append(int(input()))
index = 0
rem_arr = []
for i in arr:
    time = i % 10
    if time == 0:
        time += 9
    rem_arr.append(time)
last_index = min(enumerate(rem_arr), key=lambda x: x[1])[0]
last = arr[last_index]
arr.pop(last_index)
total = 0
for i in arr:
    h = (i // 9) * 10
    total += h
total += last
print(total)

Submission status: Wrong Answer

Solution code:
A = [int(input()) for i in range(5)]
ma = max([10-a%10 for a in A])
A = [a if a%10 == 0 else a+10-a%10 for a in A]
print(sum(A)-ma)

Submission status: Wrong Answer

Solution code:
n =  [int(input()) for x in range(5)]
minNum = 10
array = 0
for i in range(len(n)):
    num = n[i] % 10
    print(num)
    if((num <= minNum) and (num != 0)):
        minNum = num
        array = i
        
numList = []
a = n[array]
n[array] = 0

for x in n:
    k = ((x + 9) // 10) * 10
    numList.append(k)
print(numList)    
print(sum(numList) + a)

Submission status: Wrong Answer

Solution code:
n =  [int(input()) for x in range(5)]
minNum = 10
array = 0
for i in range(len(n)):
    num = i % 10
    if(num <= minNum):
        minNum = num
        array = i
numList = []
a = n[array]
n[array] = 0
for x in n:
    k = ((x + 9) // 10) * 10
    numList.append(k)
    
print(sum(numList) + a)

Submission status: Wrong Answer

Solution code:
t=[0]*5
for i in range(5):
    t[i]=int(input())
ans=0
min=10
c=6
for i in range(5):
    if t[i]%10!=0 and t[i]%10<min:
        c=i
        min=t[i]
for i in range(5):
    if i==c:
        ans+=t[i]
    elif t[i]%10==0:
        ans+=t[i]
    else:
        ans+=t[i]-t[i]%10+10
print(ans)

Submission status: Wrong Answer

Solution code:
t=[0]*5
for i in range(5):
    t[i]=int(input())
ans=0
min=10
c=0
for i in range(5):
    if t[i]%10!=0 and t[i]%10<min:
        c=i
        min=t[i]
for i in range(5):
    if i==c:
        ans+=t[i]
    elif t[i]%10==0:
        ans+=t[i]
    else:
        ans+=t[i]-t[i]%10+10
print(ans)

Submission status: Wrong Answer

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
f = [a, b, c, d, e]
g = f.count(0)
a1 = A // 10
b1 = B // 10
c1 = C // 10
d1 = D // 10
e1 = E // 10
if g == 5:
    print((a1 + b1 + c1 + d1 + e1 + 4 - g) * 10)
else:
    f = [i for i in f if i > 0]
    print((a1 + b1 + c1 + d1 + e1 + 4 - g) * 10 + min(f))

Submission status: Wrong Answer

Solution code:
n = [int(x) for x in input().split()]
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: Wrong Answer

Solution code:
import math

a = []
for i in range(5):
    a.append(int(input()) / 10)
b = 0
for i in a[0:4]:
    b += math.ceil(i) * 10

b += a[4] * 10
print(int(b))

Submission status: Wrong Answer

Solution code:
import math

a = []
for i in range(5):
    a.append(int(input()) / 10)
b = 0
for i in a[0:4]:
    b += math.ceil(i) * 10

b += a[4] * 10
print(b)

Submission status: Wrong Answer

Solution code:
import math

a = []
for i in range(5):
    a.append(int(input()) / 10)
b = 0
for i in a[0:3]:
    b += math.ceil(i) * 10

b += a[4]
print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
t = [int(input()) for i in range(5)] 
a = np.zeros(5)

for i in range(5):
  a[i] = ( t[i] + 9 ) // 10 * 10 - t[i]

b = 0  
for j in range(1,5):
  if a[0] > a[j]:
    b = j

c = np.zeros(5)
for i in range(5):
  c[i] = ( t[i] + 9 ) // 10 * 10
    
ans = 0     
ans = np.sum(c) + t[b] - c[b]
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
t = [int(input()) for i in range(5)] 
a = np.zeros(5)

for i in range(5):
  a[i] = ( t[i] + 9 ) // 10 * 10 - t[i]

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

c = np.zeros(5)
for i in range(5):
  c[i] = ( t[i] + 9 ) // 10 * 10
    
ans = 0     
ans = np.sum(c) + t[b] - c[b]
print(ans)

Submission status: Wrong Answer

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

a = [x%10 for x in menu]


index = a.index(min(a))

max_food = menu.pop(index)

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

print(sum(menu)+max_food)

Submission status: Wrong Answer

Solution code:
n = []
for i in range(5):
    a = input()
    n.append(a)
m = 10-min(int(n[0][-1]),int(n[1][-1]),int(n[2][-1]),int(n[3][-1]),int(n[4][-1]))
a = []
for i in n:
    a.append(10 - int(i[-1]))
total = 0
for i in n:
    total += int(i)
print(sum(a) + total - m)

Submission status: Wrong Answer

Solution code:
s = [int(input()) for i in range(5)]
result = 0
last = 999999999
for i in range (len(s)):
    if s[i] % 10 <= last and s[i] % 10 != 0:
        last = s[i]

for i in range (len(s)):
    if s[i] % 10:
        result += s[i] + (10 - s[i] % 10)
    else:
        result += s[i]

if last % 10:
        result -= 10 - last % 10
        
print(result)

Submission status: Wrong Answer

Solution code:
s = [int(input()) for i in range(5)]
result = 0
last = 999999999
for i in range (len(s)):
    if s[i] % 10 <= last and s[i] % 10 != 0:
        last = s[i]

for i in range (len(s)):
    if s[i] % 10:
        result += s[i] + (10 - s[i] % 10)
    else:
        result += s[i]
        
print(result - (10 - last % 10))

Submission status: Wrong Answer

Solution code:
s = [int(input()) for i in range(5)]
result = 0
last = 999
for i in range (len(s)):
    if s[i] % 10 <= last and s[i] % 10 != 0:
        last = s[i]

for i in range (len(s)):
    result += s[i] + (10 - s[i] % 10)

print(result - (10 - last % 10))

Submission status: Wrong Answer

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]

if len(last_min) != 0:
    sum_time = sum_time + min(last_min) - 10
    print(sum_time)
else :
    sum_time = sum_time - 10
    print(sum_time)

Submission status: Wrong Answer

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

for j in range(5):
    dish_time[j] = dish_time[j]//10*10
    rest[j]= A[j]-dish_time[j]

print(dish_time)

sum_time =  0
rest.sort()

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

sum_time = sum_time + rest[0]

print(sum_time)

Submission status: Wrong Answer

Solution code:
input_mins = []
input_nums = 5
total_mins = []
total_min = 0

for i in range(input_nums):
  input_mins.append(input()[::-1])

input_mins.sort(reverse=True)

for i in range(input_nums):
  input_mins[i] = int(input_mins[i][::-1])

for i in range(input_nums-1):
    amari = input_mins[i] % 10
    if amari == 0:
      total_min += input_mins[i]
    else:
      total_min += input_mins[i]+(10-amari)

total_min += input_mins[-1]

print(total_min)

Submission status: Wrong Answer

Solution code:
import math

input_mins = []
input_nums = 5
total_mins = 0

for i in range(input_nums):
  input_min = input()
  input_mins.append(input_min[::-1])
  input_mins.sort(reverse=True)

for i in range(input_nums):
  input_mins[i] = int(input_mins[i][::-1])

for i in range(input_nums-1):
  amari = input_mins[i] % 10
  if amari == 0:
    total_mins += input_mins[i]
  else:
    total_mins += input_mins[i]+(10-amari)

total_mins += input_mins[-1]
print(total_mins)

Submission status: Wrong Answer

Solution code:
import math

input_mins = []
input_nums = 5
total_mins = 0

for i in range(input_nums):
  input_min = input()
  input_mins.append(input_min[::-1])
  input_mins.sort(reverse=True)

for i in range(input_nums):
  input_mins[i] = int(input_mins[i][::-1])

for i in range(input_nums-1):
  amari = input_mins[i] % 10
  total_mins += input_mins[i]+(10-amari)

total_mins += input_mins[-1]
print(total_mins)

Submission status: Wrong Answer

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

sum_time = 0
last_order_surplus = 10

for dish in dishes:
  if last_order_surplus > int(dish) % 10 & int(dish) % 10 != 0:
    last_order_surplus = int(dish) % 10
  if int(dish) % 10 != 0:
    sum_time += int(int(dish) / 10 + 1)
  else:
    sum_time = int(int(dish) / 10)

print (sum_time * 10 + last_order_surplus - 10)

Submission status: Wrong Answer

Solution code:
li=[]

for i in range(5):
    li.append(str(input()))

min=10
f=1
for i in li:
    temp=int(i[-1])
    #print('-1',temp)
    if temp!=0:
        f=0
    if min > temp and temp!=0:
        min=temp
    if f:
        min=0


sum=0
for i in li:
    #print(i[-1])
    if i[-1]!='0':
        temp=int(i[0:-1]+"0")+10
    else:
        temp=int(i)
    #print("temp", temp)
    sum+=temp

sum-=(10-min)

print(sum)

Submission status: Wrong Answer

Solution code:
li=[]

for i in range(5):
    li.append(str(input()))

min=9
for i in li:
    temp=int(i[-1])
    #print('-1',temp)
    if min > temp and temp!=0:
        min=temp

sum=0
for i in li:
    #print(i[-1])
    if i[-1]!='0':
        temp=int(i[0:-1]+"0")+10
    else:
        temp=int(i)
    #print("temp", temp)
    sum+=temp

sum-=(10-min)

print(sum)

Submission status: Wrong Answer

Solution code:
list = [int(input()) for n in range(5)]
min = 100
for i in range(5):
  if min > list[i] % 10:
    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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from functools import reduce
def dishes(a,b,c,d,e):
    s = [a,b,c,d,e]
    k = list(map(lambda x:(int(x/10)+1)*10 if x%10 != 0 else (int(x/10))*10,s))
    x = [k[i] - s[i] for i in range(len(s))]
    i = x.index(max(x))
    k.remove(k[i])
    k.append(s[i])
    ans = reduce(lambda x,y:x + y,s)
    return ans

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(dishes(a,b,c,d,e))

Submission status: Wrong Answer

Solution code:
from functools import reduce
def dishes(a,b,c,d,e):
    s = [a,b,c,d,e]
    k = list(map(lambda x:(int(x/10)+1)*10 if x%10 != 0 else (int(x/10))*10,s))
    x = [k[i] - s[i] for i in range(len(s))]
    i = x.index(max(x))
    s.remove(s[i])
    s.append(k[i])
    ans = reduce(lambda x,y:x + y,s)
    return ans-1

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(dishes(a,b,c,d,e))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = 0
g = 0
h = 0
i = 0
j = 0
for k in range(9):
    if (a + f) % 10 != 0:
        f += 1
    if (b + g) % 10 != 0:
        g += 1
    if (c + h) % 10 != 0:
        h += 1
    if (d + i) % 10 != 0:
        i += 1
    if (e + j) % 10 != 0:
        j += 1
print(a+b+c+d+e+f+g+h+i+j-max(f,g,h,i,j))
print(f,g,h,i,j)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
a_1=(a//10)*10
b_1=(b//10)*10
c_1=(c//10)*10
d_1=(d//10)*10
e_1=(e//10)*10
a_2=a%10
b_2=b%10
c_2=c%10
d_2=d%10
e_2=e%10
if a_2==0 and b_2==0 and c_2==0 and d_2==0 and e_2==0:
  a_2+=0
elif a_2==0:
  a_2+=10
elif b_2==0:
  b_2+=10
elif c_2==0:
  c_2+=10
elif d_2==0:
  d_2+=10
elif e_2==0:
  e_2+=10
else:
  a_2+=0
l=[a_2, b_2, c_2, d_2, e_2]
l.sort()
print(a_1+b_1+c_1+d_1+e_1+l[0]+40)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
a_1=(a//10)*10
b_1=(b//10)*10
c_1=(c//10)*10
d_1=(d//10)*10
e_1=(e//10)*10
a_2=a%10
if a_2==0:
  a_2+=10
b_2=b%10
if b_2==0:
  b_2+=10
c_2=c%10
if c_2==0:
  c_2+=10
d_2=d%10
if d_2==0:
  d_2+=10
e_2=e%10
if e_2==0:
  e_2+=10
l=[a_2, b_2, c_2, d_2, e_2]
l.sort()
print(a_1+b_1+c_1+d_1+e_1+l[0]+40)

Submission status: Wrong Answer

Solution code:
L = [int(input()) for i in range(5)]
longmenuindex=0
for i in range(len(L)):
    if(L[i]%10<L[longmenuindex]%10 and L[i]%10!=0):
        longmenuindex = i
time=0
for i in range(len(L)):
    if(i != longmenuindex):
        time += (L[i]+(10-L[i]%10))
print(time+L[longmenuindex])

Submission status: Wrong Answer

Solution code:
L = [int(input()) for i in range(5)]
longmenuindex=0
for i in range(len(L)):
    if(L[i]%10<L[longmenuindex]%10 and L[i]%10!=0):
        longmenuindex = i
time=0
for i in range(len(L)):
    if(i != longmenuindex):
        time += round(L[i], -1)
print(time+L[longmenuindex])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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)
    mods.append(tmp%10)

if not set(mods) == {0}:
    ans -= 10
    ans += min(mods)

print(ans)

Submission status: Wrong Answer

Solution code:
atoe =[int(input()),int(input()),int(input()),int(input()),int(input())]

maxNum = 5
wrap = 0
atoe = sorted(atoe, key=lambda x: -10 if x%10==0 else -(x%10))
for i in range(0, maxNum-1):
    if atoe[i] % 10 == 0:
        step = atoe[i]
    else:
        step = (atoe[i] // 10 + 1) * 10
    print(atoe[i], step)
    wrap += step

wrap += atoe[maxNum-1]
print(wrap)

Submission status: Wrong Answer

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

sum = 0
rest = 10

for i in a:
	if i % 10 < rest:
		sum = ((sum - 1) // 10 + 1) * 10 if sum != 0 else 0
		sum += i
	else:
		sum += ((i - 1) // 10 + 1) * 10
		
print(sum)

Submission status: Wrong Answer

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

#注文してから料理が届くまでの時間
Time = []
for i in range(5):
    a = int(input())
    Time.append(a)

#注文してから次の注文が出来るまでの時間
nextTime = list(map(lambda x: (x+9)//10*10, Time))

#bestに最短時間を代入
best = 10**5
sum = 0
for i in range(5):
    for j in range(5):
        if i == j:
            sum = sum + Time[j] 
        else:
            sum = sum + nextTime[j]
    print(sum)
    best = min(best, sum)
    sum = 0

print(best)

Submission status: Wrong Answer

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

#注文してから料理が届くまでの時間
Time = []
for i in range(5):
    a = int(input())
    Time.append(a)

#注文してから次の注文が出来るまでの時間
nextTime = list(map(lambda x: (x+9)//10*10, Time))

#bestに最短時間を代入
best = 10**5
sum = 0
for i in range(5):
    for j in range(5):
        if i == j:
            sum = sum + Time[j] 
        else:
            sum = sum + nextTime[j]
    
    best = min(best, sum)

print(best)

Submission status: Wrong Answer

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-p))

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
a = int(0.1*(9+A))
b = int(0.1*(9+B))
c = int(0.1*(9+C))
d = int(0.1*(9+D))
e = int(0.1*(9+E))
t_1 = 10*(a+b+c+d) + E
t_2 = 10*(b+c+d+e) + A
t_3 = 10*(c+d+e+a) + B
t_4 = 10*(d+e+a+b) + C
t_5 = 10*(e+a+b+c) + D
#print(min([t_1,t_2,t_3,t_4,t_5]))
print(t_1,t_2,t_3,t_4,t_5)

Submission status: Wrong Answer

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(k)
print(int(m+n-l))

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
a = int(0.1*(5+A))
b = int(0.1*(5+B))
c = int(0.1*(5+C))
d = int(0.1*(5+D))
e = int(0.1*(5+E))
t_1 = 10*(a+b+c+d) + E
t_2 = 10*(b+c+d+e) + A
t_3 = 10*(c+d+e+a) + B
t_4 = 10*(d+e+a+b) + C
t_5 = 10*(e+a+b+a) + D
print(min([t_1,t_2,t_3,t_4,t_5]))

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
a = int(0.1*A)
b = int(0.1*B)
c = int(0.1*C)
d = int(0.1*D)
e = int(0.1*E)
t_1 = 10*(a+b+c+d) + E
t_2 = 10*(b+c+d+e) + A
t_3 = 10*(c+d+e+a) + B
t_4 = 10*(d+e+a+b) + C
t_5 = 10*(e+a+b+a) + D
print(min([t_1,t_2,t_3,t_4,t_5]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

times = sorted([A,B,C,D,E],key=lambda x: x % 10)

res = 0

tmp = 0
for t in times:
    res += math.ceil(t / 10) * 10

for t in times:
    if t % 10 != 0:
        res += t % 10
        break


print(res - 10)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
list=[a,b,c,d,e]
worst=10
flag=0
ans=0
for i in range(5):
  if list[i]%10 != 0:
    if list[i]%10 < worst:
      worst = list[i]%10
      flag=i
for i in range(5):
  if i == flag:
    ans += list[i]
  else:
    ans += (list[i] + 10-list[i]%10)
print(ans)

Submission status: Wrong Answer

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])



# print(mi)

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

if mi > 0:
    w = w - 10 + mi
print(w)

Submission status: Wrong Answer

Solution code:
def Find_maxindex(l):
    size = len(l)
    maxindex = -1
    maximum = 0
    
    for i in range(size):
        if l[i] > maximum:
            maximum = l[i]
            maxindex = i
    
    return maxindex

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

remainder = []
for i in range(5):
    remainder.append(cookingTime[i] % 10)

for i in range(5):
    if remainder[i] != 0:
        remainder[i] = 10 - remainder[i]
        
cookingTime_added = []
for i in range(5):
    cookingTime_added.append(cookingTime[i] + remainder[i])

remainder_maxindex = Find_maxindex(remainder)

time = 0
for i in range(5):
    if i != remainder_maxindex:
        time += cookingTime_added[i]

time += cookingTime[remainder_maxindex]

print(time)

Submission status: Wrong Answer

Solution code:
menu_time=[]
total_time = 0
last_time = 9
for i in range(0,5):
    a = int(input())
    menu_time.append(a)
for i in range(0,5):
    if menu_time[i]%10==0:
        total_time+=menu_time[i]
    else:
        total_time+=(menu_time[i]//10+1)*10
for i in range(0,5):
    if menu_time[i]%10!=0 and menu_time[i]%10<last_time:
        last_time = menu_time[i]%10
    else:
        dum=0
total_time+=last_time-10
print(total_time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = [int(input()) for i in range(5)]
j = []
for i in A:
  c = 0
  while i >= c:
    c += 10
  j.append(c-i)
ind = [j.index(i) for i in sorted(j)]
time = A[ind[-1]]
d = 0
for i in sorted(j):
  if d==4: break
  c = 0
  while A[j.index(i)] >= 10:
    c += 10
  time += c
  d += 1
print(time)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
  A=int(a//10)
  a=9
else:
  A=int(a//10+1)
if b%10==0:
  B=b//10
  b=9
else:
  B=b//10+1
if c%10==0:
  C=c//10
  c=9
else:
  C=c//10+1
if d%10==0:
  D=d/10
  d=9
else:
  D=d/10+1
if e%10==0:
  E=e//10
  e=9
else:
  E=e//10+1
ans=int(A+B+C+D+E-1)*10+min(a%10,b%10,c%10,d%10,e%10)
print(int(ans))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
  A=int(a//10)
else:
  A=int(a//10+1)
if b%10==0:
  B=b//10
else:
  B=b//10+1
if c%10==0:
  C=c//10
else:
  C=c//10+1
if d%10==0:
  D=d/10
else:
  D=d/10+1
if e%10==0:
  E=e//10
else:
  E=e//10+1
ans=int(A+B+C+D+E-1)*10+min(a%10,b%10,c%10,d%10,e%10)
print(int(ans))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
  A=a//10
else:
  A=a//10+1
if b%10==0:
  B=b//10
else:
  B=b//10+1
if c%10==0:
  C=c//10
else:
  C=c//10+1
if d%10==0:
  D=d/10
else:
  D=d/10+1
if e%10==0:
  E=e//10
else:
  E=e//10+1
ans=int(A+B+C+D+E-1)*10+max(a%10,b%10,c%10,d%10,e%10)
print(int(ans))

Submission status: Wrong Answer

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.sort()
print(sum(l) + sum(list(map(lambda x: 10-x, lr[1:]))))

Submission status: Wrong Answer

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]
print(sum(l) + sum(list(map(lambda x: 10-x, lr[1:]))))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
  A=a//10
else:
  A=a//10+1
if b%10==0:
  B=b//10
else:
  B=b//10+1
if c%10==0:
  C=c//10
else:
  C=c//10+1
if d%10==0:
  D=d/10
else:
  D=d/10+1
if e%10==0:
  E=e//10
else:
  E=e//10+1
ans=(A+B+C+D+E-1)*10+min([a%10,b%10,c%10,d%10,e%10])
print(int(ans))

Submission status: Wrong Answer

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]
sum(l) + sum(list(map(lambda x: 10-x, lr[1:])))

Submission status: Wrong Answer

Solution code:
p=[]
ans=0
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))

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

b=9
for i in p:
    if i%10 != 0:
        b = min(b,i%10)

print(ans - (10-b))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
ans=(a/10+b/10+c/10+d/10+e/10+4)*10+min([a%10,b%10,c%10,d%10,e%10])
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
ans=(a/10+b/10+c/10+d/10+e/10+4)*10+min([a%10,b%10,c%10,d%10,e%10])
print(ans)

Submission status: Wrong Answer

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

f = (a/10 + b/10 + c/10 + d/10 + e/10) * 10

g = a % 10

if(b % 10 < g):
  g = b % 10
  
if(c % 10 < g):
  g = c % 10
  
if(d % 10 < g):
  g = d % 10
  
if(e % 10 < g):
  g = e % 10

print(str(f + g))

Submission status: Wrong Answer

Solution code:
import math

one = [10]
total = 0
for i in range(5):
    time = input()
    if time[-1] != "0":
        one.append(int(time[-1]))
    time = int(time)
    time = math.ceil(time / 10) * 10
    print(time)
    total += time
total += min(one) - 10
print(int(total))