B. Деву-певец и Чуру-комик

public
yeskendir.sultanov Apr 26, 2024 Never 51
Clone
1
n, d = map(int, input().split())
2
t = [int(x) for x in input().split()]
3
s = sum(t) + (n - 1) * 10
4
5
if s <= d:
6
print((n - 1) * 2 + (d - s) // 5)
7
else:
8
print(-1)
9