#include <bits/stdc++.h>
using namespace std;
void Speed() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  Speed();
  int n, k, arr;
  cin >> n >> k;
  unsigned long long res = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr;
    if (arr % k == 0)
      res += (arr / k);
    else
      res += (arr / k) + 1;
  }
  if (res % 2 == 0)
    cout << res / 2 << endl;
  else
    cout << (res / 2) + 1 << endl;
  return 0;
}
