Codeforces Round #407 (Div. 2), problem: (A) Anastasia and pebbles Solution in C

#include<stdio.h>
int main()
{
int n,k;
scanf(“%d%d”,&n,&k);
int a,i,m=0;
for(i=0;i<n;i++)
{
scanf(“%d”,&a);
if(a%k==0)
m+=a/k;
else
m+=a/k+1;
}
printf(“%d”,(m+1)/2);
return 0;
}

(Visited 135 times, 1 visits today)

About the Author:

Leave A Comment