#include <bits/stdc++.h>
const long long LLINF = (1ll << 63) - 1;
const int INF = (1 << 31) - 1;
const long double PI = 3.141592653589793;
const long double EPS = 1e-15;
const int MOD = 1e9 + 7;
const int MOD2 = 16714589;
const int ENGLISH_ALPHABET_SIZE = 26;
const int N = 1e6 + 1;
const int M = 1e9 + 10;
using namespace std;
int main() {
  int n, k, start = 1;
  cin >> n >> k;
  vector<int> res;
  int div = n / (2 * k + 1), mod = n % (2 * k + 1);
  if (!mod) {
    for (int i = k + 1; i <= n; i += 2 * k + 1) res.push_back(i);
  } else if (div) {
    if (mod > k) {
      for (int i = k + 1; i < n - mod; i += 2 * k + 1) res.push_back(i);
      res.push_back(n - mod + k + 1);
    } else {
      res.push_back(1);
      div--;
      int i = 2 * k + 2;
      for (; div; i += 2 * k + 1, div--) res.push_back(i);
      res.push_back(i);
    }
  } else {
    res.push_back((n + 1) / 2);
  }
  cout << res.size() << endl;
  for (auto e : res) cout << e << " ";
  return 0;
}
