#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) {
    long long int n, k;
    cin >> n >> k;
    long long int c = (long long int)ceil((double)n / (2 * k + 1));
    long long int remove = c * (2 * k + 1) - n;
    long long int start = 1;
    long long int end = n;
    if (remove <= k) start += k - remove;
    cout << c << endl;
    if (start > n) start = n;
    while (start <= n) {
      cout << start << " ";
      start += 2 * k + 1;
    }
  }
  return 0;
}
