#include <bits/stdc++.h>
using namespace std;
double w[200000];
int main() {
  long long int i, n, m, j, l, sum, temp2;
  double temp, k;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> w[i];
  }
  sum = 0;
  for (i = 0; i < n; i++) {
    temp = w[i] / k;
    temp2 = ceil(temp);
    sum = sum + temp2;
  }
  temp = sum / 2.0;
  temp2 = ceil(temp);
  cout << temp2 << endl;
  return 0;
}
