#include <bits/stdc++.h>
using namespace std;
double X0;
double Y0;
const int MAXN = 5e3 + 3;
int n;
long long int k;
long long int a[100001];
int main() {
  scanf("%d", &n);
  scanf("%lld", &k);
  long long int out;
  for (int i = (int)0; i < (int)n; i++) {
    scanf("%lld", &a[i]);
  }
  out = 0;
  for (int i = (int)0; i < (int)n; i++) {
    out += a[i] / k;
    if (a[i] % k != 0) out++;
  }
  printf("%lld\n", (out + 1) / 2);
  return 0;
}
