#include <bits/stdc++.h>
using namespace std;
inline int setBit(int N, int pos) { return N = N | (1 << pos); }
inline int resetBit(int N, int pos) { return N = N & ~(1 << pos); }
inline bool checkBit(int N, int pos) { return (bool)(N & (1 << pos)); }
int main() {
  long long n, k, x, sum = 0;
  scanf("%lld %lld", &n, &k);
  while (n--) {
    scanf("%lld", &x);
    sum += (x / k) + (bool)(x % k);
  }
  printf("%lld\n", sum / 2 + (bool)(sum % 2));
  return 0;
}
