#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T t) {
  cout << t << endl;
}
long long n = 0, t = 0;
long long small = -1e18, big = 1e18;
const long long mod = 1e9 + 7;
map<long long, long long> occ;
void print2dVec(vector<vector<long long>> v) {
  for (int i = 0; i < v.size(); ++i) {
    cout << i << " : ";
    for (int j = 0; j < v[i].size(); ++j) {
      cout << v[i][j] << " ";
    }
    print("");
  }
}
void printSet(set<long long> s) {
  for (auto itr = s.begin(); itr != s.end(); ++itr) {
    cout << *itr << " ";
  }
}
long long factorial(int n) {
  long long ans = 1;
  for (int i = 1; i <= n; ++i) {
    ans *= i;
  }
  return ans;
}
bool isprime(long long p) {
  for (int i = 2; i * i <= p; ++i) {
    if (p % i == 0 && p != i) {
      return false;
    }
  }
  return true;
}
bool sortVec(const vector<long long>& v1, const vector<long long>& v2) {
  return v1[0] < v2[0];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  ;
  long long k;
  cin >> n >> k;
  if (k >= n) {
    cout << "1\n1\n";
    return 0;
  }
  int i = 1;
  vector<long long> ans;
  for (long long i = k + 1; i >= 1; --i) {
    vector<long long> tmp;
    long long prev = small;
    bool poss = true;
    for (long long j = i; j <= n; j += (2 * k + 1)) {
      tmp.push_back(j);
      if (j - prev < 2 * k + 1 || (j + (2 * k + 1) > n && n - j > k)) {
        poss = false;
        break;
      }
      prev = j;
    }
    if (poss) {
      ans = tmp;
      break;
    }
  }
  print(ans.size());
  for (int i = 0; i < ans.size(); ++i) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
