#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, c = 0, dum, dias;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &dum);
    c += dum / k;
    if (dum % k) {
      c++;
    }
  }
  dias = c / 2;
  if (c % 2) {
    dias++;
  }
  printf("%d", dias);
  return 0;
}
