#include <bits/stdc++.h>
using namespace std;
int cont[100005];
int main() {
  long long n, k;
  while (cin >> n >> k) {
    if (n < k * 2) {
      if (n == 1) {
        cout << 1 << '\n' << 1 << '\n';
      } else {
        cout << 1 << '\n' << n / 2 + 1 << '\n';
        ;
      }
      continue;
    }
    int gap = (k << 1) + 1;
    vector<int> ans;
    int left = n % gap;
    int now;
    if (left == 0) {
      now = k + 1;
    } else if (left >= k)
      now = left - k + 1;
    else {
      now = 1;
    }
    while (now <= n) {
      ans.push_back(now);
      now += gap;
    }
    cout << ans.size() << '\n';
    for (auto i : ans) {
      cout << i << ' ';
    }
    cout << '\n';
  }
}
