#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, k, t, a;
  while (cin >> n >> k) {
    t = 0;
    for (i = 0; i < n; i++) {
      cin >> a;
      t += (a + k - 1) / k;
    }
    cout << (t + 1) / 2 << endl;
  }
  return 0;
}
