#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  if (k >= (n + 1) / 2) {
    cout << 1 << "\n" << ((n + 1) / 2);
    return 0;
  }
  int x = k + 1;
  while (1) {
    int b = (n - (x + k)) % (2 * k + 1);
    if (b == 0) break;
    x--;
  }
  if (x <= 0) x = 1;
  vector<int> a;
  while (1) {
    a.push_back(x);
    if (x + k >= n) break;
    x = x + 2 * k + 1;
  }
  cout << a.size() << "\n";
  for (long long i = 0; i < a.size(); i++) cout << a[i] << " ";
  return 0;
}
