#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return (b == 0) ? a : gcd(b, a % b);
}
const unsigned int MOD = 1000000007;
template <class T>
T power(T a, long long int n) {
  T res = 1;
  while (n > 0) {
    if (n % 2) res = (res * a);
    a = (a * a), n = n / 2;
  }
  return res;
}
unsigned int factorial(unsigned int n) {
  if (n == 0) return 1;
  return n * factorial(n - 1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, k;
  cin >> n >> k;
  long long int p = 2 * k + 1;
  long long int c = n / p;
  long long int r = n % p;
  if (r == 0) {
    cout << c << endl;
    for (int i = k + 1; i <= n; i += p) cout << i << " ";
  } else {
    if (r <= k) {
      cout << c + 1 << endl;
      for (int i = 1; i <= n; i += p) cout << i << " ";
    } else {
      cout << c + 1 << endl;
      for (int i = k + 1; i <= n; i += p) cout << i << " ";
    }
  }
}
