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:
a = [[0, int(input())] for i in range(5)]

for i in range(5):
    a[i][0] = a[i][1] % 10
    if a[i][0] == 0:
        a[i][0] = 10
        a[i][1] -= 10

a.sort(reverse=True)

ans = 0
for i in range(4):
    if a[i][0] == 10:
        ans += a[i][1] + 10
    else:
        ans += a[i][1] + (10 - a[i][0])

ans += a[4][1]

print(ans)

Submission status: Wrong Answer

Solution code:
L=[]
L2=[]
for i in range(5):
    I=int(input())
    L.append(I)
    L2.append(I%10)

result=0
for i in L:
    result+=i
    if result%10==0:
        continue
    for j in range(10):
        result+=1
        if result%10==0:
            break

if max(L2)==0:
    print(0)
else:
    if min(L2)==0:
        for t in sorted(L2):
            if t==0:
                pass
            else:
                mn=t
                break
    else:
        mn=min(L2)

    print(result-(10-mn))

Submission status: Wrong Answer

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

n=10
decision = 0
amari = [A%10,B%10,C%10,D%10,E%10]
for i in range(5):
    if (n>amari[i])and(amari[i]>0):
        n=amari[i]
        decision=i


output = 10*int((A-0.5)//10)+10*int((B-0.5)//10)+10*int((C-0.5)//10)+10*int((D-0.5)//10)+10*int((E-0.5)//10) + 40 + amari[decision]

print(int(output))

Submission status: Wrong Answer

Solution code:
from functools import reduce

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]
    S = []
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    ans = 0
    min = S[0]
    min_i = 0
    sum = 0
    for i in range(len(S)):
        if min%10 > S[i]%10 and S[i]%10 != 0:
            min = S[i]%10
            min_i = i
    for i in range(len(S)):
        if i != min_i:
            sum += round(S[i]+4,-1)
        else:
            sum += S[i]
    print(sum)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

sum_num = 0

delta = 10

for num in a:
    if num % 10 != 0 and num % 10 < delta:
        delta = num % 10
    sum_num += math.ceil(num / 10) * 10

    print(sum_num)

print(sum_num - 10 + delta)

Submission status: Wrong Answer

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

for i in range(5):
    a[i][0] = a[i][1] % 10
    if a[i][0] == 0:
        a[i][0] = 10
        a[i][1] -= 10

a.sort(reverse=True)

ans = 0
for i in range(4):
    if a[i][0] == 10:
        ans += a[i][1] + 10
    else:
        ans += a[i][1] + (10 - a[i][0])

    print(ans)

