#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long n, k;
  cin >> n >> k;
  if (n <= 2 * k + 1) {
    cout << "1\n" << min(n, k + 1);
  } else {
    long long q = n / (2 * k + 1), r = n % (2 * k + 1);
    vector<long long> ans;
    if (r == 0) {
      for (long long i = 0; i < q; i++) {
        ans.push_back(2 * k + 1);
      }
    } else if (r <= k) {
      long long t = r + 2 * k + 1;
      long long t1 = t / 2, t2 = t - t1;
      ans.push_back(t1);
      for (long long i = 0; i < q - 1; i++) {
        ans.push_back(2 * k + 1);
      }
      ans.push_back(t2);
    } else {
      ans.push_back(r);
      for (long long i = 0; i < q; i++) {
        ans.push_back(2 * k + 1);
      }
    }
    cout << (long long)(ans.size()) << "\n";
    for (long long i = 1; i < (long long)(ans.size()); i++) {
      ans[i] += ans[i - 1];
    }
    for (long long i = 0; i < (long long)(ans.size()) - 1; i++) {
      cout << ans[i] - k << " ";
    }
    if ((long long)(ans.size()) > 1) {
      cout << ans[(long long)(ans.size()) - 2] + k + 1;
    } else {
      cout << ans[0] - k;
    }
  }
}
