#include <bits/stdc++.h>
using namespace std;
long long mini(long long a, long long b) {
  if (a > b) return b;
  return a;
}
void solve(long long n, long long k) {
  std::vector<long long> v;
  long long flag = 0;
  for (long long i = 1; i <= k + 1; i++) {
    v.clear();
    v.push_back(i);
    long long j = i;
    while (1) {
      if (j + 2 * k + 1 <= n) {
        v.push_back(j + 2 * k + 1);
        j = j + 2 * k + 1;
      } else {
        if ((j + k) >= n) {
          flag = 1;
          break;
        } else {
          break;
        }
      }
    }
    if (flag == 1) break;
  }
  printf("%llu\n", (long long)v.size());
  for (long long i = 0; i < (long long)v.size(); i++) printf("%llu ", v[i]);
  printf("\n");
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  solve(n, k);
}
