#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K;
  scanf("%d%d", &N, &K);
  if (K >= N) {
    printf("1\n1\n");
    return 0;
  }
  if (2 * K + 1 >= N) {
    printf("1\n%d\n", K + 1);
    return 0;
  }
  if (N % (2 * K + 1) == 0) {
    printf("%d\n", N / (2 * K + 1));
    int curr = K + 1;
    bool was = false;
    while (curr <= N) {
      if (was) {
        printf(" ");
      }
      printf("%d", curr);
      curr += 2 * K + 1;
      was = true;
    }
  } else {
    int sz = N / (2 * K + 1) + 1, last = 1;
    printf("%d\n", sz);
    int curr = 1;
    bool was = false;
    vector<int> ans;
    while (curr <= N) {
      ans.push_back(curr);
      last = curr + K + 1;
      curr += 2 * K + 1;
    }
    if (last <= N) {
      for (int trying = 2; trying <= N && last <= N; trying++) {
        curr = trying, last = 1;
        ans.clear();
        while (curr <= N) {
          ans.push_back(curr);
          last = curr + K + 1;
          curr += 2 * K + 1;
        }
      }
      for (int i = 0; i < sz; i++) {
        if (i > 0) {
          printf(" ");
        }
        printf("%d", ans[i]);
      }
      return 0;
    } else {
      for (int i = 0; i < sz; i++) {
        if (i > 0) {
          printf(" ");
        }
        printf("%d", ans[i]);
      }
    }
  }
  printf("\n");
  return 0;
}
