#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, k, r, j, c = 0;
  cin >> n >> k;
  r = (n - 1) / (2 * k + 1) + 1;
  i = 1;
  j = k + 1;
  cout << r << endl;
  long long int a[r + 1];
  while (i <= r) {
    a[i] = j;
    if (j > n) {
      c = j - n;
      break;
    }
    j = j + 2 * k + 1;
    i++;
  }
  i = 1;
  while (i <= r) {
    cout << a[i] - c << " ";
    i++;
  }
  return 0;
}
