#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, x, ans = 0;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    ans += x / k + (bool(x % k));
  }
  printf("%d\n", ans / 2 + (ans & 1));
  return 0;
}
