#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int co = 0;
  if (n == 0)
    cout << "0";
  else if (n <= (2 * k + 1)) {
    cout << "1" << endl;
    if (n >= k + 1)
      cout << k + 1;
    else
      cout << n;
  } else {
    int i = 1, flag = 0, prev, next;
    while (i <= k + 1) {
      prev = i;
      vector<int> ve;
      ve.push_back(i);
      while (1) {
        next = prev + 2 * k + 1;
        if (next > n && prev + k + 1 > n) {
          flag = 1;
          break;
        }
        if (next > n && prev + k + 1 <= n) break;
        ve.push_back(next);
        prev = next;
      }
      i++;
      if (flag == 1) {
        cout << ve.size() << endl;
        for (int j = 0; j < ve.size(); j++) cout << ve[j] << " ";
        break;
      }
    }
  }
}
