#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  double w[n], c = 0;
  for (int i = 0; i < n; i++) {
    cin >> w[i];
    w[i] = w[i] / k;
    w[i] = ceil(w[i]);
    c = c + w[i];
  }
  cout << (long long)(ceil(c / 2));
  return 0;
}
