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