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