#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int dp = (2 * k) + 1;
  if (n <= dp) {
    cout << 1 << endl;
    cout << (n + 1) / 2;
    return 0;
  } else {
    int d = n / dp;
    int p = n % dp;
    if (p == 0)
      cout << d << endl;
    else
      cout << d + 1 << endl;
    if (p >= (k + 1) || p == 0) {
      for (int i = 0; i < d; i++) {
        cout << ((dp * i) + (dp + 1) / 2) << " ";
      }
      if (p > 0) cout << ((dp * d) + (dp + 1) / 2);
    } else {
      d--;
      p += dp;
      int h = k + 1;
      cout << 1 << " ";
      for (int i = 0; i < d; i++) {
        cout << (h + (dp * i) + (dp + 1) / 2) << " ";
      }
      cout << (h + (dp * d) + (dp + 1) / 2);
    }
  }
  return 0;
}
