#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int jump = k * 2 + 1, i = 0;
  int diff = (n - 1) / jump;
  int lastPos = i + diff * jump + k;
  i = lastPos >= (n - 1) ? 0 : (n - 1) - lastPos;
  cout << ((n - 1) / jump) + 1 << "\n";
  for (int j = i + 1; j <= n; j += jump) cout << j << " ";
}
