您的位置:首页 > 其它

Codeforces 439A Devu, the Singer and Churu, the Joker

2014-06-05 22:37 316 查看
题目链接: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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: