#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int n, k, t, x = 0, pocket, sop = 0, ans;
  cin >> n >> k;
  while (n--) {
    cin >> t;
    pocket = ceil(((long double)t / k));
    sop = sop + pocket;
  }
  ans = ceil(((long double)sop) / 2);
  cout << ans;
  return 0;
}
