#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int mini = INT_MAX;
  int index;
  for (int i = 1; i <= k + 1; i++) {
    int r = 1;
    while (i + (r - 1) * ((k << 1) + 1) <= n) r++;
    r--;
    if (i + (r - 1) * ((k << 1) + 1) + k >= n) {
      if (r < mini) {
        mini = r;
        index = i;
      }
    }
  }
  cout << mini << endl;
  for (int i = 1; i <= mini; i++)
    cout << index + (i - 1) * ((k << 1) + 1) << " ";
  cout << endl;
}
