题目链接:Codeforces 439A Devu, the Singer and Churu, the Joker
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n, d, sum = 0, arr[120];
scanf("%d%d", &n, &d);
for(int i = 0; i < n; i++)
{
scanf("%d", &arr[i]);
sum += arr[i];
}
if(sum + (n - 1) * 10 > d)
puts("-1");
else
printf("%d\n", (d - (sum + (n - 1) * 10)) / 5 + (n - 1) * 10 / 5);
return 0;
}