#include <bits/stdc++.h>
using namespace std;
int use[200005];
int main() {
  int n, k;
  cin >> n >> k;
  int temp = k * 2 + 1;
  int ans = n % temp, res;
  int in = ans - k;
  if (in <= 0) in = 1;
  if (!ans) in = k + 1;
  if (n % temp == 0)
    res = n / temp;
  else
    res = n / temp + 1;
  cout << res << endl;
  for (; in <= n; in += (k * 2) + 1) cout << in << " ";
  cout << endl;
  return 0;
}
