#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int k;
  cin >> n >> k;
  int first = k;
  vector<int> answers;
  while (first <= n - 1) {
    answers.push_back(first);
    first += 2 * k + 1;
  }
  auto size = n / (k * 2 + 1) + (n % (2 * k + 1) != 0);
  if (answers.size() == size) {
    cout << size << endl;
    for (auto a : answers) cout << a + 1 << " ";
  } else {
    auto dif = first - (n - 1);
    answers.push_back(first);
    cout << size << endl;
    for (auto a : answers) cout << a - dif + 1 << " ";
  }
  int sseewqrwerasa;
  cin >> sseewqrwerasa;
}
