#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 1024;
int a[N];
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  int k;
  cin >> k;
  int v = ceil(n * 1.0 / (2 * k + 1));
  int r = n % (2 * k + 1);
  int dif = 2 * k + 1;
  cout << v << "\n";
  if (r > 0) {
    for (int i = (r - 1) / 2 + 1; i <= n; i += dif) {
      cout << i << " ";
    }
  } else {
    for (int i = k + 1; i <= n; i += dif) {
      cout << i << " ";
    }
  }
  return 0;
}
