#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int t = 2 * k + 1;
  if (k == 0) {
    cout << n << "\n";
    for (int i = 1; i <= n; i++) cout << i << " ";
  } else if (n == 1) {
    cout << 1 << "\n" << 1;
  } else {
    if (t > n) {
      cout << 1 << "\n";
      cout << n / 2;
    } else if (t == n) {
      cout << 1 << "\n";
      cout << k + 1;
    } else if (n % t == 0) {
      cout << n / t << "\n";
      int tem = t / 2 + 1;
      while (tem < n) {
        cout << tem << " ";
        tem = tem + t;
      }
    } else {
      if (n % t == 0)
        cout << n / t << "\n";
      else
        cout << n / t + 1 << "\n";
      int temp = ((n / t + 1) * t - n) % t;
      int s = k + 1;
      s = s - temp / 2;
      for (int i = 1; i <= n / t + 1; i++) {
        cout << s << " ";
        s += t;
      }
    }
  }
  return 0;
}
