#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> vec;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    vec.push_back(x);
  }
  int ans = 0;
  for (auto o : vec) {
    ans += (o + k - 1) / k;
  }
  cout << (ans + 1) / 2 << endl;
  return 0;
}
