#include <bits/stdc++.h>
using namespace std;
int n, k, flag[100100], mxx = 0;
int main() {
  int cnt = 0;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    flag[i] += x;
  }
  for (int p = 1; p <= n; p++) {
    cnt += (flag[p] + k - 1) / k;
  }
  printf("%d\n", (cnt + 1) / 2);
  return 0;
}
