#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int v[10001], cnt = 0;
  if (n % (k * 2 + 1) == 0) {
    for (int i = k + 1; i <= n; i += 2 * k + 1) v[cnt++] = i;
    cout << cnt << endl;
    for (int i = 0; i < cnt; i++) printf("%d ", v[i]);
    printf("\n");
  } else {
    int p = n % (k * 2 + 1);
    if (p <= k) {
      v[cnt++] = 1;
      for (int i = 1 + 2 * k + 1; i <= n; i += 2 * k + 1) v[cnt++] = i;
      cout << cnt << endl;
      for (int i = 0; i < cnt; i++) printf("%d ", v[i]);
      printf("\n");
    } else {
      v[cnt++] = 1 + p - k;
      for (int i = 1 + (p - k) + 1 + 2 * k; i <= n; i += 2 * k + 1)
        v[cnt++] = i;
      cout << cnt << endl;
      for (int i = 0; i < cnt; i++) printf("%d ", v[i]);
      printf("\n");
    }
  }
}
