#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int arr[n];
  if (k == 0) {
    cout << n << '\n';
    for (int i = 1; i <= n; i++) cout << i << " ";
    return 0;
  }
  if (k >= n) {
    cout << 1 << '\n' << 1;
    return 0;
  }
  long long int z = n / ((2 * k) + 1);
  long long int zzz = (2 * k) + 1;
  if (n % zzz != 0) z++;
  if (z == 1) {
    cout << 1 << '\n';
    cout << k + 1;
    return 0;
  }
  for (int i = 1; i <= k + 1; i++) {
    long long int zz = i + (z - 1) * (2 * k + 1);
    if (zz <= n && (n - zz) <= k) {
      cout << z << " " << '\n';
      for (int kk = i; kk <= n; kk += (2 * k + 1)) cout << kk << " ";
      return 0;
    }
  }
}