ans += a[4][1]

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d,e=[int(input()) for i in range(5)]
a1=a%10
b1=b%10
c1=c%10
d1=d%10
e1=e%10
A=[a1,b1,c1,d1,e1]
cnt=(a//10 + b//10+c//10+d//10+e//10)*10+40+min(A)
print(cnt)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
l=[a,b,c,d,e]
lastindex=0
tenmod=[a%10,b%10,c%10,d%10,e%10]
lastamari=min(tenmod)
lastban=tenmod.index(lastamari)
alltime=0
for i in range(5):
  if i==lastban:
    alltime+=l[i]
  elif i!=lastban:
    alltime+=int(l[i]/10)*10+10
print(alltime)

Submission status: Wrong Answer

Solution code:
A=[]

for i in range(5):
    x = int(input())
    y = x % 10
    A.append((y,x))

A = sorted(A)
sum = 0
for i in range(len(A)):
    y,x = A[len(A)-1-i]
    if i == len(A)-1:
        sum += x
    else:
        sum += x + (10-y)

print(sum)

Submission status: Wrong Answer

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

res_ = min([x%10 if x%10!=0 else 10 for x in [a,b,c,d,e]])
if res_ == 10:
  res_ = 0
sum_ = sum([10*(1+x//10) if (x%10!=0) else x for x in [a,b,c,d,e]])

print(sum_ + res_ - 10)

Submission status: Wrong Answer

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

a = 0
for i, d in enumerate(data):
    a = max(10 - d % 10, a)
    data[i] = d + (10 - d % 10)
    
print(sum(data) - a)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
ans = 0
List = [a,b,c,d,e]
wait = []
for i in List:
    tmp = 10-i%10
    if tmp ==10:
        tmp = 0
    wait.append(tmp)
print(wait)
for i in range(5):
    ans += List[i]+wait[i]
print(ans-max(wait))

Submission status: Wrong Answer

Solution code:
a = []
for i in range(5):
    a.append(input())
minn = 9
sumtime = 0
for i in range(5):
	if(minn > a[i]%10 & a[i]%10 > 0):
		minn = a[i]%10
	if(a[i]%10 == 0):
		sumtime += a[i]
	else:
		a[i] = a[i] + 10 - a[i]%10
		sumtime += a[i]
if(minn == 0):
	print(sumtime)
else:
	print(sumtime - 10 + minn)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
s = a+b+c+d+e
l = []
l.append((10-a%10)%10)
l.append((10-b%10)%10)
l.append((10-c%10)%10)
l.append((10-d%10)%10)
l.append((10-e%10)%10)
l.sort()
print(l)
print(s)
print(s+sum(l[:-1]))

Submission status: Wrong Answer

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

ans=0
s=a[0]%10
for i in range(1,5):
  if s>a[i]%10 and a[i]%10!=0:
    s=a[i]%10

for i in range(5):
  if a[i]%10 == 0:
    ans+=a[i]
  else:
    ans+= a[i]+(10-a[i]%10)

print(ans-10+s)

Submission status: Wrong Answer

Solution code:
A = [int(input()) for i in range(5)]
min_1 = 10
sum_v = -10

for num in A:
    dig1 = num % 10
    if dig1:
        min_1 = min(min_1, dig1)

    if dig1:
        sum_v += (num // 10) * 10 + 10
    else:
        sum_v += num

if min_1 != 10:
    print(sum_v + min_1)
else:
    print(sum_v + min_1 + 10)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
cook_time = [A,B,C,D,E]
muda = [10-i%10 for i in cook_time]
cook_time_muda = list(zip(cook_time,muda))
cook_time_muda.sort(key=lambda x:x[1])
time = 0
for i in cook_time_muda:
    time = time + i[0]+i[1]
time = time - i[1]
print(time)

Submission status: Wrong Answer

Solution code:
ans = 0
a = []
for _ in range(5):
    x = int(input())
    if x%10 == 0:
        ans += x
    else:
        ans += (x//10)*10
        a.append(x%10)

if a == []:
    print(ans)
    exit()
elif len(a) == 1:
    ans += a[0]
    print(ans)
    exit()
ans += (len(a)-1)*10
ans += min(a)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
tmp = 9
last = 0
for i in [A, B, C, D, E]:
    if i % 10 == 0:
        continue
    else:
        if i % 10 < tmp:
            tmp = i % 10
            last = i

ans = 0
for i in [A, B, C, D, E]:
    if i % 10 == 0:
        ans += i
    else:
        ans += i + (10-i%10)

print(ans-(10-last%10) if last != 0 else ans)

Submission status: Wrong Answer

Solution code:
A=[]

for i in range(5):
    x = int(input())
    y = x % 10
    A.append((x,y))

A = sorted(A)
sum = 0
for i in range(len(A)):
    x,y = A[len(A)-1-i]
    if i == len(A)-1:
        sum += x
    else:
        sum += x + (10-y)

print(sum)

Submission status: Wrong Answer

Solution code:
import math

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
a_div=math.floor(a/10)
a_res = a%10
if a_res == 0:
    a_res=10

b_div=math.floor(b/10)
b_res = b%10
if b_res == 0:
    b_res=10

c_div=math.floor(c/10)
c_res = c%10
if c_res == 0:
    c_res=10

d_div=math.floor(d/10)
d_res = d%10
if d_res == 0:
    d_res=10

e_div=math.floor(e/10)
e_res = e%10
if e_res == 0:
    e_res=10

#print(a_div)
print(int(10*(a_div+b_div+c_div+d_div+e_div+4)+min(a_res,b_res,c_res,d_res,e_res)))

Submission status: Wrong Answer

Solution code:
import math

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

about = [math.ceil(a/10)*10,math.ceil(b/10)*10,math.ceil(c/10)*10,math.ceil(d/10)*10,math.ceil(e/10)*10]
one = [a%10,b%10,c%10,d%10,e%10]
one.sort()
count = 0
for i in one:
    if i != 0:
        count = i
        break
print(sum(about)+count-10)

Submission status: Wrong Answer

Solution code:
time = []
mod_5 = []

for i in range(5):
    t = int(input())
    time.append(t)
    mod_5.append(t % 5)

flag = False
min_mod = min(mod_5)

for i in range(5):
    if mod_5[i] == min_mod and not flag:
        flag = True
    else:
        time[i] = ((time[i] + 4) // 5) * 5

print(sum(time))

Submission status: Wrong Answer

Solution code:
A = [input() for i in range(5)]
A.sort(key = lambda x:x[-1])
A = [int(a) for a in A]
res = 0
for a in A:
	if a%10 == 0:
		res += a
	else:
		while a%10 != 0:
			a += 1
		res += a 
for a in A:
	b = str(a)
	if b[-1] != '0':
		res -= 10-int(b[-1])
		print(res)
		exit()

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


T = read_col(5, 1)[0]

# 10に丸め込んで、一番最後に小さい値を求めれば良い

ans = 0

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


tmp = [x % 10 for x in T if x % 10 != 0]

if tmp == []:
    pass
else:
    ans += min(tmp)

print(ans)

Submission status: Wrong Answer

Solution code:
import math
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
raws = [A, B, C, D, E]
residues = [A % 10, B % 10, C % 10, D % 10, E % 10]
ans = 0
lastDish = residues.index(min(residues))
for i in range(len(raws)):
    if i != lastDish:
        ans += math.ceil(raws[i] / 10) * 10
    else:
        ans += raws[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
li = [A, B, C, D, E]
temp = 9
idx = -1
for i in range(len(li)):
    if 0 != li[i] % 10 and temp > li[i] % 10:
        temp = li[i] % 10
        idx = i

result = 0
for i in range(len(li)):
    if idx == i:
        result += li[i]
    else:
        result += math.ceil(li[i] / 10) * 10
print(result)

Submission status: Wrong Answer

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

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

last = 9
time = 0

for item in array:
	r = item%10
	if r != 0:
		time += (int(item/10)+1)*10
		last = min(last, r)
	else:
		time += item

print(time-10+last)

Submission status: Wrong Answer

Solution code:
a = []
b = []
for i in range(5):
    n = int(input())
    b.append(n % 10)
    while n % 10 != 0:
        n = n + 1
    a.append(n)

if min(b) == 0:
    print(a[0] + a[1] + a[2] + a[3] + a[4])
else:
    print(a[0] + a[1] + a[2] + a[3] + a[4] - 10 + min(b))

Submission status: Wrong Answer

Solution code:
from math import ceil as c;a=[int(input())for i in range(5)];sum([c(i/10)for i in a])*10-max([c(i/10)*10-i for i in a])

Submission status: Wrong Answer

Solution code:
A=[]

for i in range(5):
    x = int(input())
    y = x % 10
    A.append((x,y))

A = sorted(A)
sum = 0
for i in range(len(A)):
    x,y = A[len(A)-1-i]
    if i == len(A)-1:
        sum += x
    else:
        sum = x + (10-y)

print(sum)

Submission status: Wrong Answer

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

import math


order = []

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

sorted_order = sorted(order, key=lambda x: (x - 1) % 10, reverse=True)

print(sorted_order)

t = 0
for i, n in enumerate(sorted_order):
    if i == len(sorted_order) - 1:
        t += n
    else:
        t += math.ceil(n / 10) * 10

print(int(t))

Submission status: Wrong Answer

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

ans = a[0]
for i in a[1:]:
  ans += i if i%10==0 else i+10-i%10

print(ans)

Submission status: Wrong Answer

Solution code:
dish = []
for i in range(5):
    dish.append(int(input()))
ichi = 0
for i in range(1,5):
    if dish[i]%10 > 0 and dish[ichi] % 10 > dish[i] % 10:
        ichi = i
print(str(ichi))
for i in range(5):
    if i != ichi and dish[i]%10 > 0:
        dish[i] += 10 - dish[i]%10
print(sum(dish))

Submission status: Wrong Answer

Solution code:
min_ = 9
ans = 0

for _ in range(5):
    t = int(input())
    a = t // 10
    b = t % 10
    if b == 0:
        ans += a * 10
    else:
        ans += (a + 1) * 10
        min_ = min(min_, b)

print(ans - 10 + min_)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
s = a+b+c+d+e
l = []
l.append(10- a%10)
l.append(10-b%10)
l.append(10-c%10)
l.append(10-d%10)
l.append(10-e%10)
l.sort()
print(s+sum(l[:-1]))

Submission status: Wrong Answer

Solution code:
a = [0]*5
a_one = [0]*5
a_ten = [0]*5
for i in range(5):
    a[i] = int(input())
    a_one[i] = a[i]%10
    a_ten[i] = abs(10-a_one[i])
min_one_index = a_one.index(min(a_one))
ans = 0
for i in range(5):
    if i != min_one_index:
        ans += a[i]+a_ten[i]
    else :
        ans += a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


T = read_col(5, 1)[0]

# 10に丸め込んで、一番最後に小さい値を求めれば良い

print(T)
ans = 0

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

    print(ans)


tmp = [x % 10 for x in T if x % 10 != 0]

if tmp == []:
    pass
else:
    ans += min(tmp)

print(ans)

Submission status: Wrong Answer

Solution code:
s=[int(input()) for i in range(5)]
a=0
b=10
for i in s:
    for j in range(0,130,10):
        if j>=i:
            a+=j
            break
    if i%10>0:
        b=min(b,i%10)

if b==10:
    print(a)
else:
    print(a-10+b)

Submission status: Wrong Answer

Solution code:
a=[0]*5
index=0
index_0=0
count=9
sum=0
for i in range(5):
    a[i]=int(input())
    if a[i]%10==0:
        index_0+=1
    else:
        count=min(a[i]%10,count)
    sum+=a[i]//10
print(sum*10+count+(4-index_0)*10)

Submission status: Wrong Answer

Solution code:
a = []
b = []
for i in range(5):
    n = int(input())
    b.append(n % 10)
    while n % 10 != 0:
        n = n + 1
    a.append(n)

if max(b) == 0:
    print(a[0] + a[1] + a[2] + a[3] + a[4])
else:
    print(a[0] + a[1] + a[2] + a[3] + a[4] - 10 + min(b))

Submission status: Wrong Answer

Solution code:
A=[]

for i in range(5):
    x = int(input())
    y = x % 10
    A.append((x,y))

A = sorted(A)
sum = 0
for i in range(len(A)):
    x,y = A[len(A)-1-i]
    if i == len(A)-1:
        sum += y
    else:
        sum = y + (10-x)

print(sum)

Submission status: Wrong Answer

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

a = []

for i in range(5):
    a.append(int(dish[i][-1]))

r = []

for i in range(5):
    r.append(int(dish[i]))

for i in range(5):
    if i != a.index(min(a)):
    
        r[i] += 10 - a[i]

print(sum(r))

Submission status: Wrong Answer

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

b = sorted([i % 10 for i in a])

ans = sum(a)

for i in range(4):
    ans += (10 - b[i + 1])

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
	r = [0]*5
	r[0] = int(input())
	r[1] = int(input())
	r[2] = int(input())
	r[3] = int(input())
	r[4] = int(input())

	total = 0
	mod_min = 10

	for x in r:
		div = x//10
		total += div*10
		mod = x%10
		if mod != 0:
			if mod < mod_min:
				mod_min = mod
			total+=10
		total = total - 10 + mod_min
	print(total)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

sum = 0
edge = 10

for ele in lst:
    if ele % 10 == 0:
        # do something
        sum += ele
    else:
        sum += ((ele - 1) // 10 + 1) * 10
        edge = min(edge, ele % 10)
print(sum + edge % 10)

Submission status: Wrong Answer

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

import math


order = []

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

sorted_order = sorted(order, key=lambda x: (x + 4) % 10)

t = 0
for i, n in enumerate(sorted_order):
    if i == len(sorted_order) - 1:
        t += n
    else:
        t += math.ceil(n / 10) * 10

print(int(t))

Submission status: Wrong Answer

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

menu = [A,B,C,D,E]
menu.sort()
count  = 0
for x in menu:
    if x % 10 == 0:
        count += x
    else:
        count += 10 + (x//10)*10

cache = 10**5
for x in menu:
    if x%10 == 0:
        continue
    if cache > x%10:
        cache = x%10
count -= (10 - cache)
print(count)

Submission status: Wrong Answer

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

sum_num = 0

delta = 100

for num in a:
    if num % 10 != 0 and num % 10 < delta:
        delta = num % 10
    sum_num += math.ceil(num / 10) * 10

print(sum_num - 10 + delta)

Submission status: Wrong Answer

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

import itertools
import collections
import bisect

def main():
    # big value
    INF = int(1e15)
    last = INF
    menus = []
    for _ in range(5):
        m = int(input())
        if last == INF:
            last = m
        else:
            if m % 10 != 0:
                m_d = m % 10
                l_d = last % 10
                if m_d < l_d:
                    last = m
        menus.append(m)

    ans = 0
    for m in menus:
        if m == last or m % 10 == 0:
            ans += m
        else:
            ans += m + (10 - m % 10)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
times = [int(input()) for _ in range(5)]
times1 = []
total = 0
for t in times:
  t1 = t % 10
  if t1 == 0:
    total += t
  else:
    times1.append(t1)
    total += (t//10 + 1) * 10
if len(times1) >= 1:
    total = total + min(times1)
print(total)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  6 20:39:40 2019

@author: Yamazaki Kenichi
"""
import math

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

a = 10
if A%x != 0:
    a = min(a,A%x)
if B%x != 0:
    a = min(a,B%x)
if C%x != 0:
    a = min(a,C%x)
if D%x != 0:
    a = min(a,D%x)
if E%x != 0:
    a = min(a,E%x)
if 0 == max(A%x,B%x,C%x,D%x,E%x):
    a = 0
b = math.ceil(A/x) + math.ceil(B/x) + math.ceil(C/x) + math.ceil(D/x) + math.ceil(E/x)

print((b-1)*10 + a)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=[a,b,c,d,e].index(max([a,b,c,d,e]))
q=[a,b,c,d,e][:k]+[a,b,c,d,e][k+1:]
print(sum(map(lambda x:(x//10)*10+(10*(x%10!=0)),q))+k)

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a = IR(5)
    k = II()
    if max(a) - min(a) > k:
        print(":(")
    else:
        print("Yay!")
    return

#B
def B():
    a = IR(5)
    b = a[0]
    ans = 0
    for a_ in a:
        if a_ % 10 != 0:
            if b % 10> a_ % 10:
                b = a_
    for a_ in a:
        if a_ != b:
            ans += math.ceil(a_ / 10) * 10
        else:
            ans += b
    print(ans)
            
    
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Wrong Answer

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

ans = 0
mini = []
for i in AE:
    ans += (i//10 + 1)*10
    mini.append(i%10)
print(ans + min(mini) - 10)

Submission status: Wrong Answer

Solution code:
def main():
	r = [0]*5
	r[0] = int(input())
	r[1] = int(input())
	r[2] = int(input())
	r[3] = int(input())
	r[4] = int(input())

	total = 0
	mod_min = 9

	for x in r:
		div = x//10
		total += div*10
		mod = x%10
		if mod != 0:
			if mod < mod_min:
				mod_min = mod
			total+=10
	total = total - 10 + mod_min
	print(total)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def get(x):
    x = x % 10
    if x == 0:
        return 10
    else:
        return x

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


x = min([A, B, C, D, E]) 
if x == 10:
    x = 0

print(10 * ((-(-a // 10) + -(-b // 10) + -(-c // 10) + -(-d // 10) + -(-e // 10))) + x - 10)

Submission status: Wrong Answer

Solution code:
from itertools import*
*a,=map(int,open(0).read().split())
b=[i%10for i in a]
c=a.pop(b.index(min(b)))
ans=0
#print(a)
for i in a:
    #print((i//10*10+(i%10>0)*10))
    ans+=(i//10*10+(i%10>0)*10)
print(ans+c)

Submission status: Wrong Answer

Solution code:
import sys
# import bisect
# import math
# import itertools
import numpy as np
# import collections

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e, p = range, enumerate, print
    ip = IP()
    id = Idea()
    mod = 10 ** 9 + 7

    """この下から書いてね"""
    li = np.array(ip.ILS(5))
    li_m = li % 10
    m = max(li_m)
    res = 0
    ans = sum(li // 10)
    for x in li_m:
        if x != 0:
            m = min(m, x)
            res += 1
    if res == -1:
        res = 0
    p(ans * 10 + (res - 1) * 10 + m)


main()

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

SUM=max(a,b,c,d,e)
print(A+B+C+D+E+a+b+c+d+e-SUM)

Submission status: Wrong Answer

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

def kiriage(x):
    n = x % 10
    if n == 0:
        return x
    else:
        return x + 10 - n

n = 0
for i in range(5):
    n += kiriage(a[i])

p = 9
for i in range(5):
    if a[i] % 10 != 0:
        p = min(p, a[i] % 10)

print(n - 10 + p)

Submission status: Wrong Answer

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

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

r = list(map(lambda x:x % 10,l))
r = [x if x != 0 else 10 for x in r]

index = r.index(min(r))

ans = 0

for i in range(5):
	if i == index:
		ans += l[i]
	else:
		ans += (l[i]//10 + 1) * 10

print(ans)

Submission status: Wrong Answer

Solution code:
a = [ int(input()) for _ in range(5) ]
a = sorted(a,key=lambda x: x%10)

ans = a[0]
for i in a[1:]:
  ans += i + 10-i%10

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a = ni()
b = ni()
c = ni()
d = ni()
e = ni()

f = min(a%10,b%10,c%10,d%10,e%10)

ans = (a+9)//10+(b+9)//10+(c+9)//10+(d+9)//10+(e+9)//10

print(ans*10+f-10)

Submission status: Wrong Answer

Solution code:
times = [int(input()) for _ in range(5)]
times1 = [0]
total = 0
for t in times:
  t1 = t % 10
  if t1 == 0:
    total += t
  else:
    times1.append(t1)
    total += (t//10 + 1) * 10
total = total + min(times1) - 10
print(total)