首页 > 其他 > 详细

ZOJ 3778: Talented Chef

时间:2017-07-27 23:58:07      阅读:303      评论:0      收藏:0      [点我收藏+]

ZOJ - 3778

///@author Sycamore, ZJNU
///@accepted_on 2017 - 01 - 17
///
#include<iostream>
#include<algorithm>
#include<algorithm>
using namespace std;
int main()
{
    int T;
    cin >> T;
    while (T--)
    {
        int N, M, t;
        long long sum = 0;
        int m = 0;
        cin >> N >> M;
        while (N--)
        {
            cin >> t;
            m = max(t, m);
            sum += t;
        }
        int ans;
        if (sum%M) ans = sum / M + 1;
        else ans = sum / M;
        ans = max(ans, m);
        cout << ans << endl;
    }
    return 0;
}

 

ZOJ 3778: Talented Chef

原文:http://www.cnblogs.com/zjnu/p/7247991.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!