#include <bits/stdc++.h>
using namespace std;
inline long long intCeil(long long a, long long b) {
  return (a / b) + (a % b != 0);
}
void solve() {
  long long n, k, m;
  cin >> n >> k;
  long long x = n % (2 * k + 1);
  m = intCeil(n, 2 * k + 1);
  cout << m << '\n';
  if (x == 0 || x > k) {
    for (long long i = 0; i < m; i++)
      cout << ((k + 1) + (2 * k + 1) * i) << ' ';
  } else {
    cout << 1 << ' ';
    for (long long i = 0; i < m - 1; i++)
      cout << ((2 * k + 2) + (2 * k + 1) * i) << ' ';
  }
  cout << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long start = clock();
  solve();
  long long end = clock();
  cerr << end - start << " ms" << '\n';
  return 0;
}
