#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int x = b * 2;
  unsigned int s = 0;
  for (int i = 1; i <= a; i++) {
    unsigned int n;
    scanf("%u", &n);
    s += n / b;
    if (n % b > 0) {
      ++s;
    }
  }
  cout << s / 2 + s % 2 << endl;
}
