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