#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> N;
  for (int i = 0; i < n; i++) {
    int e;
    cin >> e;
    N.push_back(e);
  }
  int times = 0;
  for (int s : N) {
    if (s % k != 0) {
      times += s / k + 1;
    } else {
      times += s / k;
    }
  }
  if (times & 1) {
    cout << times / 2 + 1 << endl;
  } else {
    cout << times / 2;
  }
}
