#include <bits/stdc++.h>
const long long int mod = 1000000007;
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, k;
  cin >> n >> k;
  long long int a = 2 * k + 1;
  long long int b = n % a;
  long long int t = 1;
  if (k == 0) {
    cout << n << endl;
    while (t <= n) {
      cout << t << " ";
      t++;
    }
    return 0;
  }
  if (b == 0) {
    t = k + 1;
    cout << n / a << endl;
    while (t <= n) {
      cout << t << " ";
      t += a;
    }
    return 0;
  } else if (b >= k + 1) {
    t = b - (k + 1) + 1;
    cout << (n / a) + 1 << endl;
    while (t <= n) {
      cout << t << " ";
      t += a;
    }
    return 0;
  } else {
    t = 1;
    cout << (n / a) + 1 << endl;
    while (t <= n) {
      cout << t << " ";
      t += a;
    }
    return 0;
  }
}
