#include <bits/stdc++.h>
using namespace std;
int a[300007];
bool check(int i, int j) {
  for (auto u = (i); u <= (j); ++u) {
    for (auto v = (u + 1); v <= (j); ++v) {
      if (a[u] == a[v] && v + (v - u) <= j && a[v + (v - u)] == a[u]) return 1;
    }
  }
  return 0;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int cnt = 0;
  for (auto i = (1); i <= (n); i += (2 * k + 1)) ++cnt;
  cout << cnt << endl;
  vector<int> vc;
  for (auto i = (1); i <= (n); i += (2 * k + 1)) vc.emplace_back(i + k);
  if (vc.back() <= n) {
    for (auto i = (0); i <= (cnt - 1); ++i) cout << vc[i] << endl;
    return 0;
  }
  for (auto i = (0); i <= (cnt - 1); ++i)
    cout << vc[i] - (vc[cnt - 1] - n) << endl;
  return 0;
}
