#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k, ans = 0;
  cin >> n >> k;
  vector<int> a(n);
  for (auto &it : a) cin >> it;
  for (int i = 0; i < n; i++) {
    if (a[i] / k == 0)
      ans++;
    else if (a[i] % k == 0)
      ans += a[i] / k;
    else
      ans += a[i] / k + 1;
  }
  cout << ans / 2 + ans % 2 << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  solve();
}
