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-----
29
20
7
35
120

-----Sample Output-----
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.
[{"code": "import math\na = []\nfor i in range(5):\n    a.append(int(input()))\nsum = 0\nr =10\nfor i in range(5):\n  if a[i] % 10 ==0:\n    sum+=a[i]\n  elif a[i] % 10 !=0:\n    r = min(r,a[i]%10)\n    sum+= (10*math.ceil(a[i]/10))\nprint(sum-10+r)", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "from itertools import permutations\n\ndef mapt(fn, *args):\n    return tuple(map(fn, *args))\n\n\ndef Input():\n    return mapt(int, input().split(\" \"))\n\n\ndef calc(i, h):\n    return all(h[i] >= h[j] for j in range(i))\n\n\ndef main():\n    ans = 1000\n    data = [int(input()) for i in range(5)]\n    for row in permutations(data, 5):\n        time = 0\n        for index, i in enumerate(row):\n            if index == 4:\n                time += i\n                continue\n            remain = i % 10\n            if remain:\n                time += i + (10-remain)\n            else:\n                time += i\n        ans = min(ans, time)\n    print(ans)\n\n\n\nmain()", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "from itertools import permutations\nfrom math import ceil\n\ntimes = list(int(input()) for _ in range(5))\norders = list(permutations(times, 5))\nminimum = sum(ceil(time/10)*10 for time in times)\n\nfor order in orders:\n    cnt = order[0]\n    for i in range(1, 5):\n        cnt += ceil(order[i]/10)*10\n    minimum = min(minimum, cnt)\nprint(minimum)\n", "passed": true, "time": 0.99, "memory": 14080.0, "status": "done"}, {"code": "from itertools import permutations\nimport math\n\nT = [int(input()) for i in range(5)]\n\nres = float(\"INF\")\nfor order in permutations(T):\n    total = order[0]\n    for i in range(1, 5):\n        total += math.ceil(order[i]/10) * 10\n    res = min(res, total)\nprint(res)\n", "passed": true, "time": 0.9, "memory": 14184.0, "status": "done"}, {"code": "minutes = [int(input()) for i in range(5)]\nif max(m % 10 for m in minutes) != 0:\n\tones_place_min = min(m % 10 for m in minutes if m % 10 != 0)\n\tfor m in minutes:\n\t\tif m % 10 == ones_place_min:\n\t\t\tones_place_min = m\n\t\t\tbreak\n\tminutes.remove(ones_place_min)\n\tminutes = [m if m % 10 == 0 else (m + 9) // 10 * 10 for m in minutes]\n\tminutes.append(ones_place_min)\nprint(sum(minutes))", "passed": true, "time": 0.9, "memory": 14328.0, "status": "done"}, {"code": "l = [int(input()) for _ in range(5)]\nfrom operator import itemgetter\nfor i in range(5):\n  l[i] += 9\n  l[i] = str(l[i])\nl.sort(key = itemgetter(-1), reverse = True)\nfor i in range(5):\n  l[i] = int(l[i])\n  l[i] -= 9\nans = 0\nfor i in range(5):\n  if l[i]%10 == 0:\n    ans += l[i]\n  else:\n    if i == 4 :\n      ans += l[i]\n    else:\n      ans += l[i] + 10 - l[i]%10\nprint(ans)", "passed": true, "time": 1.76, "memory": 14080.0, "status": "done"}, {"code": "foods = [int(input()) for _ in range(5)]\norder_times = [food - food % 10 + 10 if food % 10 != 0 else food for food in foods]\ndiff = [(order_time - food) for order_time, food in zip(order_times, foods)]\n\nprint((sum(order_times) - max(diff)))\n", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "cooktime=[]\nmin_index=100\nmin=123\nfor i in range(5):\n    cooktime.append(int(input('')))\n    if cooktime[i]%10!=0 and min>cooktime[i]%10:\n        min_index=i\n        min=cooktime[i]%10\nsum=0\nfor i in range(5):\n    sum+=cooktime[i]\n    if i!=min_index and cooktime[i]%10!=0:\n        sum+=10-cooktime[i]%10\nprint((str(sum)))    \n#print(\"min_index:\"+str(min_index))\n", "passed": true, "time": 0.16, "memory": 14220.0, "status": "done"}, {"code": "import math\na=[int(input()) for i in range(5)]\n\nb=[]\nc=[]\n\nfor i in range(5):\n  p=math.ceil(a[i]/10)*10\n  b.append(p)\n  c.append(list(str(a[i]-1)))\n\nd=[]\nfor i in range(5):\n  d.append(int(c[i][-1]))\n\nprint(sum(b)-(10-min(d)-1))  ", "passed": true, "time": 0.15, "memory": 14360.0, "status": "done"}, {"code": "import math as mt\na=[int(input()) for i in range(5)]\nfor i in range(5):\n    if a[i]%10!=0 and a[i]%10<a[0]%10:\n        a[0],a[i]=a[i],a[0]\nt=[mt.ceil(a[i]/10)*10 for i in range(1,5)]\nprint(a[0]+sum(t))", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "a = []\nfor _ in range(5):\n    a.append(int(input()))\nc = 0\nd = 0\nfor i in range(5):\n    b = a[i] % 10\n    if b != 0 and abs(10 - b) > c:\n        c = abs(10 - b)\n        d = i\ne = a.pop(d)\nf = 0\nfor j in a:\n    g = j % 10\n    if g == 0:\n        f += j\n    else:\n        f += (j // 10 + 1) * 10\nf += e\nprint(f)", "passed": true, "time": 0.24, "memory": 14348.0, "status": "done"}, {"code": "import math\n\ndishes = []\nrest = 10\n\nfor i in range(5):\n    n = int(input())\n    dishes.append(math.ceil(n / 10) * 10)\n    if 0 < n % 100 % 10 < rest:\n        rest = n % 100 % 10 \n\nprint(sum(dishes) - (10- rest))", "passed": true, "time": 0.15, "memory": 14380.0, "status": "done"}, {"code": "N = 5\nA = [int(input()) for _ in range(N)]\n \nif A[0] % 10 == 0 and A[1] % 10 == 0 and A[2] % 10 == 0 and A[3] % 10 == 0 and A[4] % 10 == 0:\n  ans = sum(A)\nelse:\n  ans = 0\n  B = []\n  for i in range(N):\n    if A[i] % 10 == 0: ans += A[i]\n    else: B.append(A[i])\n\n  C = [k % 10 for k in B]\n  m = C.index(min(C))\n  for i in range(len(B)):\n    if i == m: ans += B[i]\n    else: ans += (B[i] // 10 + 1) * 10\n  \nprint(ans)", "passed": true, "time": 0.15, "memory": 14340.0, "status": "done"}, {"code": "A = []\nfor i in range(5):\n  A.append(int(input()))\nimport itertools\nper = list(itertools.permutations(range(5)))\nans = []\ncheck = 0\nfor k in per:\n  time = 0\n  for i in range(5):\n    s = k[i]\n    time += A[s]\n    temp  = time // 10\n    if time % 10 != 0 and i != 4:\n      time = (temp+1) * 10\n  ans.append(time)\nprint(min(ans))", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "from math import ceil\norders = list(int(input()) for _ in range(5))\ntotal = 0\nmaximum = 0\n\nfor order in orders:\n    time = ceil(order / 10) * 10\n    total += time\n    delta = time - order\n    maximum = max(maximum, delta)\nprint((total - maximum))\n\n", "passed": true, "time": 0.15, "memory": 14320.0, "status": "done"}, {"code": "\nl = [int(input()) for i in range(5)]\n\nmod = 10\nl_div = [(10-x%10)%mod for x in l]\nsub = max(l_div)\n\n\nans = sum(l)+sum(l_div)-sub\nprint(ans)\n\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "dish=[int(input()) for i in range(5)]\ndish_s=[(dish[i]+9)//10 for i in range(5)]\ndish_d=[dish[i]%10 for i in range(5)]\nsum=0\nfor i in range(5):\n  sum+=dish_s[i]\nm=0\nfor i in range(5):\n  if dish_s[i]*10-dish[i]>m:\n    m=dish_s[i]*10-dish[i]  \nprint(sum*10-m)", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "details = []\nfor i in range(5):\n    details.append(int(input()))\nnew_list = []\nfor i in range(10):\n    current = 10 - i\n    for numbers in details:\n        if (((numbers - current) % 10) == 0):\n            new_list.append(numbers)\ncounter = 0\nfor numbers in new_list[:len(new_list)-1]:\n    current = numbers\n    while ((current % 10 != 0)):\n        current += 1\n    counter += current\n\nprint(counter + new_list[-1])", "passed": true, "time": 0.22, "memory": 14112.0, "status": "done"}, {"code": "l=[int(input()) for i in range(5)]\n\ndiff=0\nnum=0\nfor i in l:\n  if i%10==0:\n    num+=i\n  else:\n    a=round(i+5,-1)\n    num+=a\n    diff=max(diff,a-i)\n\nprint(num-diff)", "passed": true, "time": 0.23, "memory": 14164.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nc=int(input())\nd=int(input())\ne=int(input())\nf=[a,b,c,d,e]\ndata=[0]*5\nfor i in range(5):\n  if f[i]%10==0:\n    continue\n  else:\n    data[i]=10-f[i]%10\nprint(a+data[0]+b+data[1]+c+data[2]+d+data[3]+e+data[4]-max(data))", "passed": true, "time": 0.22, "memory": 14128.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\n\ndef f(x):\n    if 1 <= x and x <= 10:\n        return 10\n    elif 11 <= x and x <= 20:\n        return 20\n    elif 21 <= x and x <= 30:\n        return 30\n    elif 31 <= x and x <= 40:\n        return 40\n    elif 41 <= x and x <= 50:\n        return 50\n    elif 51 <= x and x <= 60:\n        return 60\n    elif 61 <= x and x <= 70:\n        return 70\n    elif 71 <= x and x <= 80:\n        return 80\n    elif 81 <= x and x <= 90:\n        return 90\n    elif 91 <= x and x <= 100:\n        return 100\n    elif 101 <= x and x <= 110:\n        return 110\n    elif 111 <= x and x <= 120:\n        return 120\n    else:\n        return 130\n    \naa = a + f(b) + f(c) + f(d) + f(e)\nbb = b + f(c) + f(d) + f(e) + f(a)\ncc = c + f(d) + f(e) + f(a) + f(b)\ndd = d + f(e) + f(a) + f(b) + f(c)\nee = e + f(a) + f(b) + f(c) + f(d)\nprint(min(aa, bb, cc, dd, ee))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a = []\nb = []\nc = []\nfor i in range(5):\n  a.append(int(input()))\nfor i in a:\n  b.append(i%10)\nfor i in b:\n  c.append((10-i)%10)\nd = max(c)\nprint((sum(a)+sum(c)-d))\n  \n", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "time = [int(input()) for _ in range(5)]\nnew_time = []\namari = 10\nfor x in time:\n  if x % 10 == 0:\n    new_time.append(x)\n  else:\n    amari = min(amari,x % 10)\n    new_time.append(10*((x//10)+1))\n    \ntotal = sum(new_time)\ndead = 10-amari\n\nprint((total-dead))\n    \n    \n    \n  \n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "import sys\na = list(sys.stdin.read().split())\nt = list(zip(*[[int(n[:-1] or 0), int(n[-1])] for n in a]))\nprint((sum(t[0]) + len((u := sorted(filter(lambda n: n > 0, t[1])))[:0:-1])) * 10 + (u and u[0] or 0))", "passed": true, "time": 0.14, "memory": 14384.0, "status": "done"}, {"code": "abcde = [int(input()) for _ in range(5)]\n\ns = list(map(lambda x: (10-x%10)%10, abcde))\nprint(sum(abcde)+sum(s)-max(s))", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "times = [input() for _ in range(5)]\n\nres = 0\nfor i in times:\n  res += (int(i)//10)*10+(10 if i[-1] != \"0\" else 0)\n  \ntime = []\nfor j in times:\n  time.append((int(j[-1]) if j[-1] != \"0\" else 10))\n  \nprint(res - 10 + min(time))", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "from itertools import permutations\nls=[int(input()) for _ in range(5)]\nans = 1000000\nfor p in permutations(ls):\n    t = 0\n    for x in p[:-1]:\n        t += x\n        if t % 10 != 0:\n            t += 10-(t%10)\n    t += p[-1]\n    ans = min(ans,t)\nprint(ans)", "passed": true, "time": 0.23, "memory": 14240.0, "status": "done"}, {"code": "foods = [int(input()) for _ in range(5)]\n\nlast = foods.pop(foods.index(min(foods, key=lambda x: (x - 1) % 10)))\nprint(sum(map(lambda x: ((x + 9) // 10) * 10, foods)) + last)", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "t=[]\naa=10\nfor i in range(5):\n    x=int(input())\n    y=(x-1)%10\n    aa=min(aa,y)\n    for i in range(14):\n        if 10*i>=x:\n            t.append(10*i)\n            break\nprint(sum(t)-10+aa+1)", "passed": true, "time": 0.6, "memory": 14108.0, "status": "done"}, {"code": "# ABC123\n# Five Dishes\n#B=A R=B G=C P=D T=E\nRyori = [input() for _ in range(5)]\nO = []\nt = 0\nfor i in Ryori:\n    if int(i[-1]) == 0:\n        x = Ryori.pop(Ryori.index(i))\n        O.append(x)\nRyori = sorted(Ryori,key=lambda x: x[-1], reverse=True)\n\nfor i in range(len(Ryori)-1):\n    for j in range(10):\n        if (int(Ryori[i]) + j) % 10 == 0:\n            t += int(Ryori[i]) + j\nt += int(Ryori[-1])\n\nfor i in O:\n    t += int(i)\nprint(t)\n", "passed": true, "time": 0.15, "memory": 14344.0, "status": "done"}, {"code": "a = [int(input()) for i in range(5)]\nb = [9 - (i - 1) % 10 for i in a]\nprint(sum(a) + sum(b) - max(b))", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "dishes = [int(input()) for i in range(5)] \n\nd = [abs(d % 10 -10) for d in dishes if d % 10 != 0] # select nums which can be divided by 10\nif d: d.remove(max(d)) \nprint(sum(dishes) + sum(d))", "passed": true, "time": 0.19, "memory": 14164.0, "status": "done"}, {"code": "A = []\nmin_digit = 9\nfor _ in range(5):\n  s = input()\n  n = int(s)\n  digit = int(s[-1])\n  if digit > 0 and digit < min_digit:\n    min_digit = digit\n    A = A + [n]\n  else:\n    A = [n] + A\n    \nimport math as m\nA = [int(m.ceil(n/10)*10) for n in A[:-1]] + [A[-1]]\nprint(sum(A))", "passed": true, "time": 0.16, "memory": 14084.0, "status": "done"}, {"code": "Min = 10\ntotal = 0\nfor i in range(5):\n    time = input()\n    time = \"000\" + time\n    if time[-1] == \"0\":\n        pass\n    else:\n        if Min > int(time[-1]):\n            Min = int(time[-1])\n        time = time[:-1] + \"0\"\n        if time[-2]:\n            time = time[-3] + str(int(time[-2]) + 1) + time[-1]\n        else:\n            time = \"10\"\n    total += int(time)\ntotal -= 10 - Min\nprint(total)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "data = [int(input()) for i in range(5)]\nif all(i % 10 == 0 for i in data):\n    print((sum(data)))\nelse:\n    a = 10\n    for i in range(len(data)):\n        if data[i] % 10 != 0:\n            if a > data[i] % 10:\n                a = data[i] % 10\n                b = i\n    ans = 0\n    for i in range(len(data)):\n        if i != b:\n            if data[i] % 10 != 0:\n                ans += (data[i] // 10 + 1) * 10\n            else:\n                ans += data[i]\n        else:\n            ans += data[i]\n    print(ans)\n", "passed": true, "time": 0.24, "memory": 14324.0, "status": "done"}, {"code": "foods = [int(input()) for i in range(5)]\nloss = [0]*5\nfor i in range(5):\n    if int(str(foods[i])[-1]) % 10 == 0:\n        loss[i] = 0\n    else:\n        loss[i] = abs(10 - int(str(foods[i])[-1]))\n\nlind = loss.index(max(loss))\nlmax = foods[lind]\ndel foods[lind], loss[lind]\nfoods = [foods[i] + loss[i] for i in range(4)]\nprint((sum(foods) + lmax))\n", "passed": true, "time": 0.16, "memory": 14152.0, "status": "done"}, {"code": "import math\n\nA = input()\nB = input()\nC = input()\nD = input()\nE = input()\n\nnum = 10\nfor i in [int(A[-1]), int(B[-1]), int(C[-1]), int(D[-1]), int(E[-1])]:\n    if i != 0:\n        num = min(num, i)\n\nresult = (math.ceil(int(A)/10) + math.ceil(int(B)/10) + math.ceil(int(C)/10) + math.ceil(int(D)/10) + math.ceil(int(E)/10)) * 10\nif num != 10:\n    result = result - 10 + num\n\nprint(result)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "foods = [0] * 5\nsumfoods = 0\nfor i in range(5):\n  foods[i] = int(input())\nmaxDiv = 0\nfor i, var in enumerate(foods):\n  temp = 10 - (var % 10)\n  if temp == 10:\n    temp = 0\n  foods[i] += temp\n  sumfoods += foods[i]\n  if maxDiv < temp:\n    maxDiv = temp\nprint((sumfoods - maxDiv))\n", "passed": true, "time": 0.16, "memory": 14400.0, "status": "done"}, {"code": "n=5\nr=0\nrem=10\nimport math\nfor _ in range(n):\n  a=int(input())\n  if a%10!=0:\n    rem=min(rem,a%10)\n  r+=math.ceil(a/10)\n\n#print(rem)\nprint((int(r*10)-10+rem))\n", "passed": true, "time": 0.23, "memory": 14208.0, "status": "done"}, {"code": "a = [int(input()) for _ in range(5)]\nz,ans = 123,0\nfor i in a:\n    if i%10!=0:z = min(z,i%10)\n    ans += 10*((i+10-1)//10)\nprint(ans+z-10 if (z!=123) or (z==0) else ans)", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "a_list=[int(input()) for i in range(5)]\n\nsum=0\nfor i in a_list:\n    #print(((i+9)//10)*10)\n    sum+=((i+9)//10)*10\n\nans_list=[]\nfor i in a_list:\n    b=((i+9)//10)*10-i\n    ans_list.append(sum-b)\n    \nprint(min(ans_list))", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "Value = [int(input()) for _ in range(5)]\namari = list()\nfor i in range(5):\n  if(Value[i]%10 == 0):\n    amari.append(10)\n  else:\n    amari.append(Value[i]%10)\nmin_amari = [i for i in range(5) if(min(amari)==amari[i])]\n\nans = 0\nfor i in range(5):\n  if(i == min_amari[0]):\n    ans += 0\n  else:\n    ans += (Value[i] + 10-amari[i])\nans += Value[min_amari[0]]\nprint(ans)", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "# 38\nmenu = []\njissai_menu = []\nfor i in range(5):\n    menu.append(int(input()))\n    if menu[i] % 10 == 0: \n        jissai_menu.append(menu[i])\n    else:\n        jissai_menu.append(menu[i] - menu[i] % 10 + 10)\n\nans = float('inf')\nfor i in range(5):\n    tmp = 0\n    for j in range(5):\n        if j == i: continue\n        tmp += jissai_menu[j]\n    ans = min(ans, tmp + menu[i])\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "duration = [0] * 5\nduration[0] = int(input())\nduration[1] = int(input())\nduration[2] = int(input())\nduration[3] = int(input())\nduration[4] = int(input())\n\ndigit = list(map(lambda x: x % 10, duration))\nif any(x != 0 for x in digit):\n    least = min([x for x in digit if x != 0])\n    idx = digit.index(least)\nelse:\n    idx = 0\n\nans = 0\nfor i in range(5):\n    if i != idx:\n        ans += ((duration[i] + 9) // 10) * 10\n    else:\n        ans += duration[i]\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "abcde=[int(input()) for i in range(5)]\nans=0\nm=10\nfor i in abcde:\n  ans += (i+9)//10*10\n  m=min(m,(i-1)%10+1)\nprint(ans-10+m)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "l = []\nfor i in range(5):\n    l.append(int(input()))\namari = []\nfor i in range(5):\n    if 10-l[i]%10 == 10 :\n        amari.append(0)\n    else :\n        amari.append(10-l[i]%10)\njikan = []\nfor i in range(5):\n    if amari[i] == 10:\n        jikan.append(l[i])\n    else :\n        jikan.append(l[i] + amari[i])\n\nprint((sum(jikan)-max(amari)))\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "from itertools import permutations\nimport math\nINF = float('inf')\nmenu = 5\ntimes = [int(input()) for i in range(menu)]\norders = list(permutations(times, menu))\nminimum = INF\nfor order in orders:\n    total = order[0]\n    for i in range(1, menu):\n        total += math.ceil(order[i]/10)*10\n    minimum = min(minimum, total)\nprint(minimum)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "from itertools import permutations\nfrom math import ceil\n\ntimes = [int(input()) for _ in range(5)]\norders = list(permutations(times))\nminimum = sum(ceil(time/10)*10 for time in times)\n\nfor order in orders:\n    total = order[0]\n    for i in range(1, 5):\n        total += ceil(order[i]/10)*10\n    minimum = min(minimum, total)\nprint(minimum)\n\n", "passed": true, "time": 0.19, "memory": 14240.0, "status": "done"}, {"code": "a = input()\nb = input()\nc = input()\nd = input()\ne = input()\nli = []\n\nli.append(10 - int(a[-1]))\nli.append(10 - int(b[-1]))\nli.append(10 - int(c[-1]))\nli.append(10 - int(d[-1]))\nli.append(10 - int(e[-1]))\n\nwhile 10 in li: li.remove(10)\n\nli.sort()\nn = len(li)\nif n != 0: \n    li.pop(n-1)\n\nprint(int(a)+int(b)+int(c)+int(d)+int(e)+sum(li))", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "import itertools\n\narr = []\nmins = []\n\nfor _ in range(5):\n    arr.append(int(input()))\n\nfor comb in list(itertools.permutations(arr)):\n    ans = 0\n    for (i, ele) in enumerate(comb):\n        ans += ele\n        if not i == len(comb) - 1:\n            diff = 10 - (ans % 10)\n            if diff == 10:\n                diff = 0\n            ans += diff\n    mins.append(ans)\n\nprint(min(mins))", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "x = [int(input()) for i in range(5)]\ntmp1 = []\nfor i in range(5):\n    tmp2 = str(x[i])\n    tmp1.append(int(tmp2[-1]))\nfor i in range(5):\n    if tmp1[i] == 0:\n        tmp1[i] = 10\nm = tmp1.index(min(tmp1))\nans = 0\nfor i in range(5):\n    if i == m:\n        continue\n    elif tmp1[i] == 10:\n        ans += x[i]\n    else:\n        ans += (x[i] + (10 - tmp1[i]))\nprint(ans+x[m])", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "import itertools\na=[int(input()) for _ in range(5)]\ncases=itertools.permutations([x for x in range(5)])\nans=1000\nfor case in cases:\n    time=0\n    for i in range(5):\n        if time%10!=0:\n            time+=10-time%10\n        time+=a[case[i]]\n    ans=min(ans,time)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "from itertools import permutations\nfrom math import ceil\n\ntimes = list(int(input()) for _ in range(5))\norders = list(permutations(times, 5))\nminimum = sum(ceil(time/10)*10 for time in times)\n\nfor order in orders:\n    total = order[0]\n    for i in range(1, 5):\n        total += ceil(order[i]/10)*10\n    minimum = min(minimum, total)\nprint(minimum)\n", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "l = []\nans = 0\nfor i in range(5):\n    x = int(input())\n    ans +=x\n    if x%10 == 0:\n        l.append(0)\n    else:\n        l.append(10-x%10)\nl.sort()\nans +=  sum(l[:4])\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "import math\na = [int(input()) for i in range(5)]\nsum = 0\nr =10\nfor i in range(5):\n  if a[i] % 10 ==0:\n    sum+=a[i]\n  elif a[i] % 10 !=0:\n    r = min(r,a[i]%10)\n    sum+= (10*math.ceil(a[i]/10))\nprint(sum-10+r)", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "ls=[]\nfor i in range(5):\n  ls.append(int(input()))\nrm=10\ntime=0\nfor i in ls:\n  if i%10==0:\n    time+=i\n  else:\n    time+=(i//10+1)*10\n    rm=min(rm,i%10)\ntime+=rm-10\nprint(time)\n", "passed": true, "time": 0.16, "memory": 14292.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\ni = j = k = l = m = 0\nwhile i*10 < A:\n  i = i+1\nwhile j*10 < B:\n  j = j+1\nwhile k*10 < C:\n  k += 1\nwhile l*10 < D:\n  l = l+1\nwhile m*10 < E:\n  m = m+1\na = (i+j+k+l+m)*10\ns = [int(str(A)[-1]),int(str(B)[-1]),int(str(C)[-1]),int(str(D)[-1]),int(str(E)[-1])]\ns_1 = [i for i in s if i != 0]\nif s_1 == []:\n  print(a)\nelse:\n  num = min(s_1)\n  print(a+num-10)", "passed": true, "time": 0.33, "memory": 14332.0, "status": "done"}, {"code": "x = list(map(int, (input() for i in range(5))))\ny = sorted(x, key= lambda x:((x+9)//10)*10-x)\n\ns = 0\nfor z in y[:-1]:\n  s += ((10 + z -1)//10)*10\nprint((s+y[-1]))\n", "passed": true, "time": 0.24, "memory": 14072.0, "status": "done"}, {"code": "import sys\nimport math\n\na = [int(input()) for i in range(5)]\nans = 0\n\nmin = 11\ncheck = True\nfor i in range(5):\n    if (a[i] % 10) < min and (a[i] % 10 != 0):\n        min = (a[i] % 10)\n        check=False\n\nif check:\n    min = 0\n\nb = 100\n\nfor j in range(5):\n\n    if a[j] % 10 == min:\n        b = j\n\nvalue = a.pop(b)\n\nfor x in a:\n    ans += int(math.ceil(x / 10.0)) * 10\n\nans += value\nprint(ans)", "passed": true, "time": 0.23, "memory": 14304.0, "status": "done"}, {"code": "# -*- coding:utf-8 -*-\nA = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\nMENU = [A,B,C,D,E]\n\namari = 0\namari_mod = 10\nans = 0\namari_cnt = 0\n\nfor menu in MENU:\n    if menu%10 < amari_mod and menu%10 != 0:\n        amari = menu\n        amari_mod = menu%10\n\nfor menu in MENU:\n    if menu == amari and amari_cnt==0:\n        ans += menu\n        amari_cnt += 1\n    elif menu % 10 == 0:\n        ans += menu\n    else:\n        menu = menu - menu%10 + 10\n        ans += menu\n\nprint(ans) \n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\nL = [(10 - A%10)%10,(10 - B%10)%10,(10 - C%10)%10,(10 - D%10)%10,(10 - E%10)%10]\nL.sort()\nprint(A+B+C+D+E+L[0]+L[1]+L[2]+L[3])", "passed": true, "time": 0.25, "memory": 14292.0, "status": "done"}, {"code": "a = [int(input()) for _ in range(5)]\nb = [(i-1) % 10  + 1 for i in a]\ncount = sum(((i // 10)+ (1 if i % 10 != 0 else 0))*10 for i in a)\nprint(count-(10-min(b)))", "passed": true, "time": 0.27, "memory": 14216.0, "status": "done"}, {"code": "from decimal import Decimal, ROUND_UP\n\nl = [int(input()) for i in range(5)]\nrl = []\n\nfor i in range(len(l)):\n    rl.append(int(Decimal(str(l[i])).quantize(Decimal('1E1'), rounding=ROUND_UP)))\n\nans = []\nfor j in range(len(rl)):\n    num = sum(rl) - rl[j] + l[j]\n    ans.append(num)\n\nprint(min(ans))", "passed": true, "time": 0.24, "memory": 14096.0, "status": "done"}, {"code": "ls =[]\nfor i in range(5):\n    ls.append(int(input()))\nrm = 10\ntime = 0\nfor i in ls:\n    if i % 10 == 0:\n        time += i\n    else:\n        time += (i//10+1)*10\n        rm = min(rm,i%10)\ntime += rm - 10\nprint(time)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nc=int(input())\nd=int(input())\ne=int(input())\nf=[a,b,c,d,e]\nf.sort()\nx=0\nfor i in range(5):\n  if f[i]%10==0:\n    x=x+f[i]\n  if f[i]%10!=0:\n    x=x+(f[i]//10)*10+10\ng=a-(a//10)*10\nh=b-(b//10)*10\ni=c-(c//10)*10\nj=d-(d//10)*10\nk=e-(e//10)*10\nl=[g,h,i,j,k]\nl.sort()\ny=0\nz=0\nfor i in range(5):\n  if l[i]!=0:\n    y=y+1\n    z=i\n    break\nif y==0:\n  print(x)\nelse:\n  print(x-(10-l[z]))", "passed": true, "time": 0.14, "memory": 14408.0, "status": "done"}, {"code": "from math import ceil\ntime=[int(input())for i in range(5)]\nmod=[i%10 for i in time]\na=124\nres=0\nfor i in range(len(mod)):\n    if mod[i] !=0:\n        a=min(a,mod[i])\nif a==124:\n    a=0\nfor i in range(5):\n    if i==mod.index(a):\n        res+=time[i]\n    else:\n        res+=ceil(time[i]/10)*10\nprint(res)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\n    \nif a % 10 ==0:\n    aa=99\n    aaa = a\nelse:\n    aa=a%10\n    aaa = ((a //10 )+1)*10\n\nif b % 10 ==0:\n    bb=99\n    bbb = b\nelse:\n    bb=b%10\n    bbb = ((b //10 )+1)*10\n\nif c % 10 ==0:\n    cc = 99\n    ccc = c\nelse:\n    cc=c%10\n    ccc = ((c //10 )+1)*10\n\nif d % 10==0:\n    dd = 99\n    ddd = d\nelse:\n    dd = d%10\n    ddd = ((d //10 )+1)*10\n\nif e % 10==0:\n    ee = 99\n    eee = e\nelse:\n    ee = e%10\n    eee = ((e //10 )+1)*10\n\nif min(aa,bb,cc,dd,ee) ==99:\n    print(a+b+c+d+e)\n    return\n\nprint(aaa+bbb+ccc+ddd+eee-(10-min(aa,bb,cc,dd,ee)))", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "import itertools\ndish=[int(input()) for _ in range(5)]\ndishp=list(itertools.permutations(dish,5))\n#print(list(dishp))\nans=sum(dish)*10\n\nfor dp in dishp:\n\ttemp=0\n\tcnt=0\n\tdp=list(dp)\n\twhile len(dp)>0:\n\t\tnow=dp.pop(0)\n\t\tcnt+=1\n\t\tif cnt<5:\n\t\t\tif now%10==0:\n\t\t\t\ttemp+=now\n\t\t\telse:\n\t\t\t\ttemp+=(now//10+1)*10\n\t\telse:\n\t\t\ttemp+=now\n\t\t\t#print(temp,now)\n\t\t\tans=min(ans,temp)\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "dishes = []\nfor i in range(5):\n    dishes.append(int(input()))\n\nwasted_times = []\nfor dish in dishes:\n    wasted_time = (10 - (dish % 10)) % 10\n    wasted_times.append(wasted_time)\n\nwasted_times.sort()\ndel wasted_times[-1]\n\nans = sum(dishes) + sum(wasted_times)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14424.0, "status": "done"}, {"code": "ar = []\nfor i in range(5):\n  ar.append(int(input()))\narr = [10 - i % 10 for i in ar]\nfor i in range(5):\n  if arr[i] == 10:\n    arr[i] = 0\nlast = arr.index(max(arr))\n# print(arr)\ntime = 0\nfor i, x in enumerate(ar):\n  if i != last:\n    time += x + arr[i]\n    # print(time)\ntime += ar[last]\nprint(time)\n", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "import sys\nt=list(zip(*[[int(n[:-1] or 0),int(n[-1])] for n in (list(sys.stdin.read().split()))]))\nprint((sum(t[0])+len((u:=sorted(filter(lambda n:n>0,t[1])))[:0:-1]))*10+(u and u[0] or 0))", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "import math\n\na = [int(input()) for i in range(5)]\nsub = 0\ncnt = 0\n\nfor i in a:\n    if i%10!=0 and sub<(10-i%10):\n        sub = 10-i%10\n    cnt += math.ceil(i/10)*10\nprint(cnt-sub)", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "l = [int(input()) for i in range(5)]\nlm = l\nlm = [(i+9)//10*10 for i in l]\nlr = [10-i%10 if i%10!=0 else 0 for i in l]\nprint((sum(lm)-max(lr)))\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "menu = []\nfor i in range(5):\n    menu.append(input())\n\nmini = 10\na = 0\nfor i in range(5):\n    m = int(menu[i][-1])\n    if 1 <= m <= mini:\n        mini = m\n        a = i\n\nmenu = [int(s) for s in menu]\nans = 0\nfor i in range(5):\n    if i == a:\n        ans += menu[i]\n    else:\n        ans += -(-menu[i]//10)*10\n\nprint(ans)", "passed": true, "time": 0.23, "memory": 14232.0, "status": "done"}, {"code": "A=[int(input()) for _ in range(5)]\nprint((sum(((x-1)//10+1)*10 for x in A)-max((10-x%10)%10 for x in A)))\n", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "from itertools import permutations\nimport math\nmenu=5\ntimes=[int(input()) for i in range(menu)]\norders=list(permutations(times))\nminimum=sum(math.ceil(time/10)*10 for time in times)\nfor order in orders:\n    total=order[0]\n    for i in range(1,menu):\n        total+=math.ceil(order[i]/10)*10\n    minimum=min(minimum,total)\nprint(minimum)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "list_dish = [input() for i in range(0, 5)]\nlist_disit1 = [int(list_dish[i][-1]) for i in range(0, 5)]\nmarking = 0\nmin = 9\nans = 0\nfor i in range(0, 5):\n    if list_disit1[i] != 0 and list_disit1[i] <= min:\n        marking = i\n        min = list_disit1[i]\nfor i in range(0, 5):\n    if i == marking:\n        ans += int(list_dish[i])\n    else: ans += -(-int(list_dish[i]) // 10) * 10\nprint(ans)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "list_x=[]\nfor i in range(5):\n    list_x.append(int(input()))\nmax_dif=0\nmax_dif_index=0\nfor i in range(5):\n    if (10-list_x[i]%10>max_dif) and (list_x[i]%10!=0):\n        max_dif=10-list_x[i]%10\n        max_dif_index=i\nans=list_x.pop(max_dif_index)\ntmp=0\nfor i in range(4):\n    tmp+=list_x.pop()\n    while(tmp%10!=0):\n        tmp+=1\nans+=tmp\nprint(ans)", "passed": true, "time": 0.14, "memory": 14408.0, "status": "done"}, {"code": "import itertools\nA = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\nls = [A,B,C,D,E]\nls2 = []\nfor i in itertools.permutations(ls,5):\n  ls2.append(list(i))\nminimum = 10**5\nfor i in ls2:\n  now = 0\n  for j in range(5):\n    if j == 0:\n      now += i[j]\n    else:\n      if now % 10 == 0:\n        now += i[j]\n      else:\n        now = 10 * (now//10+1)\n        now += i[j]\n  if now < minimum:\n    minimum = now\nprint(minimum)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "import math\nA = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\n\na = math.ceil(A * 0.1) * 10\nb = math.ceil(B * 0.1) * 10\nc = math.ceil(C * 0.1) * 10\nd = math.ceil(D * 0.1) * 10\ne = math.ceil(E * 0.1) * 10\n\nlst1 = [A, B, C, D, E]\nlst2 = [a, b, c, d ,e]\n\nlast = 0\nmax_num = -1\n\nfor i, j in zip(lst1, lst2):\n    if j - i  > max_num:\n        last = i\n        max_num = j - i\n\nans = 0\nk = lst1.index(last)\n\nfor n in range(5):\n    if n == k:\n        ans += lst1[n]\n    else:\n        ans += lst2[n]\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "a = [int(input()) for i in range(5)]\n\nmn = a[0] % 10\nfor i in a:\n    if i % 10 == 0:\n        continue\n    mn = min(mn, i % 10)\n\nfor i in a:\n    if i % 10 == mn:\n        mn = i\n        break\n\n\nans = 0\nfor i in a:\n    if i == mn:\n        ans += i\n        mn = -1\n        continue\n    t = ((i + 9) // 10) * 10\n    ans += t\n\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "def ans123(A:int, B:int, C:int, D:int, E:int):\n    serch_list=[A,B,C,D,E]\n    number=0\n    minnum=0\n    min=1\n    if A%10==0 and B%10==0 and C%10==0 and D%10==0 and E%10==0:\n        return A+B+C+D+E\n    else:\n     for i in range(5):\n        x=serch_list[i]\n        if x%10!=0 and -(-x//10)*10-x>=min:\n            min=-(-x//10)*10-x\n            number=i\n            minnum=x\n     del serch_list[number]\n    return -(-serch_list[0]//10)*10+-(-serch_list[1]//10)*10+-(-serch_list[2]//10)*10+-(-serch_list[3]//10)*10+minnum\n\nA=int(input())\nB=int(input())\nC=int(input())\nD=int(input())\nE=int(input())\nprint((ans123(A,B,C,D,E)))\n", "passed": true, "time": 0.22, "memory": 14164.0, "status": "done"}, {"code": "ans=0\nt=[]\ntmp=10\nfor i in range(5):\n    t.append(int(input()))\n    if t[i]%10!=0 and t[i]%10<tmp:\n        tmp=t[i]%10\n#print(tmp)\nflg=0\nfor i in range(5):\n    if (t[i]%10!=tmp or flg==1) and t[i]%10==0:\n        ans+=t[i]\n    elif (t[i]%10!=tmp or flg==1) and t[i]%10!=0:\n        ans+=(t[i]//10+1)*10\n    elif t[i]%10==tmp and flg==0:\n        ans+=t[i]\n        flg=1\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "import sys\nimport itertools\n\na = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\nlst = [a, b, c, d, e]\nans = 1 <<10\nfor i in itertools.permutations(lst, 5):\n    cnt = 0\n    for num, j in enumerate(i):\n        if num == 4:\n            cnt += j\n            break\n        if j%10 != 0:\n            cnt += 10 * (j//10) + 10\n        else: cnt += j\n    ans = min(ans, cnt)\n\nprint(ans)\n\n\n", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "import math\nL = []\nS = []\nfor i in range(5):\n    t = int(input())\n    L.append(t)\n    S.append(int(str(t)[-1]))\n\nans = 0\n\nif max(S) == 0:\n    for i in range(5):\n        ans += int(math.ceil(L[i]/10)*10)\n    print(ans)\nelse:\n    if 0 in S:\n        S.remove(0)\n    j = S.index(min(S))\n    for i in range(5):\n        if i == j:\n            ans += L[i]\n        else:\n            ans += int(math.ceil(L[i]/10)*10)\n    print(ans)\n", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "A=int(input())\nB=int(input())\nC=int(input())\nD=int(input())\nE=int(input())\n\nl=[A,B,C,D,E]\ntot = 0\nfor i in l:\n  tot+=-(-i//10)*10\n  \na=max(map(lambda x: -(-x//10)*10-x, l))\n\nprint(tot-a)", "passed": true, "time": 0.19, "memory": 14216.0, "status": "done"}, {"code": "a = [int(input()) for _ in range(5)]\nz = 123\nans = 0\nfor i in a:\n    if i%10!=0:z = min(z,i%10)\n    ans += 10*((i+10-1)//10)\nprint(ans+z-10 if (z!=123) or (z==0) else ans)", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "import math\ns = 0\nm = 10\nfor i in range(5):\n  n = int(input())\n  if n % 10 != 0:\n    m = min(m, int(str(n)[-1]))\n    \n  s += math.ceil( n * 0.1 )\nif m % 10 != 0:\n  s +=  m * 0.1 - 1\nprint((int(s*10)))\n", "passed": true, "time": 0.15, "memory": 14144.0, "status": "done"}, {"code": "list_x=[]\nfor i in range(5):\n    list_x.append(int(input()))\nmax_dif=0\nmax_dif_indx=0\nfor i in range(5):\n    if (10-list_x[i]%10>max_dif) & (list_x[i]%10!=0):\n        max_dif=10-list_x[i]%10\n        max_dif_indx=i\nans=list_x.pop(max_dif_indx)\ntmp=0\nfor i in range(4):\n    tmp+=list_x.pop()\n    while(tmp%10!=0):\n        tmp+=1\nans+=tmp\nprint(ans)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "L = list(int(input()) for _ in range(5))\nans = 0\nfor l in L:\n  if l%10 != 0:\n    ans += (l-(l%10))+10\n  else:\n    ans += l\nm = 0\nfor l in L:\n  cnt = 0\n  if (l%10) == 0:\n    cnt += 1\n  elif m < 10-(l%10):\n    m = 10-(l%10)\nif cnt == 5:\n  m = 0\nprint(ans-m)", "passed": true, "time": 0.14, "memory": 14388.0, "status": "done"}, {"code": "time = [[0]*2 for i in range(5)]\nfor i in range(5):\n  time[i][0] = int(input())\n  if time[i][0]%10 != 0:\n    time[i][1] = 10*(time[i][0]//10+1) - time[i][0]\n\ntime.sort(key=lambda x: x[1])\nans = 0\nfor i in range(4):\n  ans += time[i][0] + time[i][1]\nprint(ans + time[4][0])", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "menu=[]\nmenu2=[]\ntotal=False\nc=0\ntotal2=0\nfor i in range(5):\n    a=int(input())\n    menu.append(a)\n    menu2.append(a%10)\n    if a%10==0:\n        total2+=1\nif total2==5:\n    print(sum(menu))\nelse:\n    for i in range(1,10):\n        for k in range(5):\n            if menu2[k]==i:\n                total=True\n                c=k\n                break\n        if total==True:\n            break\n    print(sum(menu)+10*(4-total2)-sum(menu2)+menu2[c])", "passed": true, "time": 0.15, "memory": 14112.0, "status": "done"}, {"code": "import sys\nfrom itertools import permutations\n\n\ndef answer(a: int, b: int, c: int, d: int, e: int) -> int:\n    dishes = [a, b, c, d, e]\n    ans = sys.maxsize\n\n    for p in permutations(list(range(5))):\n        result = 0\n        for i in range(5):\n            dish = dishes[p[i]]\n            if i < 4:\n                mod = dish % 10\n                if mod != 0:\n                    result += 10 - mod\n            result += dish\n        ans = min(ans, result)\n\n    return ans\n\n\ndef main():\n    a, b, c, d, e = (int(input()) for _ in range(5))\n    print((answer(a, b, c, d, e)))\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "V = [int(input()) for _ in range(5)]\n\nv_mod = [x%10 if x%10 != 0 else 10 for x in V]\nmin_mod = min(v_mod)\n\nans = 0\nfor i, v in enumerate(V):\n    ans += v + (10 - v_mod[i])\nans -= (10 - min_mod)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nD = int(input())\nE = int(input())\n\nl = []\nif A%10 > 0:\n  l.append(A%10)\nif B%10 > 0:\n  l.append(B%10)\nif C%10 > 0:\n  l.append(C%10)\nif D%10 > 0:\n  l.append(D%10)\nif E%10 > 0:\n  l.append(E%10)\n  \nans = len(l)*10 + A + B + C + D + E - sum(l)\nif len(l) > 0:\n  ans += min(l) - 10\nprint(ans)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}]