#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, ans = 0;
  cin >> n >> k;
  int a[100000 + 10];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    ans += a[i] / k;
    if (a[i] % k != 0) ans++;
  }
  cout << (ans + 1) / 2 << endl;
}
