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 itertools

def f(x):
    if x[1] == 0:
        return x[1]
    else:
        return 10 -x[1] 

a = []
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))


b = []

for i in a:
    c = i - (int(i / 10) * 10) 
    b.append((i, c))

b.sort(key=f)

x = 0

for i in b:
    x += i[0]
    if i[1] != 0:
        x += 10 - i[1]
    l = 10 - i[1]
x -= l

print(x)

Submission status: Wrong Answer

Solution code:
times = [int(raw_input()) for i in range(5)]
dists = [(i % 10 or 10) for i in times]
last_index = dists.index(min(dists))
print sum([(time / 10 + 1) * 10 for ind, time in enumerate(times) if ind != last_index] + [times[last_index]])

Submission status: Wrong Answer

Solution code:
import math
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
L=[a,b,c,d,e]
L.sort()
y=0
for n in L[1:5]:  
    x=math.ceil(n/10)*10
    y=x+y   
print(y+L[1])

Submission status: Wrong Answer

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] and s % 10 != 0:
        s += 10 - s % 10

print(s)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
d = [A, B, C, D, E]
d_1 = list(map(lambda x:x%10,d))
m = min(d_1)

f = A+B+C+D+E+40 - sum(d_1) +m
print(f)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
d = [A, B, C, D, E]
d_1 = list(map(lambda x:x%10,d))
m = min(d_1)

f = A+B+C+D+E+40+m - sum(d_1)
print(f)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
d = [A, B, C, D, E]
d_1 = list(map(lambda x:x%10,d))
m = min(d_1)

f = A+B+C+D+E+40+m - sum(d_1)
print

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

sum = 0
for i in range(4):
    t = (int(a[i] / 10) + 1) * 10
    sum += t

sum += a[4]
print(sum)

Submission status: Wrong Answer

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]) if min(t_min) != 0 else 10
print(sum(T) - 10 + t_min)

Submission status: Wrong Answer

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]
print(sum(T) - 10 + min(t_min))

Submission status: Wrong Answer

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

minnum = 1000
for con in ipt:
    minnum = min(minnum, con % 10 if con % 10 != 0 else minnum)

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

Submission status: Wrong Answer

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

minnum = 1000
for con in ipt:
    minnum = min(minnum, con % 10 if con % 10 != 0 else minnum)

print(sum([10 - con%10 + con if con%10 != minnum and con%10 != 0 else con for con in ipt]))

Submission status: Wrong Answer

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

m = 9
a = [A, B, C, D, E]

for i in range(len(a)):

 if a[i] % 10 <= m and a[i] % 10 != 0:
    m = a[i] % 10


for j in range(len(a)):
  if a[j] % 10 != 0:
     a[j] = a[j] + (10 - a[j] % 10)

print(sum(a) - (10 - m))

Submission status: Wrong Answer

Solution code:
time=[]
for i in range(5):
    temp=[]
    temp.append(int(input()))
    if temp[0]%10==0:
        temp.append(0)
    else:
        temp.append(10-temp[0]%10)
    time.append(temp)
print(time)
time=sorted(time,key=lambda x:x[1])
print(time)
sum=0
for i in range(5):
    sum+=time[i][0]
    sum+=time[i][1]
print(sum-time[4][1])

Submission status: Wrong Answer

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

a_s = a + (10 - a%10)
a_a = a%10
b_s = b + (10 - b%10)
b_a = b%10
c_s = c + (10 - c%10)
c_a = c%10
d_s = d + (10 - d%10)
d_a = d%10
e_s = e + (10 - e%10)
e_a = e%10

answer = (a_s + b_s + c_s + d_s + e_s)

List =[]
List.append(a_a)
List.append(b_a)
List.append(c_a)
List.append(d_a)
List.append(e_a)
List.sort()

for i in range(5):
    if(List[i] != 0):
        answer = answer - (10-List[i])
        break

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Solution code:
a = [int(input()) for i in range(5)]
b = 4
c = 0
ans = 0
for i in a:
  if i % 10 == 0:
    if b > 0:
      b -= 1 
  else:
    if c == 0:
      c = i
    else:
      c = min(c,i % 10)
