#include <bits/stdc++.h>
int main() {
  int n, k, a[100005], t, i;
  while (scanf("%d%d", &n, &k) != EOF) {
    t = 0;
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      t = t + (a[i] + k - 1) / k;
    }
    printf("%d\n", (t + 1) / 2);
  }
  return 0;
}
