#include <bits/stdc++.h>
using namespace std;
long long int powfi(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = ((res % p) * (x % p)) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res % p;
}
int main() {
  int n, k, i, j;
  cin >> n >> k;
  vector<int> ans;
  int sz = INT_MAX, startind = 0;
  for (i = 1; i <= k + 1; i++) {
    int dumsize, get = (n - i) / (2 * k + 1);
    int last = i + (2 * k + 1) * get;
    if (last + k >= n)
      dumsize = get + 1;
    else
      dumsize = get + 3;
    if (sz > dumsize) {
      sz = dumsize;
      startind = i;
    }
  }
  for (i = startind; i <= n; i += (2 * k + 1)) {
    ans.push_back(i);
  }
  cout << ans.size();
  cout << "\n";
  for (i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
