#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
int main() {
  int n, k;
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  ;
  cin >> n >> k;
  for (int i = k + 1; i >= 1; i--) {
    ans.clear();
    int temp = i;
    while (temp <= n) {
      ans.push_back(temp);
      temp += 2 * k + 1;
    }
    if (temp > n + k) {
      break;
    }
  }
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
}
