#include <bits/stdc++.h>
using namespace std;
int main() {
  int M, N, num = 0, a[100000];
  cin >> M >> N;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < M; i++) {
    if (a[i] % N == 0) {
      num += (a[i] / N);
    } else {
      num += (a[i] / N + 1);
    }
  }
  if (num % 2 == 0)
    num /= 2;
  else
    num = num / 2 + 1;
  cout << num << endl;
  return 0;
}
