#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  int ans = 1e9;
  ;
  vector<int> moves;
  for (int i = 0; i <= k; i++) {
    int cur = 1;
    vector<int> curMoves({i});
    bool isValid = true;
    for (int j = i + k + 1; j < n; j += 2 * k + 1) {
      cur++;
      if (j + k >= n) isValid = false;
      curMoves.push_back(j + k);
    }
    if (cur < ans && isValid) {
      moves = curMoves;
      ans = cur;
    }
  }
  cout << ans << endl;
  for (auto x : moves) cout << x + 1 << " ";
  cout << endl;
  return 0;
}
