#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, m;
int main() {
  cin >> n >> m;
  int c = -1;
  if (m == 0) {
    cout << n << endl;
    for (int i = 1; i <= n; i++) cout << i << " ";
    cout << endl;
    return 0;
  }
  if (n % (2 * m + 1) == 0) {
    int p = 0;
    cout << n / (2 * m + 1) << endl;
    for (int i = m + 1; i <= n; i += 2 * m + 1) cout << i << " ";
    cout << endl;
    return 0;
  }
  int cur = n % (2 * m + 1);
  if (cur <= m) {
    int ans = 0;
    for (int i = 1; i <= n; i += 2 * m + 1, ans++)
      ;
    cout << ans << endl;
    for (int i = 1; i <= n; i += 2 * m + 1) cout << i << " ";
  } else {
    int cnt = 1, cut = 0;
    cout << n / (2 * m + 1) + 1 << endl;
    for (int i = m + 1; i <= n; i += 2 * m + 1) cout << i << " ";
  }
}
