Cod sursa(job #672399)
Utilizator | Data | 1 februarie 2012 23:47:31 | |
---|---|---|---|
Problema | Zebughil | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<fstream>
using namespace std;
int a[18],s,c,b,i,j=1;
ifstream in("zebughil.in");
ofstream out("zebughil.out");
int main()
{
int n,g;
in>>n>>g;
for(i=1;i<=n;i++)
{
in>>b;
s=s+b;
}
if(s%g==0)
c=s/g;
else
c=s/g+1;
out<<c;
in.close();
out.close();
return 0;
}