#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
void fast() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long int comb(long long int m, long long int n) {
  long long int mat[100][100];
  long long int i, j;
  if (n > m) return 0;
  if ((n == 0) || (m == n)) return 1;
  for (j = 0; j < n; j++) {
    mat[0][j] = 1;
    if (j == 0) {
      for (i = 1; i <= m - n; i++) mat[i][j] = i + 1;
    } else {
      for (i = 1; i <= m - n; i++) mat[i][j] = mat[i - 1][j] + mat[i][j - 1];
    }
  }
  return (mat[m - n][n - 1]);
}
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int x = 0;
  long long int i = 0;
  while (x < n) {
    i++;
    x = x + 2 * m + 1;
  }
  x = x - n;
  long long int s = x;
  cout << i << '\n';
  if (x <= m) {
    s = m - x + 1;
    for (int j = 0; j < i; j++) {
      cout << s << " ";
      s = s + 2 * m + 1;
    }
  } else {
    s = x - m;
    s = m - s + 1;
    for (int j = 0; j < i; j++) {
      cout << s << " ";
      s = s + 2 * m + 1;
    }
  }
}