for i in a:
  ans += (i // 10) * 10
ans = ans + b * 10 + c
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
t = [int(input()) for _ in range(5)]
c = sum([math.ceil(e / 10) * 10 for e in t]) - 10 + min([e % 10 if e % 10 > 0 else 999 for e in t])
print(c)

Submission status: Wrong Answer

Solution code:
xs = [int(input()) for i in range(5)]
ps = []
for x in xs:
	ps.append(((x-1)%10+1, x))
ps.sort()
ans = 0
ans += ps[0][1]
for i in range(1, 5):
	print(ps[i])
	ans += (ps[i][1] + 9) // 10 * 10
print(ans)

Submission status: Wrong Answer

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

li2 = [];ans = 0
for i in li:
    if i%10 == 0:
        ans += i
    else:
        ans += i + (10-i%10)
        li2.append(i%10)
if li2 != []:
    ans += 10-min(li2)

print(ans)

Submission status: Wrong Answer

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

li2 = [];ans = 0
for i in li:
    if i%10 == 0:
        ans += i
    else:
        ans += i + (10-i%10)
        li2.append(i%10)
if li2 != []:
    ans -= min(li2)

print(ans)

Submission status: Wrong Answer

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

m = 9
a = [A, B, C, D, E]

for i in range(len(a)):

 if a[i] % 10 <= m and a[i] % 10 != 0:
    m = a[i] % 10


for j in range(len(a)):
  if a[j] % 10 != 0:
     a[j] = a[j] + (10 - a[j] % 10)

print(m)

print(sum(a) - (10 - m))

Submission status: Wrong Answer

Solution code:
time_10 = []
min_time = 9
old = -10
for x in range(5):
    tmp = int(input())
    m = tmp % 10
    if m == 0:
        time_10.append(tmp)
        
    elif m < min_time:
        min_time = m
        time_10.append(((old // 10) + 1) * 10)
        old = tmp
        
    else:
        time_10.append(((tmp // 10) + 1) * 10)
        

print(sum(time_10)+old)

Submission status: Wrong Answer

Solution code:
a=[]
for i in range(5):
	a.append(int(input()))
b=[]
for i in range(5):
	b.append((10-a[i]%10,i))
c=[]
for i in range(5):
	c.append(b[i][0]+a[i])
b.sort()
t=b[4][1]
ans=0
for i in range(5):
	if i !=t:
		ans+=c[i]
ans+=a[t]
print(ans)

Submission status: Wrong Answer

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[1]
print(res)

Submission status: Wrong Answer

Solution code:
A,B,C,D,E=int(input()),int(input()),int(input()),int(input()),int(input())
orders = [A,B,C,D,E]
res = 0
while orders:
  if res % 10 != 0:
    res += (10 - res % 10)
  order = orders.pop(0)
  res += order
print(res)

Submission status: Wrong Answer

Solution code:
A,B,C,D,E=int(input()),int(input()),int(input()),int(input()),int(input())
orders = [A,B,C,D,E]
res = 0
while orders:
  order = orders.pop(0)
  res += order
  if res % 10 != 0 and orders:
    res = res//10 * 10 + 10
print(res)

Submission status: Wrong Answer

Solution code:
A,B,C,D,E=int(input()),int(input()),int(input()),int(input()),int(input())
orders = [A,B,C,D,E]
res = 0
while orders:
  order = orders.pop(0)
  res += order
  if res % 10 != 0:
    res = res//10 * 10 + 10
print(res)

Submission status: Wrong Answer

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))) * 10

if diff != []:
    sum_order += diff[0]
    
print (sum_order)

Submission status: Wrong Answer

Solution code:
n = 5;
a = [int(input()) for i in range(n)];
last = 9;
time = 0;
flag = True;

for i in a:
	if last % 10  > i % 10 >= 1:
		time += last  // 10 * 10 + 10;
		last = i;
		flag = False;

	elif i % 10 == 0:
		time += i;

 	else:
		time += i  // 10 * 10 + 10;

if flag:
	print(time + last - 9);

else:	
	print(time + last - 10);

Submission status: Wrong Answer

Solution code:
n = 5;
a = [int(input()) for i in range(n)];
last = 9.1;
time = 0;
flag = True;

for i in a:
	if last % 10  > i % 10 >= 1:
		time += last  // 10 * 10 + 10;
		last = i;
		flag = False;

	elif i % 10 == 0:
		time += i;

 	else:
		time += i  // 10 * 10 + 10;

if flag:
	print(time + last - 9);

else:	
	print(time + last - 10);

Submission status: Wrong Answer

Solution code:
n = 5;
a = [int(input()) for i in range(n)];
last = 9.1;
time = 0;

for i in a:
	if last % 10  > i % 10 >= 1:
		time += last  // 10 * 10 + 10;
		last = i;

	elif i % 10 == 0:
		time += i;

 	else:
		time += i  // 10 * 10 + 10;

if last == 9.1:
	print(time + last - 9.1);

else:	
	print(int(time + last - 10));

Submission status: Wrong Answer

Solution code:
n = 5;
a = [int(input()) for i in range(n)];
last = 9;
time = 0;

for i in a:
	if last % 10  > i % 10 >= 1:
		time += last  // 10 * 10 + 10;
		last = i;

	elif i % 10 == 0:
		time += i;

 	else:
		time += i  // 10 * 10 + 10;

if last == 9:
	print(time + last - 9);

else:	
	print(time + last - 10);

Submission status: Wrong Answer

Solution code:
n = 5;
a = [int(input()) for i in range(n)];
last = 9;
time = 0;

for i in a:
	if last % 10  > i % 10 >= 1:
		time += last  // 10 * 10 + 10;
		last = i;

	elif i % 10 == 0:
		time += i;

 	else:
		time += i  // 10 * 10 + 10;
	
print(time + last - 10);

Submission status: Wrong Answer

Solution code:
n = 5;
a = [int(input()) for i in range(n)];
last = 9;
time = 0;

for i in a:
	if last % 10  > i % 10 > 1:
		time += last  // 10 * 10 + 10;
		last = i;

	elif i % 10 == 0:
		time += i;

 	else:
		time += i  // 10 * 10 + 10;
	
print(time + last - 10);

Submission status: Wrong Answer

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)

print time
if list2 != []:
    time = time - 10 + min(list2)
    print int(time)
else:
    print int(time)

Submission status: Wrong Answer

Solution code:
101
86
119
108
57

Submission status: Wrong Answer

Solution code:
a=map(int,open(0));print(min(~-i%10for i in a)-sum(-i//10*10for i in a)-9)

Submission status: Wrong Answer

Solution code:
# coding = utf-8
list1 = []
list2 = []

time = 0
for n in range(5):

    list1.append(int(input()))

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

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

Submission status: Wrong Answer

Solution code:
result = 0
min = 9
for i in range(5):
    time = int(input())
    result = result+time if time%10 == 0 else result + time + 10-(time%10)
    if time % 10 < min and time % 10 !=0:
        min = time % 10
print(result - (10-min))

Submission status: Wrong Answer

Solution code:
 
import itertools
#import time

#t1 = time.time()

num = [int(input()) for _ in range(5)]
#num2 = [n if n % 10 == 0 else n - (n%10) + 10  for n in num]

N = []

for i in list(itertools.permutations(range(5))):
    c = 0
    n = 0
#    print(i)
    for j in i:
        c += 1
 #       print(j)
        if c == 5:
            n += num[j]
#            print(n)
        else:
            n += num[j] - (num[j] % 10) + 10
 #           print(n)
    N.append(n)

print(int(min(N)))

#t2 = time.time()

#print(t2-t1)

Submission status: Wrong Answer

Solution code:
time = [int(input()) for i in range(5)]
ten_time = 0
smallest_mod = 9
for i in range(5):
    div,mod = divmod(time[i],10)
    if 0 < mod < smallest_mod:
        smallest_mod = mod
    if mod != 0:
        ten_time += div + 1
    else:ten_time += div
print(ten_time * 10 - 10 + smallest_mod)

Submission status: Wrong Answer

Solution code:
time = [int(input()) for i in range(5)]
ten_time = 0
smallest_mod = 9
for i in range(5):
    div,mod = divmod(time[i],10)
    if mod < smallest_mod:
        smallest_mod = mod
    if mod != 0:
        ten_time += div + 1
    else:ten_time += div
print(ten_time * 10 - 10 + smallest_mod)

Submission status: Wrong Answer

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

last_order_candidate_value = _list[0]
minimum_mod_10 = 9
for i in range(len(_list)):
    minutes_mod_10 = _list[i] % 10
    if minutes_mod_10 != 0 and minimum_mod_10 < minutes_mod_10:
        minimum_mod_10 = minutes_mod_10
        last_order_candidate_value = _list[i]

_list.remove(last_order_candidate_value)

elaps = 0
for i in range(len(_list)):
    elaps = elaps + _list[i]
    if (elaps%10 != 0):
        elaps = elaps + (10 - elaps%10)
elaps = elaps + last_order_candidate_value

print(elaps)

Submission status: Wrong Answer

Solution code:
times = [int(input()) for i in range(5)]
rest = [times[i] % 10 for i in range(len(times))]
total = 0
for n in times:
    if n % 10 != 0:
        total += n + 10 - (n % 10)
    else:
        total += n

distance = min(rest)
print(total - 10 + distance)

Submission status: Wrong Answer

Solution code:
times = [int(input()) for i in range(5)]
rest = [times[i] % 10 for i in range(len(times))]
total = 0
for n in times:
    total += n + 10 - (n % 10)

distance = min(rest)
print(total - 10 + distance)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A=[int(input()) for i in range(5)]
B=[10 if A[i]%10==0 else A[i]%10 for i in range(5)]
k=B.index(min(B))
C=[A[i]//10*10+10 for i in range(5)]
print(sum(C)-C[k]+A[k])

Submission status: Wrong Answer

Solution code:
import math

dish = [ int(input()) for i in range(5) ]
sum = sum([ math.ceil(d/10)*10 for d in dish])
min = min([d%10 for d in dish])

if min == 0:
    print(sum)
else:
    print(sum + min - 10)

Submission status: Wrong Answer

Solution code:
List = list(map(int,[input() for i in range(5)]))
a = lambda x:-(-x//10) * 10
b = lambda x:x % 10

aa = list(map(b, List))

a2 = aa.index(min(aa))
a3 = List.pop(a2)

print(sum(list(map(a,List)))+a3)

Submission status: Wrong Answer

Solution code:
import math

dish = [ int(input()) for i in range(5) ]
print(sum([ math.ceil(d/10)*10 for d in dish]) + min([d%10 for d in dish]) - 10)

Submission status: Wrong Answer

Solution code:
List = list(map(int,[input() for i in range(5)]))
a = lambda x:-(-x//10) * 10
a2 = list(map(a,List)).index(min(list(map(a,List))))
a3 = List.pop(a2)

print(sum(list(map(a,List)))+a3)

Submission status: Wrong Answer

Solution code:
a = list(map(int,[input() for i in range(5)]))
b = 10
c = 0
d = False
for i in a:
	if i % 10 > 0:
		c += i + 10 - i % 10
		print("i: {}, c: {}".format(i,c))
		if b > i % 10:
			b = i % 10
	else:
		c += i
print(c-10+b)

Submission status: Wrong Answer

Solution code:
a = list(map(int,[input() for i in range(5)]))
b = 10
c = 0
d = False
for i in a:
	c += i + 10 - i % 10
	print("i: {}, c: {}".format(i,c))
	if b > i % 10:
		b = i % 10
print(c-10+b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
s=0
amari=[a%10,b%10,c%10,d%10,e%10]
nokori=list((10-amari[i])%10 for i in range(5))
maxi=max(nokori)
dish=[a,b,c,d,e]
for i in range(5):
  if dish[i]%10==0:
    s=s+dish[i]
  else:
    s=s+dish[i]+10-dish[i]%10
if maxi==0:
  print(s)
else:
  print(s-10+maxi)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
s=0
amari=[a%10,b%10,c%10,d%10,e%10]
maxi=max(amari)
dish=[a,b,c,d,e]
for i in range(5):
  if dish[i]%10==0:
    s=s+dish[i]
  else:
    s=s+dish[i]+10-dish[i]%10
if maxi==0:
  print(s)
else:
  print(s-10+maxi)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
s=0
amari=[a%10,b%10,c%10,d%10,e%10]
mini=min(amari)
dish=[a,b,c,d,e]
for i in range(5):
  if dish[i]%10==0:
    s=s+dish[i]
  else:
    s=s+dish[i]+10-dish[i]%10
if mini==0:
  print(s)
else:
  print(s-10+max(amari))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
s=0
amari=[a%10,b%10,c%10,d%10,e%10]
mini=min(amari)
dish=[a,b,c,d,e]
for i in range(5):
  if dish[i]%10==0:
    s=s+dish[i]
  else:
    s=s+dish[i]+10-dish[i]%10
if mini==0:
  print(s)
else:
  print(s-10+mini)

Submission status: Wrong Answer

Solution code:
from sys import exit
# A,B,C = [int(n) for n in input().split()]
# N = int(input())
A = [0]*5
last = 129

for _ in range(5):
    A[_] = int(input())
    if(A[_]%10 != 0 and last%10 >= A[_]%10):
        last = A[_]
ans = 0
once = False
for a in A:
    if(a == last and not once):
        once = True
        continue
    if(a%10 != 0 ):
        a+=10 - a%10
    ans+=a
if(last == 128):
    print(ans)
else:
    print(ans+last)
# S = str(input())
# L = len(S)
# T = str(input())
# exit()

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
s=0
amari=[a%10,b%10,c%10,d%10,e%10]
mini=min(amari)
dish=[a,b,c,d,e]
for i in range(5):
  if dish[i]%10==0:
    s=s+dish[i]
  else:
    s=s+dish[i]+10-dish[i]%10
print(s-10+mini)

Submission status: Wrong Answer

Solution code:
from sys import exit
# A,B,C = [int(n) for n in input().split()]
# N = int(input())
A = [0]*5
last = 128

for _ in range(5):
    A[_] = int(input())
    if(A[_]%10 != 0 and last%10 > A[_]%10):
        last = A[_]
ans = 0
once = False
for a in A:
    if(a == last and not once):
        once = True
        continue
    if(a%10 != 0 and a > 9):
        a+=10 - a%10
    ans+=a
if(last == 128):
    print(ans)
else:
    print(ans+last)
# S = str(input())
# L = len(S)
# T = str(input())
# exit()

Submission status: Wrong Answer

Solution code:
from sys import exit
# A,B,C = [int(n) for n in input().split()]
# N = int(input())
A = [0]*5
last = 128

for _ in range(5):
    A[_] = int(input())
    if(A[_]%10 != 0 and last%10 > A[_]%10):
        last = A[_]
ans = 0
once = False
for a in A:
    if(a == last and not once):
        once = True
        continue
    if(a%10 != 0):
        a+=10 - a%10
    # print(ans)
    ans+=a
if(last == 128):
    print(ans)
else:
    print(ans+last)
# S = str(input())
# L = len(S)
# T = str(input())
# exit()

Submission status: Wrong Answer

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

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

last_food = []

for i in food:
	sub = i % 10
	sub_last_food = 10 - sub
	
	if sub_last_food == 10:
		x = 0
	else:
		x = sub_last_food
		
	last_food.append(x)
	print(last_food)
	
ans = max(last_food)
print(ans)

ans1 = last_food.index(ans)
print(ans1)

for i in range(5):
	ans2 = food[i] + last_food[i]
	ans3 = ans3 + ans2
	print(ans3)

ans4 = ans3  - last_food[ans1]

print(ans4)

Submission status: Wrong Answer

Solution code:
A=[int(input()) for i in range(5)]
B=[10 if A[i]%10==0 else A[i]%10 for i in range(5)]
print((sum(A)-A[B.index(min(B))])//10*10+10+A[B.index(min(B))])

Submission status: Wrong Answer

Solution code:
import sys

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

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

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

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

print(sum)

Submission status: Wrong Answer

Solution code:
list = []
indent = 0
memory = 9
for i in range(5):
  list.append(int(input()))
  if memory > list[i] % 10 and list[i] % 10 > 0:
    indent = i
    memory = list[i] % 10

count = 0
for i in range(5):
  if i == indent:
    count += list[i]
  else:
    count += 10 * (int(list[i]/10) + 1)

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

F = []
for i in range(5):
    F.append(int(input()))
# print(F)
x = F[0] % 10
xi = 0
for i, fi in enumerate(F):
    y = fi % 10
    if y < x:
        x = y
        xi = i

ans = 0
for i, fi in enumerate(F):
    if i == xi:
        continue
    # ans += math.ceil(fi)
    ans += (math.ceil(fi / 10)) * 10

ans += F[xi]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list = []
memory = 0
for i in range(5):
  list.append(int(input()))
  if memory > list[i] % 10:
  	memory = i

count = 0
for i in range(5):
  if i == memory:
    count += list[i]
  else:
    count += 10 * (int(list[i]/10) + 1)

print(count)

Submission status: Wrong Answer

Solution code:
# coding:utf-8
# 調理時間の入力
cooking_time = [int(input()) for i in range(5)]
# 注文が10の倍数の時間にならないとできないので、料理ができてから注文可能になるまでの時間を出す
# 料理ができてから注文可能時間が早く来る順にする
cooking_time = sorted(cooking_time, key=lambda x: x%10, reverse=True)
#print(cooking_time)
ans = 0

for i , cooking_time in enumerate(cooking_time):
    # 1品目から4品目まで
    if i < 4:
        if cooking_time%10 != 0:
            #調理時間と注文待ち時間が加算される
            ans += cooking_time + (10-cooking_time%10)
        else:
            ans += cooking_time
    # 5品目
    else:
        ans += cooking_time

print(ans)

Submission status: Wrong Answer

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

import math

def main():
    ABCDE = [int(input()) for _ in range(5)]
    d = [(k, 10 - (k % 10) if k % 10 != 0 else 0,) for k in ABCDE]
    d.sort(key=lambda x:x[1])
    abced = [k[0] for k in d]
    result = 0
    for i in abced[:-1]:
        if i % 10 == 0:
            result += i
        else:
            result += 10 * math.ceil(i / 10)
        print(result)
    result += abced[-1]
    print(result)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a = [int(input()) for _ in range(5)]
b = [(10-(i%10)%10) for i in a]
c = max(b)
print(sum([((j + 9)//10) * 10 for j in a]) - c)

Submission status: Wrong Answer

Solution code:
a = [int(input()) for _ in range(5)]
b = [(10-(i%10)) for i in a]
c = max(b)
print(sum([((j + 9)//10) * 10 for j in a]) - c)

Submission status: Wrong Answer

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

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

aModMin = min(aMod)
if aModMin == 10:
    aModMin = 0

print(sum(a) + aModMin - 10)

Submission status: Wrong Answer

Solution code:
a = [int(input()) for i in range(5)]
b =[]
c = []
ch = False
t = 0
for i in a:
    if ch == False and i % 10 != 0 and i % 10 <= 5:
        t += i
        print(i)
        ch = True
    elif i % 10 == 0:
        t += i
    else:
        t += (int(i/10) + 1)*10
print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools
args = []
for _ in range(5):
    tmp = int(input())
    args.append(tmp)
best = 643
for perm in itertools.permutations(args):
    remainder = 0
    cook = 0
    for t in perm:
        cook += t
        remainder += 10 - cook % 10
    else :
        remainder -= 10 - cook % 10
    cook += remainder
    if cook < best:
        best = cook
print(best)

Submission status: Wrong Answer

Solution code:
import sys
def Main():
  A = int(input())
  B = int(input())
  C = int(input())
  D = int(input())
  E = int(input())
    

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

Submission status: Wrong Answer

Solution code:
import sys
def Main():
  A = int(input())
  B = int(input())
  C = int(input())
  D = int(input())
  E = int(input())
    

  Last = A
    
  if Last%10 > B%10:
    Last = B
    
  if Last%10 > C%10:
    Last = C
      
  if Last%10 > D%10:
    Last = D
      
  if Last%10 > E%10:
    Last = E
    
  BeforeTotal = (A/10+1)*10+(B/10+1)*10+(C/10+1)*10+(D/10+1)*10+(E/10+1)*10
  AfterTotal = BeforeTotal - (Last/10+1)*10 +Last
    
  print(AfterTotal)
    
Main()