Cod sursa(job #3148140)

Utilizator SimifilLavrente Simion Simifil Data 29 august 2023 15:20:48
Problema Grupuri Scor 36
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
ifstream f ("grupuri.in");
ofstream g ("grupuri.out");
int main()
{
    long long s = 0, a;
    long long k, n;
    f >> k >> n;
    for( long long i = 1; i <= n; ++i )
    {
        f >> a;
        s += a;
    }
    if( s % k == 0 )
        g << s / k;
    else
        g << (s - (s%k)) / k;
    return 0;
}