#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int w[n];
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> w[i];
  }
  for (int i = 0; i < n; i++) {
    if (w[i] % k == 0) {
      count = count + ((w[i]) / k);
    } else {
      count = count + ((w[i]) / k) + 1;
    }
  }
  cout << (count / 2 + count % 2) << endl;
  return 0;
}
