#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
const double pi =
    3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int v = 2 * k + 1;
  if (n <= k + 1)
    printf("1\n1\n");
  else if (n % v == 0) {
    printf("%d\n", n / v);
    int ile = 0, pos = k + 1;
    while (ile < n) {
      printf("%d ", pos);
      pos += v;
      ile += v;
    }
    printf("\n");
  } else if (n % v > k) {
    int r = n % v;
    int pos = 1 + r - (k + 1);
    int ile = r;
    printf("%d\n%d ", n / v + 1, pos);
    pos = ile + k + 1;
    while (ile < n) {
      printf("%d ", pos);
      pos += v;
      ile += v;
    }
    printf("\n");
  } else {
    int res = n * n;
    for (int i = (k + 1); i <= (v); ++i)
      for (int j = (k + 1); j <= (v); ++j)
        if ((n - i - j) >= 0 && (n - i - j) % v == 0)
          res = min(res, 2 + (n - i - j) / v);
    printf("%d\n", res);
    for (int i = (k + 1); i <= (v); ++i)
      for (int j = (k + 1); j <= (v); ++j)
        if ((n - i - j) >= 0 && (n - i - j) % v == 0 &&
            2 + (n - i - j) / v == res) {
          int pos = 1 + i - (k + 1);
          int ile = i;
          printf("%d %d ", pos, n - (j - (k + 1)));
          n -= j;
          pos = ile + k + 1;
          while (ile < n) {
            printf("%d ", pos);
            pos += v;
            ile += v;
          }
          printf("\n");
          return 0;
        }
  }
  return 0;
}
