#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int n, k;
  cin >> n >> k;
  vector<long long int> v(n);
  long long int day = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] % k == 0) {
      day = day + (v[i] / k);
    } else {
      day = day + (v[i] / k) + 1;
    }
  }
  if (day % 2 == 0) {
    cout << (day / 2) << "\n";
  } else
    cout << ((day / 2) + 1) << "\n";
  return 0;
}
