#include <bits/stdc++.h>
using namespace std;
void dbg() { cerr << '\n'; }
template <typename T, typename... A>
void dbg(T _, A... a) {
  cerr << ' ' << _;
  dbg(a...);
}
const int maxn = 5e5 + 3, INF = 0x3f3f3f3f;
int n, K;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> K;
  int ans = n / (2 * K + 1), res = n % (2 * K + 1);
  cout << ans + (bool)res << '\n';
  if (!res) {
    for (int i = K + 1; i <= n; i += 2 * K + 1) cout << i << ' ';
    cout << '\n';
  } else if (res >= K + 1) {
    cout << res - K << ' ';
    for (int i = res + K + 1; i <= n; i += 2 * K + 1) cout << i << ' ';
    cout << '\n';
  } else {
    for (int i = 1; i <= n; i += 2 * K + 1) cout << i << ' ';
    cout << '\n';
  }
  return 0;
}
