#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const long long MOD = 1e9 + 7;
const long long INF = 5e18;
const double DINF = 5e14;
const double eps = 1e-10;
const int di[4] = {1, 0, -1, 0}, dj[4] = {0, 1, 0, -1};
int n, k;
ll dp[3010];
int back[3010], it[3010];
vector<int> ans;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n + 1; i++) {
    dp[i] = INF;
  }
  for (int i = 0; i <= k; i++) {
    dp[min(i + k, n - 1)] = 1;
    back[min(n - 1, i + k)] = i + 1;
    it[min(n - 1, i + k)] = i + 1;
    if (dp[n - 1] == 1) {
      cout << 1 << endl;
      cout << i + 1 << endl;
      return 0;
    }
  }
  for (int i = k; i < n; i++) {
    if (dp[min(n - 1, i + k + 1 + k)] > dp[i] + 1) {
      dp[min(n - 1, i + k + 1 + k)] = dp[i] + 1;
      back[min(n - 1, i + k + 1 + k)] = i + 1;
      it[min(n - 1, i + k + 1 + k)] = min(n, i + k + 2);
    }
  }
  cout << dp[n - 1] << endl;
  int cnt = dp[n - 1], now = n - 1;
  while (cnt) {
    ans.emplace_back(it[now]);
    now = back[now] - 1;
    cnt--;
  }
  for (int i = dp[n - 1] - 1; i >= 0; i--) {
    if (i != 0)
      cout << ans[i] << ' ';
    else
      cout << ans[i] << endl;
  }
  return 0;
}
