#include <bits/stdc++.h>
using namespace std;
const long long inf = 10000000000000000;
long long b, q, l, m, a, ans;
set<long long> s;
int main(void) {
  std::ios::sync_with_stdio(false);
  int n, k, ans = 0;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    ans += a / k + (a % k ? 1 : 0);
  }
  cout << (ans + 1) / 2;
}
