#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& i : v) is >> i;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (auto& i : v) os << i << ' ';
  return os;
}
template <typename T, typename U>
istream& operator>>(istream& is, pair<T, U>& p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& p) {
  os << p.first << ' ' << p.second;
  return os;
}
template <typename T, typename U>
pair<T, U> operator-(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
int main() {
  int n, l;
  cin >> n >> l;
  vector<int> ans;
  int k = 1 + l;
  while (k + l < n) {
    ans.push_back(k);
    k += l * 2 + 1;
  }
  ans.push_back(k);
  if (ans.back() > n) {
    for (auto& u : ans) {
      u -= ans.back() - n;
    }
  }
  cout << ans.size() << '\n' << ans << '\n';
  return 0;
}
