#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int temp4;
  int temp = (2 * k) + 1;
  float temp1 = (float)n / temp;
  if (temp1 == (int)temp1) {
    cout << temp1 << endl;
    temp4 = temp1;
  } else {
    cout << (int)temp1 + 1 << endl;
    temp4 = (int)temp1 + 1;
  }
  if (n < k)
    cout << 1;
  else {
    int i = k;
    int temp3 = n - (((2 * k) + 1) * (temp4 - 1));
    if (temp3 <= k) i = temp3 - 1;
    while (i < n) {
      cout << i + 1 << " ";
      i += 2 * k + 1;
    }
  }
}
