#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> v;
  int i = 1;
  for (int i = 1; i <= 1 + k; i++) {
    for (int j = i; j <= n; j = j + (2 * k) + 1) {
      v.push_back(j);
      if (n - j <= k) {
        cout << v.size() << endl;
        for (auto c : v) cout << c << " ";
        return 0;
      }
    }
    v.clear();
  }
  return 0;
}
