#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int a[maxn];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int tmp = a[i] / (k << 1);
    if (tmp > 0) {
      ans += tmp;
      a[i] -= tmp * (k << 1);
    }
    if (a[i] == 0) {
      continue;
    }
    a[i] -= k;
    if (a[i] <= 0) {
      i++;
    }
    a[i] -= k;
    if (a[i] > 0) {
      i--;
    }
    ans++;
  }
  cout << ans << endl;
  return 0;
}
