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