Cod sursa(job #2334146)

Utilizator TheNextGenerationAyy LMAO TheNextGeneration Data 2 februarie 2019 11:38:36
Problema Zebughil Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <bits/stdc++.h>
//TEST
using namespace std;
ifstream in("zebughil.in");
ofstream out("zebughil.out");
int main()
{
    int t = 3;
    while (t--)
    {
        int n;
        unsigned long long g, s = 0, x;
        in >> n >> g;
        for (int i = 1; i<=n; i++)
            {
                in >> x;
                s+=x;
            }
        out << s/g+(s%g>0) << "\n";
    }
}