#include <bits/stdc++.h>
long long i, j;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  {
    long long n, k, sum = 0, ct = 0;
    cin >> n >> k;
    long long a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n, greater<int>());
    for (int i = 0; i < n; i++) {
      if (a[i] % k == 0) {
        ct += (a[i] / k);
      } else {
        ct += ((a[i] / k) + 1);
      }
    }
    if (ct & 1) {
      cout << (ct / 2) + 1;
    } else
      cout << (ct / 2);
  }
  return 0;
}
