#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int r = n % (2 * k + 1);
  int i;
  if (r >= 1 && r <= k + 1)
    i = 0;
  else
    i = k;
  vector<int> res;
  while (i < n) {
    res.push_back(i);
    i += 2 * k + 1;
  }
  printf("%d\n", (int)res.size());
  for (int j = 0; j < (int)res.size(); ++j) printf("%d ", res[j] + 1);
  return 0;
}
