Problem: 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.

Submission attempts (in order):
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):
    
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    
    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]



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)


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):
    
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    
    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]



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)


import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


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


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


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


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


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right





A = list(map(int, open(0).read().split()))
ans = 0
B = []
for a in A:
    ans += (a - 1) // 10 + 1
    B.append(10 - a % 10 if a % 10 != 0 else 0)

print(ans * 10 - max(B))


Verdicts: Wrong Answer

Wrong Answer

Accepted