#include <bits/stdc++.h>
using namespace std;
int c[10000];
int main() {
  int i, j, n, k, lastBulb;
  long long cmin = -1, cost;
  int a[10], id;
  cin >> n >> k;
  for (i = 0; i <= k; ++i) {
    lastBulb = -1;
    cost = 0;
    for (j = i; j < n; j += 2 * k + 1) {
      cost += 1;
      lastBulb = j + k;
    }
    a[i] = cost;
    if (lastBulb < n - 1) continue;
    if (cmin == -1 || cmin > cost) {
      id = i;
      cmin = cost;
    }
  }
  cout << cmin << "\n";
  for (int i = id; i < n; i += 2 * k + 1) cout << i + 1 << " ";
  return 0;
}
