#include <bits/stdc++.h>
using namespace std;
int n, k;
int calc(int a) {
  int b = (n - a) % (2 * k + 1);
  int ex = 0;
  if (a > 0) ++ex;
  if (b > 0) ++ex;
  return ex + (n - a - b) / (2 * k + 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie();
  cin >> n >> k;
  if (2 * k + 1 >= n) {
    cout << "1\n";
    cout << max(1, n - k) << '\n';
    return 0;
  }
  int ans = INT_MAX;
  vector<int> ansv;
  for (int a = 1; a <= k + 1; ++a) {
    int last = a;
    vector<int> tmp;
    while (last <= n) {
      tmp.push_back(last);
      last += 2 * k + 1;
    }
    last -= 2 * k + 1;
    if (n - last <= k) {
      if (ans > ((int)(tmp).size())) swap(tmp, ansv);
    }
  }
  cout << ((int)(ansv).size()) << '\n';
  for (int i : ansv) cout << i << ' ';
  cout << '\n';
  return 0;
}
