#include <bits/stdc++.h>
using namespace std;
const long long int N1 = 1000010;
const long long int N2 = 2000010;
const long long int mod1 = 1e2 + 7;
const long long int mod2 = 1e9 + 7;
const int N = 1e6 + 6, inf = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> Res;
  for (int i = 1; i <= k + 1; i++) {
    vector<int> vec;
    for (int j = i; j <= n; j += 2 * k + 1) vec.push_back(j);
    if (vec.size() && vec.back() + k >= n) {
      if (Res.size() == 0)
        Res = vec;
      else {
        if (vec.size() < Res.size()) {
          Res = vec;
        }
      }
    }
  }
  if (Res.size()) {
    cout << Res.size() << "\n";
    for (auto x : Res) cout << x << " ";
    cout << "\n";
  } else
    cout << "1\n1\n";
  return 0;
}
