#include <bits/stdc++.h>
using namespace std;
void out(int st, int n, int k) {
  for (int i = st; i <= n; i += 2 * k + 1) {
    cout << i << " ";
  }
}
int main() {
  int n, k;
  cin >> n >> k;
  if (k + 1 >= n) {
    cout << 1 << "\n" << n;
  } else {
    int st = min(n, k + 1);
    int mod = n % (2 * k + 1);
    cout << n / (2 * k + 1) + (mod != 0) << "\n";
    if (mod != 0 && mod < k + 1) {
      st -= (k + 1) - mod;
    }
    out(st, n, k);
  }
  return 0;
}
