#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int ans = 0;
  int inp;
  for (int i = 0; i < n; i++) {
    cin >> inp;
    int temp = (inp + k - 1) / k;
    ans += temp;
  }
  cout << (ans + 1) / 2 << endl;
}
