#include <bits/stdc++.h>
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  if (n % (2 * k + 1)) {
    int ans = n / (2 * k + 1) + 1;
    printf("%d\n", ans);
    int diff = ans * (2 * k + 1) - n;
    if (diff < k + 1) {
      for (int i = 0; i < ans; i++) printf("%d ", (2 * k + 1) * i + k + 1);
    } else {
      diff -= k;
      for (int i = 0; i < ans; i++)
        printf("%d ", (2 * k + 1) * i + k + 1 - diff);
    }
  } else {
    int ans = n / (2 * k + 1);
    printf("%d\n", ans);
    for (int i = 0; i < ans; i++) printf("%d ", (2 * k + 1) * i + k + 1);
  }
  return 0;
}
