#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int main(void) {
  int n, k;
  cin >> n >> k;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int t;
    scanf("%d", &t);
    ans += t / k;
    if (t % k != 0) ans++;
  }
  int res = ans / 2;
  if (ans % 2 == 1) res++;
  cout << res << endl;
  return 0;
}
