#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, k, total_pockets = 0, result;
  long long int w;
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) {
    cin >> w;
    if (w % k == 0)
      total_pockets += w / k;
    else
      total_pockets += (w / k) + 1;
  }
  if (total_pockets % 2 == 0)
    result = total_pockets / 2;
  else
    result = (total_pockets / 2) + 1;
  cout << result << endl;
}
