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