#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int range = k * 2 + 1;
  double dr = range;
  double dn = n;
  int step = ceil(dn / dr);
  int i;
  cout << step << endl;
  if (k >= n)
    cout << 1;
  else if (n % range != 0 && n > range) {
    int rem = n % range;
    if (rem > range / 2 + 1) {
      for (i = 1 + rem - ((range / 2) + 1); i <= n; i = i + range)
        cout << i << " ";
    } else {
      for (i = 1; i <= n; i = i + range) cout << i << " ";
    }
  } else {
    for (i = 1 + range / 2; i <= n; i = i + range) cout << i << " ";
  }
  return 0;
}
