#include <bits/stdc++.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;
}
