#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, r, k, cnt = 0;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> r;
    cnt += ceil((r * 1.0) / k);
  }
  cnt = ceil(cnt * 1.0 / 2);
  cout << cnt << endl;
}
