#include <bits/stdc++.h>
using namespace std;
int main() {
  int c = 0, i, j, n, m, l, p, q, k, uy, ti;
  vector<int> op;
  cin >> n >> k;
  j = (2 * k) + 1;
  if (k == 0) {
    uy++;
    cout << n << endl;
    for (i = 0; i < n; i++) {
      cout << i + 1 << " ";
      uy++;
    }
    return 0;
  } else if (j >= n) {
    ti--;
    cout << "1" << endl;
    cout << ((n / 2) + 1);
  } else {
    int frew[100];
    frew[0] = 98;
    for (i = 1; i < n; i++) {
      l = i;
      op.push_back(l);
      l += j;
      while (l <= n) {
        uy++;
        op.push_back(l);
        l += j;
      }
      m = n - (op[(op.size()) - 1]);
      if (m > k)
        op.clear();
      else
        break;
    }
    cout << op.size() << endl;
    for (i = 0; i < op.size(); i++) cout << op[i] << " ";
  }
  return 0;
}
