#include <bits/stdc++.h>
using namespace std;
long long const OD = 1e9 + 7;
int main() {
  long double n, k;
  long long first = 0, second = 0;
  cin >> n >> k;
  vector<double> a;
  for (int i = 0; i < n; i++) {
    long double u;
    cin >> u;
    a.push_back(u);
  }
  reverse(a.begin(), a.end());
  long double days = 0;
  for (int i = 0; i < n; i++) {
    long double o = ceil(a[i] / k);
    days += o;
  }
  days /= 2;
  long long day = ceil(days);
  cout << day % OD;
  return 0;
}
