https://i0.wp.com/eblogarithm.com/wp-content/uploads/2017/04/Codeforces-Round-407-Div-2-problem-A-Anastasia-and-pebbles-Solution-in-C1.png?fit=640%2C360

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 113 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: