#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int turn = 2 * k + 1;
  if (n % turn == 0)
    cout << n / turn << " ";
  else
    cout << n / turn + 1 << " ";
  double upperbound = (n - 1) % turn + 1;
  int MAXN = 0;
  upperbound /= 2;
  int temp = ceil(upperbound);
  for (int i = min(k + 1, temp); i <= n; i += turn) {
    cout << i << " ";
    MAXN = i;
  }
  if (MAXN + k < n) cout << MAXN + 2 * k + 1;
  return 0;
}
