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