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