#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned int n, k;
  cin >> n >> k;
  if (n % (2 * k + 1)) {
    cout << n / (2 * k + 1) + 1 << endl;
  } else {
    cout << n / (2 * k + 1) << endl;
  }
  unsigned int inc = 2 * k + 1;
  if (n % inc == 0 || n % inc >= k + 1) {
    for (unsigned int i = inc / 2 + 1; i <= n; i += inc) {
      cout << i << " ";
    }
    cout << endl;
  } else {
    unsigned int pull = (k + 1) - n % inc;
    for (unsigned int i = (inc / 2 + 1) - pull; i <= n; i += inc) {
      cout << i << " ";
    }
    cout << endl;
  }
  return 0;
}
