#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, b;
  cin >> a >> b;
  double sum = 0;
  for (double i = 0; i < a; i++) {
    double x;
    cin >> x;
    sum += ceil(x / b);
  }
  cout.precision(10);
  cout << ceil(sum / 2);
}
