#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, x;
  while (scanf("%d%d", &n, &k) != EOF) {
    int sum = 0;
    while (n--) {
      scanf("%d", &x);
      sum += (x + k - 1) / k;
    }
    printf("%d\n", (sum + 1) / 2);
  }
  return 0;
}
