#include <bits/stdc++.h>
using namespace std;
const int N = 1009;
int n, k;
int ans = 0;
void turn(int num, int k) {
  int max_range = k + k + 1;
  int min_range = k + 1;
  if (num <= max_range) {
    cout << 1 << endl;
    cout << (num < min_range ? 1 : (num - k)) << endl;
    return;
  }
  if (num <= 2 * max_range) {
    cout << 2 << endl;
    for (int i = min_range; i <= max_range; ++i) {
      if (num - i >= min_range && num - i <= max_range) {
        cout << i - k << ' ' << num - (num - i - min_range) << endl;
        return;
      }
    }
  }
  int cnt = num / max_range;
  int re = num % max_range;
  if (re == 0) {
    cout << cnt << endl;
    for (int cur = k + 1; cur <= num; cur += k + k + 1) cout << cur << ' ';
    cout << endl;
    return;
  } else if (re < min_range) {
    re += max_range;
    ans = 2 + cnt - 1;
    cout << ans << endl;
    for (int i = min_range; i <= max_range; ++i) {
      if (re - i >= min_range && re - i <= max_range) {
        cout << i - k;
        int cur = i + k + 1;
        for (int j = 1; j < cnt; ++j, cur += k + k + 1) cout << ' ' << cur;
        cout << ' ' << num - (re - i - min_range) << endl;
        return;
      }
    }
  }
  if (re < max_range) {
    ans = cnt + 1;
    cout << ans << endl;
    cout << re - k;
    int cur = re + k + 1;
    while (cnt--) {
      cout << ' ' << cur;
      cur += k + k + 1;
    }
  }
}
int main(int argc, char const *argv[]) {
  cin >> n >> k;
  if (k == 0) {
    cout << n << endl;
    for (int i = 1; i <= n; ++i) cout << i << ' ';
    return 0;
  }
  turn(n, k);
  return 0;
}
