#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int p = 2 * k + 1;
  if (k == n or k > n) {
    cout << 1 << endl;
    cout << n;
  } else {
    while ((n - p) % (2 * k + 1) < k + 1 and (n - p) % (2 * k + 1)) {
      p--;
    }
    if (n % (2 * k + 1) == 0)
      cout << ceil(n / (2 * k + 1)) << endl;
    else
      cout << (int)(n / (2 * k + 1)) + 1 << endl;
    p = p - k;
    while (p <= n) {
      cout << p << " ";
      p += 2 * k + 1;
    }
  }
  return 0;
}
