#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
void amin(T& a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
void amax(T& a, U b) {
  if (a < b) a = b;
}
const long long INF = 1e18;
const int32_t M = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  long long k;
  cin >> k;
  long long ans = INF, ind = 1;
  for (long long i = 1; i < k + 2; i++) {
    long long start = i;
    long long c = 1;
    while (start + 2 * k + 1 <= n) {
      c++;
      start += 2 * k + 1;
    }
    if (n - start > k) continue;
    if (ans > c) {
      ans = c;
      ind = i;
    }
  }
  cout << ans << "\n";
  while (ind <= n) {
    cout << ind << " ";
    ind += 2 * k + 1;
  }
}
void input() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  input();
  int i = 1;
  { solve(); }
}
