#include <bits/stdc++.h>
int main() {
  int n, m;
  int i;
  int k = 0;
  int a[100000];
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    if (a[i] / m == 0)
      k = k + 1;
    else if (a[i] / m == 1 && a[i] % m == 0)
      k = k + 1;
    else if (a[i] % m == 0) {
      k = k + a[i] / m;
    } else {
      k += a[i] / m + 1;
    }
  }
  printf("%d", (k + 1) / 2);
  return 0;
}
