#include <bits/stdc++.h>
using namespace std;
vector<long long int> ans;
long long int fep(long long int x, long long int y, long long int mod) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, i, k, j, cnt = 0, m = 1000000000;
  cin >> n >> k;
  for (i = 1; i <= k + 1; i++) {
    cnt = 1;
    vector<long long int> v;
    v.push_back(i);
    for (j = i + 2 * k + 1; j <= n; j += 2 * k + 1) v.push_back(j);
    j -= 2 * k + 1;
    if (j >= n - k && v.size() < m) {
      m = v.size();
      ans = v;
    }
  }
  cout << m << endl;
  for (i = 0; i < m; i++) cout << ans[i] << " ";
  return 0;
}
