#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, l, n, m;
  scanf("%d%d", &n, &m);
  if (n % (m * 2 + 1) == 0) {
    printf("%d\n", n / (m * 2 + 1));
    for (i = m + 1; i <= n; i += (2 * m + 1)) printf("%d ", i);
  } else {
    printf("%d\n", n / (m * 2 + 1) + 1);
    int kk = (n % (m * 2 + 1)) - m > 0 ? (n % (m * 2 + 1)) - m : 1;
    for (i = kk; i <= n; i += (2 * m + 1)) printf("%d ", i);
  }
  return 0;
}
