#include <bits/stdc++.h>
using namespace std;
vector<int> find(int i, int N, int k) {
  vector<int> s;
  int n = N;
  while (n > 0) {
    n = n - (k * 2 + 1);
    s.push_back(i > N ? N : i);
    i += 2 * k + 1;
  }
  return s;
}
bool isValid(vector<int> &s, int k) {
  int si = int((s).size());
  for (int i = 0; i < si - 1; i++) {
    if (s[i] + k >= s[i + 1] - k) return false;
  }
  return true;
}
int main() {
  int n, k, N;
  while (cin >> N >> k) {
    int init = k + 1;
    vector<int> sols;
    do {
      sols = find(init, N, k);
      init--;
    } while (!isValid(sols, k));
    cout << int((sols).size()) << '\n';
    for (int &a : sols) cout << a << " ";
    cout << '\n';
  }
  return 0;
}
