#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > v;
long long a[100010];
char p[100010];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  if (n <= k) {
    cout << 1 << endl;
    cout << 1 << endl;
    return 0;
  }
  vector<long long> v;
  for (long long i = k + 1; i <= n; i += 2 * k + 1) v.push_back(i);
  long long t = 2 * k + v.back() - n + 1;
  if (v.back() + k < n)
    v.push_back(n + t);
  else
    t = 0;
  cout << v.size() << endl;
  for (long long i : v) cout << i - t << " ";
}
