#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, t;
  cin >> n >> k;
  vector<int> a;
  int i = 0;
  while (i < n) {
    i += k + 1;
    a.push_back(i);
    i += k;
  }
  if (a[a.size() - 1] > n) {
    t = a[a.size() - 1] - n;
    for (int i = 0; i < a.size(); i++) a[i] -= t;
  }
  cout << a.size() << "\n";
  for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
  return 0;
}
