#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, s = 0, a;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    s += (a + k - 1) / k;
  }
  s = (s + 1) / 2;
  cout << s;
}
