#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const long long inf = 0x7fffffffffffffff;
const int MAXN = 100010;
int main() {
  int n, k;
  cin >> n >> k;
  int cnt = k * 2 + 1;
  int p = n % cnt;
  if (k)
    p = min(k + 1, (n + 1) / 2);
  else
    p = 1;
  vector<int> ans;
  while (p <= n) {
    ans.push_back(p);
    p += cnt;
  }
  if (p - k <= n) {
    p = p - n;
    for (int &i : ans) i -= p;
    ans.push_back(n);
  }
  cout << ans.size() << endl;
  for (int i : ans) cout << i << " ";
}
