Sponsors

Tag: problem: (A) Anastasia and pebbles Solve in C

Codeforces Round #407 (Div....

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

Advertisement

spot_img