#include <bits/stdc++.h>
using namespace std;
const int Size = 1024;
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 15;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int num = n / (2 * k + 1) + (n % (2 * k + 1) != 0);
  printf("%d\n", num);
  int tt = 0;
  int pos = (n - (num - 1) * (2 * k + 1) + 1) / 2;
  for (int i = 0; num > i; i++) {
    if (tt++ > 0) printf(" ");
    printf("%d", pos + i * (2 * k + 1));
  }
  printf("\n");
  return 0;
}
