#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, k, l, m, o, p, s = 0, su = 0, s1 = 0, s2 = 0;
  cin >> n >> k;
  m = ceil(n * 1.0 / (2 * k + 1));
  if (m == 1) {
    cout << "1\n" << max(1, (int)ceil((n * 1.0 / 2)));
    return 0;
  }
  l = n % (2 * k + 1);
  cout << m << endl;
  if (l == 0) {
    s = 1 + k;
  } else if (l <= k)
    s = 1 + k - (k - (l - 1));
  else if (l > k)
    s = (1 + k);
  for (i = 0; i < m; i++) {
    if (i == 0) {
      cout << s << " ";
    } else {
      cout << 2 * k + s + 1 << " ";
      s += (2 * k + 1);
    }
  }
  cout << endl;
  return 0;
}
