#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 500;
int n, k;
int ans;
int a[maxn];
int main() {
  ans = 0;
  scanf("%d%d", &n, &k);
  int index;
  if (n % (2 * k + 1) <= k + 1) {
    index = 1;
  } else {
    index = n % (2 * k + 1) - k;
  }
  if (n % (2 * k + 1) == 0) index = k + 1;
  for (int i = index; i <= n; i += (k * 2) + 1) {
    a[++ans] = i;
  }
  printf("%d\n", ans);
  for (int i = 1; i <= ans; i++) {
    printf("%d ", a[i]);
  }
  return 0;
}
