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

By |2017-04-09T01:00:33+00:00April 9th, 2017|Categories: C/C++, Programming|Tags: , , |

#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; }