Cod sursa(job #610979)
Utilizator | Data | 30 august 2011 02:02:57 | |
---|---|---|---|
Problema | Grupuri | Scor | 36 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<stdio.h>
long a,n,m,i,t;
long long s=0;
int main()
{freopen("grupuri.in","r",stdin);
freopen("grupuri.out","w",stdout);
scanf("%ld%ld",&n,&m);
for(i=1;i<=m;i++)
scanf("%ld",&a),s+=a,t=a;
if(s/n>=t)
printf("%lld",s/n);
else
printf("%lld",(s-t)/n+1);
return 0;}