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