#include <bits/stdc++.h>
using namespace std;
int ans = 100000;
int ans_i;
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  if (k == 0) {
    cout << n << endl;
    for (int i = 0; i < n; i++) cout << 1 + i << " ";
    cout << endl;
    return 0;
  }
  if (2 * k + 1 >= n) {
    cout << 1 << endl << (n + 1) / 2 << endl;
    return 0;
  }
  for (int i = 0; i <= k; i++) {
    int cur = i + k + 1;
    if ((n - cur) % (2 * k + 1) == 0) {
      int cur_ans = 1 + (n - cur) / (2 * k + 1);
      if (ans > cur_ans) {
        ans = cur_ans;
        ans_i = i;
      }
    } else if ((n - cur) % (2 * k + 1) >= k + 1) {
      int cur_ans = 2 + (n - cur) / (2 * k + 1);
      if (ans > cur_ans) {
        ans = cur_ans;
        ans_i = i;
      }
    }
  }
  cout << ans << endl;
  int pos = ans_i + 1;
  for (int i = 0; i < ans; i++) {
    cout << pos << " ";
    pos += 2 * k + 1;
  }
}
