#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
int main() {
  int N, K;
  while (cin >> N >> K) {
    int st = -1;
    int ed = -1;
    if (N % (2 * K + 1) == 0)
      st = K + 1, ed = N - K;
    else if (N % (2 * K + 1) > K)
      st = K + 1, ed = N - ((N % (2 * K + 1)) - K) + 1;
    else if (N % (2 * K + 1) <= K)
      st = 1, ed = N - (N % (2 * K + 1)) + 1;
    int ans = (N + 2 * K + 1 - N % (2 * K + 1)) / (2 * K + 1);
    if (N % (2 * K + 1) == 0) ans = (N / (2 * K + 1));
    cout << ans << endl;
    for (int i = st; i < ed; i += (2 * K + 1)) cout << i << " ";
    cout << ed << endl;
  }
  return 0;
}
