#include <bits/stdc++.h>
int main() {
  size_t n = 0, k = 0;
  std::cin >> n >> k;
  int frame = 1 + k * 2;
  if (frame >= n) {
    std::cout << 1 << std::endl;
    std::cout << (n / 2) + 1 << std::endl;
    return 0;
  }
  int l = n / frame;
  int mod = n % frame;
  if (mod > 0) {
    ++l;
  }
  std::cout << l << std::endl;
  int skewer = 0;
  if (mod > k) {
    skewer = mod % k;
    if (skewer == 0) {
      skewer += k;
    }
  } else {
    skewer = 1 + k - mod;
  }
  if ((mod != 0) && (mod < k) && ((frame * (n / frame)) + skewer > n)) {
    skewer = (skewer - ((frame * (n / frame)) + skewer) - n);
  }
  if (skewer <= 0) {
    skewer = 1;
  }
  for (int count = 0; count < l; ++count) {
    std::cout << skewer << " ";
    skewer += frame;
  }
  std::cout << std::endl;
  return 0;
}
