Long story short, shashlik is Miroslav's favorite food. Shashlik is prepared on several skewers simultaneously. There are two states for each skewer: initial and turned over.

This time Miroslav laid out $n$ skewers parallel to each other, and enumerated them with consecutive integers from $1$ to $n$ in order from left to right. For better cooking, he puts them quite close to each other, so when he turns skewer number $i$, it leads to turning $k$ closest skewers from each side of the skewer $i$, that is, skewers number $i - k$, $i - k + 1$, ..., $i - 1$, $i + 1$, ..., $i + k - 1$, $i + k$ (if they exist). 

For example, let $n = 6$ and $k = 1$. When Miroslav turns skewer number $3$, then skewers with numbers $2$, $3$, and $4$ will come up turned over. If after that he turns skewer number $1$, then skewers number $1$, $3$, and $4$ will be turned over, while skewer number $2$ will be in the initial position (because it is turned again).

As we said before, the art of cooking requires perfect timing, so Miroslav wants to turn over all $n$ skewers with the minimal possible number of actions. For example, for the above example $n = 6$ and $k = 1$, two turnings are sufficient: he can turn over skewers number $2$ and $5$.

Help Miroslav turn over all $n$ skewers.


-----Input-----

The first line contains two integers $n$ and $k$ ($1 \leq n \leq 1000$, $0 \leq k \leq 1000$) — the number of skewers and the number of skewers from each side that are turned in one step.


-----Output-----

The first line should contain integer $l$ — the minimum number of actions needed by Miroslav to turn over all $n$ skewers. After than print $l$ integers from $1$ to $n$ denoting the number of the skewer that is to be turned over at the corresponding step.


-----Examples-----
Input
7 2

Output
2
1 6 

Input
5 1

Output
2
1 4 



-----Note-----

In the first example the first operation turns over skewers $1$, $2$ and $3$, the second operation turns over skewers $4$, $5$, $6$ and $7$.

In the second example it is also correct to turn over skewers $2$ and $5$, but turning skewers $2$ and $4$, or $1$ and $5$ are incorrect solutions because the skewer $3$ is in the initial state after these operations.

Difficulty: EASY
Tags: Dynamic programming

Mathematics

Greedy algorithms
Skill types: Dynamic programming

Greedy algorithms

Starter code:

Solutions:
(n, k) = map(int, input().split())
g = k
k = 2 * k + 1
if n % k == 0:
	d = n // k
else:
	d = n // k + 1
a = [0] * d
s = d * k - n
if g - s < 0:
	a[0] = 1
else:
	a[0] = g - s + 1
for i in range(1, d):
	a[i] = a[i - 1] + k
print(d)
print(*a, sep=' ')


(n, m) = map(int, input().split())
l = []
i = 1
while i <= n:
	l += [i]
	i += m * 2 + 1
if l[-1] < n - m:
	l = []
	i = n - m
	while i > 0:
		l += [i]
		i -= m * 2 + 1
	print(len(l))
	print(*l[::-1])
else:
	print(len(l))
	print(*l)


import math
(n, k) = map(int, input().split())
if k < n // 2:
	x = math.ceil(n / (2 * k + 1)) * (2 * k + 1) - n
	a = min(n, k)
	b = x - a
	total = (n - 2 * (2 * k + 1) + a + b) // (2 * k + 1)
	ans = []
	ans.append(k - a + 1)
	for i in range(total):
		ans.append(ans[-1] + 2 * k + 1)
	ans.append(ans[-1] + 2 * k + 1)
	print(len(ans))
	if b < 0:
		for i in range(len(ans)):
			ans[i] += -b
	print(*ans)
else:
	print(1)
	print(n // 2 + 1)


(n, k) = [int(x) for x in input().split()]
print(int((n - 1) / (k * 2 + 1) + 1))
print(*range(max(k + 1 - ((2 * k + 1) * ((n - 1) // (2 * k + 1) + 1) - n), 1), n + 1, 2 * k + 1))


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(n, k) = invr()
if 2 * k + 1 >= n:
	print(1)
	print(1 + (n - 1) // 2)
	exit(0)
l = 1 + (n - 1) // (2 * k + 1)
pos = []
for i in range(k + 1, 2 * k + 2):
	flag = False
	for j in range(k + 1, 2 * k + 2):
		temp = i + j + (l - 2) * (2 * k + 1)
		if temp == n:
			pos.append(i - k)
			pos.append(n - j + k + 1)
			for x in range(pos[0] + 2 * k + 1, pos[1] - k, 2 * k + 1):
				pos.append(x)
			flag = True
			break
	if flag:
		break
pos.sort()
print(l)
print(*pos)


def shashlik_cooking():
	(n, k) = map(int, input().split())
	(d, r) = (n // (2 * k + 1), n % (2 * k + 1))
	if r == 0:
		print(d)
		print(' '.join(map(str, range(k + 1, n + 1, 2 * k + 1))))
	else:
		print(d + 1)
		diff = ((d + 1) * (2 * k + 1) - n) // 2
		print(' '.join(map(str, range(k + 1 - diff, n + 1, 2 * k + 1))))
shashlik_cooking()


(n, k) = list(map(int, input().split()))
x = 2 * k + 1
r = (n - 1) // x + 1
d = r * x - n
s = max(1, k + 1 - d)
print(r)
print(' '.join([str(s + x * i) for i in range(r)]))


(n, k) = [int(i) for i in input().split()]
turned = []
dif = 0
cur = 1
while cur <= n:
	cur += k
	if cur > n:
		dif = cur - n
	turned.append(cur)
	cur += 1 + k
print(len(turned))
for pos in turned:
	print(pos - dif, end=' ')


(n, k) = map(int, input().split())
rem = n % (2 * k + 1)
if n <= k + 1:
	ans = [1]
elif rem <= k and rem != 0:
	ans = range(k + 1 - (k + 1 - rem), n + 1, 2 * k + 1)
else:
	ans = range(k + 1, n + 1, 2 * k + 1)
print(len(ans))
print(' '.join((str(k) for k in ans)))


from sys import stdin as ulaz
input = ulaz.readline

def sol():
	(n, k) = map(int, input().split())
	naj = float('inf')
	koje = []
	for i in range(k + 1):
		ostale = n - k - 1 - i
		velicina = 1 + 2 * k
		if ostale <= 0:
			naj = 1
			koje = [i + 1]
			break
		if ostale % velicina < k + 1 and ostale % velicina != 0:
			continue
		ponavljanja = ostale // velicina + 2
		if ostale % velicina == 0:
			ponavljanja -= 1
		if ponavljanja < naj:
			naj = ponavljanja
			koje = []
			koje.append(i + 1)
			for e in range(ostale // velicina):
				koje.append(i + 1 + (e + 1) * (2 * k + 1))
			if ostale % velicina != 0:
				koje.append(n - (ostale % velicina - (k + 1)))
	print(naj)
	print(*koje)
sol()


(n, k) = map(int, input().split())
r = n % (2 * k + 1)
out = []
if r >= k + 1:
	cnt = r - k
	while cnt < n:
		out.append(cnt)
		cnt += 2 * k + 1
else:
	cut1 = (r + 2 * k + 1) // 2
	cut2 = (r + 2 * k + 2) // 2
	cnt = cut1 - k
	if cnt == 0:
		cnt += k + 1
	while cnt <= n:
		out.append(cnt)
		cnt += 2 * k + 1
print(len(out))
out = map(str, out)
print(' '.join(out))


def gcd(x, y):
	if y == 0:
		return x
	else:
		return gcd(y, x % y)
(n, k) = [int(w) for w in input().split()]
d = 2 * k + 1
if n <= d:
	s = (n + 1) // 2
else:
	x = n % d
	if x > k:
		s = x - k
	elif x == 0:
		s = k + 1
	else:
		s = 1
r = list(range(s, n + 1, d))
print(len(r))
print(' '.join(map(str, r)))


(n, k) = map(int, input().split())
l = list(range(k + 1, 2 * k + 2))
m = n % l[-1]
st = []
if m == 0:
	i = n // l[-1]
	t = i
	while t > 0:
		st.append(l[0] + (t - 1) * l[-1])
		t -= 1
else:
	i = n // l[-1] + 1
	t = i
	if m not in l:
		m = l[-1] + m - l[0]
		while t > 0:
			st.append(l[0] - k + (t - 1) * l[-1])
			t -= 1
	else:
		while t > 0:
			st.append(m - k + (t - 1) * l[-1])
			t -= 1
print(i)
print(' '.join(sorted(list(map(str, st)))))


(n, k) = map(int, input().split())
d = 2 * k + 1
s = k + 1
X = []
for i in range(1, k + 2):
	X = []
	for j in range(i, n + 1, d):
		X.append(j)
	if X[-1] + k >= n:
		break
print(len(X))
print(*X)


(n, k) = [int(x) for x in input().split()]
if k == 0:
	print(n)
	for i in range(n):
		print(i + 1, end=' ')
	exit()
marks = []
flag = 0
a = []
if n // 2 <= k:
	marks.append(n // 2 + 1)
	flag = 1
else:
	for i in range(k + 1):
		o = [0] * n
		mark = []
		j = i
		while j < n:
			mark.append(j)
			for p in range(j, j + k + 1):
				if p < n:
					o[p] = 1
			for p in range(j - k - 1, j):
				if p >= 0:
					o[p] = 1
			j = j + 2 * k + 1
		try:
			x = o.index(0)
		except:
			a.append((len(mark), len(a), mark))
if flag == 1:
	print(1)
	print(marks[0])
else:
	ss = min(a)
	mark = ss[2]
	print(len(mark))
	for i in range(len(mark)):
		print(mark[i] + 1, end=' ')


(n, k) = map(int, input().split())
x = 2 * k + 1
p = n // x
a = 1
if n % x != 0:
	if n % x > k + 1:
		a = a + n % x - k
	print(p + 1)
	for i in range(a, n + 1, x):
		print(i, end=' ')
else:
	print(p)
	for i in range(k + 1, n + 1, x):
		print(i, end=' ')


from collections import Counter, defaultdict, deque
read = lambda : list(map(int, input().split()))

def solve():
	pass
(n, k) = read()
cnt = n
start = 1
for i in range(1 + k, 1 + 2 * k + 1):
	val = (n - i) % (1 + 2 * k)
	if 1 + k <= val < 1 + 2 * k or val == 0:
		c = 1 + (n - i) // (1 + 2 * k) + (val != 0)
		if c < cnt:
			cnt = c
			start = i - k
res = []
while start < n + 1:
	res.append(start)
	start += 1 + 2 * k
print(cnt)
print(' '.join(map(str, res)))


from math import ceil
from collections import deque
(n, k) = map(int, input().split())
ans = []
ans = deque(ans)
ans = []
r = n % (2 * k + 1)
if r == 0:
	r = 2 * k + 1
if n >= 2 * k + 1:
	if r >= k + 1:
		r = r - k
		for i in range(r, n + 1, 2 * k + 1):
			ans.append(i)
	else:
		for i in range(r, n - k, 2 * k + 1):
			ans.append(i)
		ans.append(n)
	print(len(ans))
	print(*ans)
else:
	print(1)
	print(ceil(n / 2))


(n, k) = list(map(int, input().split()))
flip_n = 2 * k + 1
rem = n % flip_n
order = []
l = 0
r = n
if flip_n >= n:
	order = [n // 2]
else:
	if rem != 0:
		if rem > k:
			order.append(rem - k - 1)
			l = rem
		else:
			order.append(0)
			l = k + 1
			rem += k
			order.append(n - rem + k)
			r = n - rem + 1
	for i in range(max(0, l + k), r, flip_n):
		order.append(i)
print(len(order))
print(*[i + 1 for i in order], sep=' ')


from sys import stdin, stdout
from math import gcd, sqrt, factorial, pi, inf
from collections import deque, defaultdict
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(str(x) + '\n')
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
(n, k) = R()
print((n + 2 * k) // (2 * k + 1))
x = min(n % (2 * k + 1) if n % (2 * k + 1) else inf, k + 1) + k
print(x - k, end=' ')
for _ in range((n + 2 * k) // (2 * k + 1) - 1):
	print(min(n, x + k + 1), end=' ')
	x += 2 * k + 1


(a, b) = map(int, input().split())
z = []
ma = 2 * b + 1
if a <= ma:
	print(1)
	print(a // 2 + a % 2)
else:
	if a % ma == 0:
		z = [b + 1]
		k = b + 1
		while z[-1] < a - b:
			z += [z[-1] + ma]
	else:
		mi = b + 1
		r = 1 + max(0, a % ma - mi)
		z += [r]
		k = r + b
		while 1:
			if a - k <= ma:
				z += [1 + k + b]
				break
			else:
				z += [1 + k + b]
				k += ma
	print(len(z), '\n', *z)


(n, k) = map(int, input().split())
area = 1 + 2 * k
mod_ = n % area
aligned = n + -n % k if k > 0 else n
if mod_ == 0 or mod_ > k:
	X = range(k + 1, aligned + 1, 1 + 2 * k)
else:
	X = range(1, aligned + 1, area)
print(len(X))
print(' '.join(map(str, X)))


(n, k) = map(int, input().split())
if n % (2 * k + 1) == 0:
	cnt = n // (2 * k + 1)
	str_ans = [k + i * 2 * k + i + 1 for i in range(cnt)]
	print(cnt)
	print(' '.join(list(map(str, str_ans))))
else:
	cnt = n // (2 * k + 1)
	ost = n % (2 * k + 1)
	ost = ost // 2
	if ost % 2 != 0:
		ost += 1
	if ost == 0:
		ost = 1
	cnt += 1
	str_ans = [ost]
	n -= k + ost
	idx = ost
	while n > 0:
		idx += 2 * k + 1
		str_ans.append(idx)
		n -= 2 * k + 1
	print(cnt)
	print(' '.join(list(map(str, str_ans))))


a = input().split()
n = int(a[0])
k = int(a[1])
a = n % (2 * k + 1)
b = int(n / (2 * k + 1))
lst = []
if a == 0:
	flag = 0
	cnt = b
	for i in range(b):
		lst.append((2 * k + 1) * i + k + 1)
elif b == 0:
	flag = 1
	cnt = 1
	lst.append(int(a / 2) + 1)
elif a < k + 1:
	cnt = b + 1
	for i in range(cnt):
		lst.append((2 * k + 1) * i + 1)
else:
	cnt = b + 1
	for i in range(cnt):
		lst.append((2 * k + 1) * i + (a - k))
print(cnt)
ii = 0
for i in lst:
	ii += 1
	if ii == len(lst):
		print(i)
		break
	print(i, end=' ')


(n, k) = map(int, input().split())
d = []
g = []
y = n
l = 0
for i in range(k + 1, k * 2 + 1):
	d.append(i)
if k == 0:
	print(n)
	for i in range(n):
		print(i + 1, end=' ')
elif k >= n:
	print(1)
	print(n)
elif k * 2 + 1 >= n:
	print(1)
	print(n // 2 + 1)
else:
	while n >= k * 2 + 1:
		l += 1
		n -= k * 2 + 1
		g.append(k * 2 + 1)
	if n > 0 and n not in d:
		h = k * 2 + 1
		while n not in d or h not in d:
			n += 1
			h -= 1
		print(l + 1)
		print(h - k, end=' ')
		p = h
		for i in range(l - 1):
			print(p + k + 1, end=' ')
			p += 2 * k + 1
		print(y - (n - k - 1), end=' ')
	elif n > 0 and n in d:
		print(l + 1)
		l += 1
		print(n - k, end=' ')
		p = n
		for i in range(l - 1):
			print(p + k + 1, end=' ')
			p = 2 * k + 1 + p
	else:
		p = k + 1
		print(l)
		for i in range(l):
			print(p, end=' ')
			p += 2 * k + 1


(n, k) = list(map(int, input().split()))
max = k * 2 + 1
min = k + 1
if k == 0:
	print(n)
	for x in range(1, n):
		print(x, end=' ')
	print(n)
elif n % max == 0:
	print(int(n / max))
	for x in range(max - k, n + 1, max):
		if x + max >= n:
			print(x)
		else:
			print(x, end=' ')
elif k >= n:
	print(1)
	print(1)
else:
	for i in range(n - min, -1, -1):
		if i % max == 0:
			c = i / max
			r = n - i
			if r >= min and r <= max:
				print(int(c + 1))
				for x in range(r - k, n, max):
					if x + max >= n:
						print(x)
					else:
						print(x, end=' ')
			else:
				for rem in range(0, r + 1):
					if rem >= min and rem <= max and (r - rem >= min) and (r - rem <= max):
						print(int(c + 2))
						for x in range(rem - k, n + 1, max):
							if x + max >= n + 1:
								print(x)
							else:
								print(x, end=' ')
						break
			break


from math import ceil
(n, k) = [int(__) for __ in input().strip().split()]
if k == 0:
	print(n)
	for i in range(n):
		print(i + 1, end=' ')
elif n <= 2 * k + 1:
	print(1)
	print(ceil(n / 2))
else:
	l = []
	co = 0
	arr = [i + 1 for i in range(n)]
	while len(arr) > 0:
		if len(arr) > 2 * k + 1:
			co += 1
			l.append(arr[k])
		elif len(arr) == 2 * k + 1:
			co += 1
			l.append(arr[k])
		elif len(arr) <= 2 * k + 1:
			break
		arr = arr[2 * k + 1:]
	if len(arr) > 0:
		if len(arr) <= k:
			co += 1
			for i in range(len(l)):
				l[i] -= k - len(arr) + 1
			l.append(arr[-1])
		else:
			co += 1
			l.append(arr[k])
	print(co)
	print(' '.join([str(i) for i in l]))


(n, k) = [int(x) for x in input().split()]
z = 0
lst = []
kol = 0
num = n // (k + 1)
for i in range(1, n + 1):
	if z == 0:
		lst.append(i)
		z = k * 2
		kol += 1
		continue
	z -= 1
if lst[-1] + k >= n:
	print(kol)
	lst = [str(x) for x in lst]
	print(' '.join(lst))
elif lst[-1] + k < n:
	print(kol)
	lst = [x + int(k) for x in lst]
	lst = [str(x) for x in lst]
	print(' '.join(lst))


(n, k) = map(int, input().split())
ans = []
if n % (2 * k + 1) >= k + 1 or n % (2 * k + 1) == 0:
	for i in range(n):
		if i % (2 * k + 1) == k:
			ans.append(i)
else:
	ans.append(0)
	for i in range(k + 1, n):
		if i % (2 * k + 1) == 0:
			ans.append(i)
print(len(ans))
for el in ans:
	print(el + 1, end=' ')


import math
(n, k) = map(int, input().split())
l = 2 * k + 1
kol = math.ceil(n / l)
print(kol)
start = k + 1
x = start + l * (kol - 1)
if x > n:
	start -= x - n
while start <= n:
	print(start, end=' ')
	start += l


(n, k) = map(int, input().split())
ret = []
cur = 1
while cur <= n:
	ret.append(cur + k)
	cur += 1 + 2 * k
shift = ret[-1] - n if n < ret[-1] else 0
print(len(ret))
for n in ret:
	print(n - shift, end=' ')


(n, k) = map(int, input().split())
l = 2 * k + 1
if (n - 1) % l > k:
	n -= k
r = [*range(n, 0, -l)]
print(len(r))
print(' '.join(map(str, r)))


(n, k) = map(int, input().split(' '))
l = []
if n % (2 * k + 1) > k or n % (2 * k + 1) == 0:
	i = k + 1
	while i <= n:
		l.append(i)
		i += 2 * k + 1
else:
	i = n % (2 * k + 1)
	while i <= n:
		l.append(i)
		i += 2 * k + 1
print(len(l))
print(' '.join(map(str, l)))


import os
import sys
from io import BytesIO, IOBase

def solution():
	(n, k) = map(int, input().split())
	r = n % (k + k + 1)
	if r == 0:
		s = k + 1
	elif r > k + 1:
		s = r - k + 1
	else:
		s = r
	l = list(range(s, n + 1, 2 * k + 1))
	print(len(l))
	print(*l)

def main():
	testcases = 1
	for _ in range(testcases):
		solution()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def arrinp():
	return list(map(int, input().split(' ')))

def mulinp():
	return map(int, input().split(' '))

def intinp():
	return int(input())
main()


(n, k) = map(int, input().split(' '))
k = min(k, n - 1)
ans = 1234567890
idx = []
for i in range(1, k + 2):
	cur = 0
	cur_idx = []
	for j in range(i, n + 1, 2 * k + 1):
		cur += 1
		cur_idx.append(j)
	if n - cur_idx[-1] > k:
		continue
	if cur < ans:
		ans = cur
		idx = cur_idx
print(ans)
for i in idx:
	print(i, end=' ')


(n, k) = map(int, input().split())
ran = 2 * k + 1
res = [i for i in range(1, n + 1, ran)]
ran1 = n - res[-1]
for i in range(len(res)):
	res[i] += ran1 // 2
print(len(res))
print(' '.join((str(x) for x in res)))


(n, k) = map(int, input().strip().split())
f = 2 * k + 1
g = n // f
h = n % f
if h == 0:
	print(g)
	c1 = k + 1
	print(c1, end=' ')
	for i in range(1, g):
		print(c1 + f * i, end=' ')
	print()
	exit(0)
if h > k:
	print(g + 1)
	e = h - k
	print(e, end=' ')
	for i in range(1, g + 1):
		print(e + f * i, end=' ')
	print()
	exit(0)
if h <= k:
	print(g + 1)
	t = h + 2 * k + 1
	e = 1
	print(1, end=' ')
	for i in range(1, g + 1):
		print(e + f * i, end=' ')
	print()
	exit(0)


(n, k) = map(int, input().split())
ans = []
x = k + 1
while x <= n:
	ans.append(x)
	x += 2 * k + 1
if len(ans) == 0 or ans[-1] < n - k:
	ans.append(x)
delta = ans[-1] - n
delta = max(delta, 0)
print(len(ans))
for elem in ans:
	print(elem - delta, end=' ')


import sys
import math
import collections
lines = sys.stdin.read().splitlines()
(n, k) = [int(x) for x in lines[0].split()]

def two_shampoors(n, k):
	if n - 3 * k - 2 > 0:
		return [k, n - 3 * k - 2]
	else:
		return [n - 2 * k - 2, 0]
if n <= k * 2 + 1:
	print(1)
	print(n // 2 + 1)
elif n <= 4 * k + 2:
	(a, b) = two_shampoors(n, k)
	print(2)
	print(str(a + 1) + ' ' + str(n - b))
else:
	num_shampoors = n // (2 * k + 1) - 1
	if n % (2 * k + 1) == 0:
		num_shampoors -= 1
	(a, b) = two_shampoors(n % (2 * k + 1) + (2 * k + 1) * (1 + (n % (2 * k + 1) == 0)), k)
	indicess = []
	indicess.append(a + 1)
	for i in range(0, num_shampoors):
		indicess.append(a + 1 + (i + 1) * (1 + 2 * k))
	indicess.append(n - b)
	print(len(indicess))
	for i in range(0, len(indicess) - 1):
		print(indicess[i], end=' ')
	print(indicess[-1])


(n, k) = map(int, input().split())
gap = 2 * k + 1
ans = n // gap
if n % gap != 0:
	ans += 1
print(ans)
i = k + 1
x = i + gap * (ans - 1)
if x > n:
	i -= x - n
while i <= n:
	print(i, end=' ')
	i += gap


(n, k) = [int(x) for x in input().split()]
l = n // (2 * k + 1) + (0 if n % (2 * k + 1) == 0 else 1)
al = (2 * k + 1) * l - n
ss = list(range(max(k + 1 - al, 1), n + 1, 2 * k + 1))
print(l)
print(*ss)


from math import ceil
(n, k) = map(int, input().split())
c = 2 * k + 1
cnt = ceil(n / c)
start = k + 1
x = start + c * (cnt - 1)
if x > n:
	start -= x - n
rng = list(range(start, n + 1, c))
print(len(rng))
print(*rng)


import math
(n, k) = map(int, input().split())
p = math.ceil(n / (2 * k + 1))
a = []
t = max(1, k + 1 - (2 * k + 1 - n % (2 * k + 1)))
if n % (2 * k + 1) == 0:
	t = k + 1
for i in range(p):
	a.append(t)
	t += 2 * k + 1
print(p)
print(*a)


(n, k) = map(int, input().split())
one = k * 2 + 1
ans = 0
if n % one == 0:
	ans = n // one
else:
	ans = n // one + 1
print(ans)
cnt = 1
arr = []
t = one // 2 + 1
minus = 0
while cnt <= ans:
	if t > n:
		minus = t - n
	arr += [t]
	t += one
	cnt += 1
for s in arr:
	print('%d' % (s - minus), end=' ')


(n, k) = map(int, input().split())
i = n % (2 * k + 1)
if i == 0:
	i = 2 * k + 1
if i < k + 1:
	i += 2 * k + 1
	i = i // 2 - k
else:
	i = i - k
ans = []
while i <= n:
	ans.append(i)
	i += 2 * k + 1
print(len(ans))
for i in ans:
	print(i, end=' ')


def try_start(start, n, k):
	positions = []
	pos = start
	if pos > n:
		return (1001, [])
	while pos <= n:
		positions.append(pos)
		if pos + 2 * k + 1 <= n:
			pos += 2 * k + 1
			continue
		if pos + k >= n:
			break
		if pos == n:
			break
		pos = n
	return (len(positions), str(positions)[1:-1].replace(',', ''))

def main():
	(n, k) = map(int, input().split())
	denom = 2 * k + 1
	(div, rem) = (n // denom, n % denom)
	moves = div + (rem > 0)
	start = k - rem + 1
	ans = (1001, [])
	for i in range(1, k + 1 + 1):
		current = try_start(i, n, k)
		if current[0] < ans[0]:
			ans = current
	print(ans[0])
	print(ans[1])
main()


(n, k) = list(map(int, input().split(' ')))
(i, D) = (1, k * 2 + 1)
g = []
while True:
	R = k + i
	p = (n - R) % D
	if p == 0 or p >= R:
		div = n / D
		a = int(div)
		b = abs(div) - abs(int(div))
		if b:
			qw = int(n / D) + 1
		else:
			qw = int(n / D)
		for w in range(qw):
			g.append(i)
			i = i + D
	else:
		i += 1
	if p >= R or p == 0:
		break
print(len(g))
for ss in g:
	print(ss, end=' ')
print()


def solve():
	(n, k) = map(int, input().split(' '))
	realk = 2 * k + 1
	turns = int(n / realk)
	if n % realk != 0:
		turns += 1
	print(turns)
	turned = []
	for i in range(0, turns):
		turned.append(i * realk + 1)
	offset = 0
	while turned[turns - 1] + offset + k < n:
		offset += 1
	print(' '.join((str(t + offset) for t in turned)))
solve()


import math
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
(N, K) = invr()
width = 2 * K + 1
cnt = N // width
rem = N % width
if rem >= K + 1 or rem == 0:
	neg = 0
else:
	neg = K + 1 - rem
out = []
out.append(str(K + 1 - neg))
nxt = int(out[-1]) + 2 * K + 1
while nxt <= N:
	out.append(str(nxt))
	nxt = int(out[-1]) + 2 * K + 1
print(len(out))
print(' '.join(out))


(n, k) = map(int, input().split())
a = 2 * k + 1
b = k + 1
flag = False
if n % (2 * k + 1) >= k + 1 or n % (2 * k + 1) == 0:
	ans = n // (2 * k + 1)
	if n % (2 * k + 1) > 0:
		ans += 1
		flag = True
	print(ans)
	i = b
	g = i + k
	ans_c = 0
	while g <= n and ans_c < ans:
		print(i, end=' ')
		ans_c += 1
		g += 2 * k + 1
		i += 2 * k + 1
	if g != n and i <= n:
		print(i)
else:
	ans = 0
	if (n - k - 1) % (2 * k + 1) != 0 and n > k + 1:
		ans += (n - k - 1) // (2 * k + 1) + 1
	elif (n - k - 1) % (2 * k + 1) == 0:
		ans += (n - k - 1) // (2 * k + 1)
	ans += 1
	print(ans)
	print(1, end=' ')
	i = 1
	g = k + 1
	ans_c = 1
	while g <= n and ans_c < ans:
		ans_c += 1
		g += 2 * k + 1
		i += 2 * k + 1
		print(i, end=' ')
	if g != n and i <= n and (ans_c < ans):
		print(i)


from sys import stdin
input = stdin.readline
from heapq import heapify, heappush, heappop, heappushpop
from collections import defaultdict as dd, deque as dq, Counter as C
from math import factorial as f, ceil, gcd, sqrt, log
from bisect import bisect_left as bl, bisect_right as br
from itertools import combinations as c, permutations as p
from math import factorial as f, ceil, gcd, sqrt, log
mi = lambda : map(int, input().split())
ii = lambda : int(input())
li = lambda : list(map(int, input().split()))
mati = lambda r: [li() for _ in range(r)]
lcm = lambda a, b: a * b // gcd(a, b)

def solve():
	(n, k) = mi()
	mx = k * 2 + 1
	rem = n % mx
	ans = []
	if rem == 0:
		for x in range(k + 1, n - k + 2, 2 * k + 1):
			ans.append(x)
	elif rem > k:
		for x in range(rem - k, n + 1, 2 * k + 1):
			ans.append(x)
	else:
		for x in range(rem, n + 1, 2 * k + 1):
			ans.append(x)
	if k == 0:
		ans = [x for x in range(1, n + 1)]
	print(len(ans))
	print(*ans)
for _ in range(1):
	solve()


from sys import exit
(n, k) = map(int, input().split())
if n <= 2 * k + 1:
	print(1)
	print(n // 2 + 1)
	exit(0)
l = 2 * (k + 1)
r = 2 * (2 * k + 1)
cnt = 0
while not l <= n <= r:
	cnt += 1
	l += 2 * k + 1
	r += 2 * k + 1
print(cnt + 2)
m = n - cnt * (2 * k + 1)
a = m // 2
ans = [a - k - 1]
r = ans[0] + k
while r < n - 1:
	if r + k + 1 < n:
		ans.append(r + k + 1)
	r = ans[-1] + k
for i in ans:
	print(i + 1, end=' ')
print()


words = []
for word in input().split():
	words.append(word)
n = int(words[0])
k = int(words[1])
x = 0
cnt = 0
for i in range(0, n, 2 * k + 1):
	x = i
	cnt += 1
while x + k < n - 1:
	x += 1
print(cnt)
for i in range(x, -1, -1 * (2 * k + 1)):
	print(i + 1, sep=' ', end=' ')


(n, k) = [int(v) for v in input().split()]
if 2 * k + 1 >= n:
	ans = [n // 2]
else:
	rem = n % (2 * k + 1)
	if rem == 0:
		ans = range(k, n, 2 * k + 1)
	else:
		ans = range(rem // 2, n, 2 * k + 1)
print(len(ans))
print(' '.join((str(v + 1) for v in ans)))


def solution(N, K):
	solution = 0
	steps = []
	if N < 2 * K + 2:
		solution = 1
		if N - K < 2:
			steps.append(1)
		else:
			steps.append(N // 2 + 1)
	elif N % (2 * K + 1) == 0:
		solution = int(N / (2 * K + 1))
		steps = list(range(1 + K, N + 1, 2 * K + 1))
	else:
		solution = N // (2 * K + 1) + 1
		if N % (2 * K + 1) > (2 * K + 1) // 2:
			steps = list(range(1 + K, N + 1, 2 * K + 1))
		else:
			steps = list(range(1, N + 1, 2 * K + 1))
	return (solution, steps)
(N, K) = [int(x) for x in input().split()]
(sol, steps) = solution(N, K)
print(sol)
print(*steps)


(n, k) = map(int, input().split())
if n <= k + k + 1:
	print(1)
	print((n + 1) // 2)
else:
	answer = -1
	answer_n = 10 ** 100
	for i in range(min(k + 1, n)):
		t = n - (k + i + 1)
		if t % (k + k + 1) >= k + 1:
			if 2 + t // (k + k + 1) < answer_n:
				answer = i + 1
				answer_n = 2 + t // (k + k + 1)
		if t % (k + k + 1) == 0:
			if 1 + t // (k + k + 1) < answer_n:
				answer = i + 1
				answer_n = 1 + t // (k + k + 1)
	print(answer_n)
	while answer <= n:
		print(answer, end=' ')
		answer += k + k + 1


from math import ceil
from functools import partial
from operator import add
(n, k) = [int(x) for x in input().split(' ')]
prop = k * 2 + 1
turns = ceil(n / prop)
f = partial(add, max(n - (1 + (turns - 1) * prop) - k, 0))
ans = [f(1 + prop * turn) for turn in range(0, turns)]
print(turns)
print(*ans)


(n, k) = map(int, input().split())
if n <= k * 2 + 1:
	print(1)
	print((n - 1) // 2 + 1)
	exit()
p = n // (k * 2 + 1)
r1 = n % (k * 2 + 1)
r2 = 0
if r1 != 0 and r1 < k + 1:
	p -= 1
	r1 += k
	r2 += k + 1
ind = r1
ans = []
if r1 != 0:
	ans.append(r1 - k)
for i in range(p):
	ans.append(ind + k + 1)
	ind += 2 * k + 1
if r2 != 0:
	ans.append(n - (r2 - k - 1))
print(len(ans))
print(' '.join(map(str, ans)))


(n, m) = map(int, input().split())
q = m * 2 + 1
(a, b) = (n // q, n % q)
if b > 0:
	a += 1
print(a)
e = m * 2 + 1
if a == 1:
	print(n // 2 + 1)
else:
	if b == 0:
		s = m + 1
	else:
		s = q + b
		s -= 2 + 2 * m
		s = s // 2
		s += 1
	for i in range(a):
		print(s, end=' ')
		s += e


def fill(N, i, K):
	ans = []
	location = i
	while True:
		ans.append(location)
		if location + K >= N:
			return ans
		if N - (location + K) <= K:
			return False
		location += 2 * K + 1
	return ans

def sol():
	(N, K) = [int(x) for x in input().split(' ')]
	best = None
	for i in range(1, K + 1 + 1):
		ans = fill(N, i, K)
		if ans != False:
			if best == None or len(ans) < len(best):
				best = ans
	print(len(best))
	print(' '.join([str(x) for x in best]))
sol()


(n, k) = list(map(int, input().split()))
if k == 0:
	print(n)
	for i in range(n):
		print(i + 1, end=' ')
	exit()
if n <= 2 * k + 1:
	print(1)
	if n % 2 == 1:
		print(n // 2 + 1)
	else:
		print(n // 2)
	exit()
c = 0
l = []
r = n % (2 * k + 1)
if r == 0:
	for i in range(k + 1, n + 1, 2 * k + 1):
		c += 1
		l.append(i)
if r <= k and r != 0:
	c += 1
	l.append(1)
	for i in range(2 * k + 2, n + 1, 2 * k + 1):
		c += 1
		l.append(i)
if r >= k + 1 and r != 0:
	c += 1
	l.append(r - k)
	for i in range(r - k + k + k + 1, n + 1, 2 * k + 1):
		c += 1
		l.append(i)
print(c)
print(*l)


(a, b) = map(int, input().split())
c = b * 2 + 1 - a % (b * 2 + 1)
if c == b * 2 + 1:
	c = 0
if c > b:
	c = b
ae = b + 1 - c
e = 0
if c != 0:
	e = 1
bb = a // (b * 2 + 1) + e
print(bb)
aa = ''
for i in range(bb):
	aa = aa + str(ae) + ' '
	ae = ae + b * 2 + 1
print(aa)


import sys
r = sys.stdin.readline().split()
n = int(r[0])
k = int(r[1])
div = n / (k * 2 + 1)
if div % 1 == 0:
	res = k
else:
	div = int(div)
	res = n - div * (k * 2 + 1)
	res = int(res / 2)
i = res
acc = 0
lst = []
while i < n:
	acc += 1
	lst.append(str(i + 1))
	i += k * 2 + 1
if k * 2 + 1 > n:
	acc = 1
	lst = [str(int(n / 2) + 1)]
print(acc)
print(' '.join(lst))


(n, k) = map(int, input().split())
s = 2 * k + 1
ans = -(-n // s)
print(ans)
if ans == 1:
	print(n // 2 + 1)
else:
	r = n % s
	start = 1
	if r == 0:
		start = k + 1
	if r > k + 1:
		start += r - k - 1
	for i in range(ans):
		print(start, end=' ')
		start += s
	print('')


(n, k) = map(int, input().split())
print((n + 2 * k) // (2 * k + 1))
x = 0
arr = []
for i in range(n - k, 0, -(2 * k + 1)):
	x += 1
	arr.append(i)
if x != (n + 2 * k) // (2 * k + 1):
	print(*[i for i in range(1, n + 1, 2 * k + 1)])
	exit()
print(*arr[::-1])


from math import ceil
(n, k) = map(int, input().split())
a = ceil(n / (2 * k + 1))
x = a * (2 * k + 1) - n
if x >= k:
	start = 1
else:
	start = k + 1 - x
print(a)
for i in range(start, n + 1, 2 * k + 1):
	print(i, end=' ')


from math import ceil
(n, k) = map(int, input().split())
t = 2 * k + 1
print(ceil(n / t))
pos = k + 1
rem = n % t
if rem < k + 1 and rem != 0:
	pos -= k + 1 - rem
print(pos, end=' ')
while pos + 2 * k + 1 <= n:
	pos += 2 * k + 1
	print(pos, end=' ')
print(' ')


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def recurse(i, j):
	if i > n:
		if j >= n + 1:
			return 0
		return inf
	ans = inf
	if dp[i][j] != -1:
		return dp[i][j]
	if i - j < k:
		d = min(ans, recurse(i + 1, j))
		if d < ans:
			opti[i][j] = 0
			ans = d
	if j == 1 or i - j == k:
		d = min(ans, recurse(i + k + 1, i + k + 1) + 1)
		if d < ans:
			opti[i][j] = 1
			ans = d
	dp[i][j] = ans
	return ans
(n, k) = get_ints()
dp = [[-1] * 1005 for _ in range(1005)]
opti = [[0] * 1005 for _ in range(1005)]
print(recurse(1, 1))
(i, j) = (1, 1)
while i <= n:
	if opti[i][j] == 0:
		i += 1
	else:
		print(i, end=' ')
		j = i + k + 1
		i = i + k + 1


import math
(n, k) = map(int, input().split())
ans = []
i = k + 1
if i > n:
	print(1)
	print(math.ceil(n / 2))
	return
while i <= n:
	ans.append(i)
	i += 2 * k + 1
if ans[-1] + k < n:
	ned = 2 * k - (n - ans[-1]) + 1
	print(len(ans) + 1)
	for i in ans:
		print(i - ned, end=' ')
	print(n)
else:
	print(len(ans))
	print(*ans)


(n, k) = [int(i) for i in input().split(' ')]
m = 9999999
a = []
for i in range(1, k + 2):
	j = i
	b = []
	c = 0
	f = 0
	while j <= n:
		b.append(j)
		j += 2 * k + 1
		c += 1
	if c <= m and n - (j - 2 * k - 1) <= k:
		m = c
		a = b.copy()
print(m)
print(*a)


from math import ceil
(n, k) = map(int, input().split())
m = ceil(n / (2 * k + 1))
print(m)
a = (m * (2 * k + 1) - n) // 2
j = k - a + 1
print(j, end=' ')
for i in range(m - 1):
	j += 2 * k + 1
	print(j, end=' ')


(n, k) = map(int, input().split())
a = 1000000
af = []
for i in range(k + 1):
	f = []
	for j in range(i + 1, n + 1, 2 * k + 1):
		f.append(j)
	if i + 1 > n:
		break
	if f[-1] + k >= n:
		if a > len(f):
			a = len(f)
			af = f[:]
print(a)
print(*af)


(n, k) = [int(i) for i in input().split()]
p = 0
min_t = 1000000000
a = []
a_p = []
for i in range(1, k + 2):
	p += i + k
	t = 1
	a.append(i)
	while p < n:
		p += k * 2 + 1
		t += 1
		a.append(p - k)
	if min_t > t:
		min_t = t
		a_t = a
	p = 0
	t = 0
	a = []
print(min_t)
for i in a_t:
	print(i, end=' ')


def main():
	(n, k) = map(int, input().split())
	for st in range(0, min(n, k + 1)):
		a = []
		for i in range(st, n, 2 * k + 1):
			a.append(i + 1)
		if n - a[-1] <= k:
			print(len(a))
			print(*a)
			return
main()


from math import ceil
(n, k) = map(int, input().split())
(array, state) = ([], True)
if n % (2 * k + 1) != 0:
	l = n // (2 * k + 1) + 1
else:
	l = n / (2 * k + 1)
for i in range(int(l)):
	if state == True:
		j = -ceil(((2 * k + 1) * l - n) / 2) + k + 1
		array.append(str(j))
		state = False
	else:
		j += 2 * k + 1
		array.append(str(j))
print(int(l))
print(' '.join(array))


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = 1
for i in range(t):
	(n, k) = map(int, sys.stdin.readline().split(' '))
	for kk in range(1, 2):
		if n // 2 <= k:
			print(1)
			print((n + 1) // 2)
			continue
		else:
			ans = []
			r = 1 + k
			while True:
				ans.append(r)
				if r + k >= n:
					break
				else:
					r += 2 * k + 1
		print(len(ans))
		if ans[-1] > n:
			ans[-1] = n
		if len(ans) == 1:
			print(*ans)
		else:
			for j in range(len(ans), 1, -1):
				a = ans[j - 2]
				b = ans[j - 1]
				while a + k >= b - k:
					a -= 1
				ans[j - 2] = a
			print(*ans)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


(n, m) = map(int, input().split())
k = m + 1 - 1
v = n
m1 = m + 1
st = ''
p = False
c = m + m + 1
q = n // c
if n % c != 0:
	q += 1
ar = []
w = n - m - 1
r = w // c
print(q)
if n <= m:
	print((n + 1) // 2)
elif m == 0:
	for i in range(1, n + 1):
		st += str(i) + ' '
	print(st)
else:
	while v % c != 0:
		k += 1
		p = True
		v = n - k
	if p:
		if k > c:
			g = k - m - 1
			h = m + 1
			st += str(g - m) + ' '
			for i in range(g, n):
				if (i - g) % c == (c + 1) // 2:
					st += str(i) + ' '
			st += str(n)
			print(st)
		else:
			g = k
			st += str(k - m) + ' '
			for i in range(k + 1, n + 1):
				if (i - k) % c == (c + 1) // 2:
					st += str(i) + ' '
			print(st)
	else:
		for i in range(1, n + 1):
			if i % c == (c + 1) // 2:
				st += str(i) + ' '
		print(st)


(n, k) = map(int, input().split())
(a, b) = divmod(n, 2 * k + 1)
print(a + (b > 0))
print(*range((b // 2 if b else k) + 1, n + 1, 2 * k + 1))


(n, b) = map(int, input().split())
ans = (n + b * 2) // (b * 2 + 1)
a = []
for i in range(ans):
	a.append(b + 1 + (b * 2 + 1) * i)
while a[-1] > n:
	for i in range(ans):
		a[i] -= 1
print(ans)
print(' '.join(map(str, a)))


(n, k) = map(int, input().split())

def ceil(x, y):
	res = x // y
	if x % y != 0:
		res += 1
	return res
count = ceil(n, 2 * k + 1)
offset = 2 * k * count - n + count
print(count)
center = k + 1 - offset
center = max(1, center)
step = 2 * k + 1
for _ in range(count):
	print(center, end=' ')
	center += step


(n, k) = input().split()
n = int(n)
k = int(k)
l = []
liek = n % (2 * k + 1)
if k == 0:
	for i in range(1, n + 1):
		l.append(i)
elif k >= n:
	l.append(1)
elif liek == 0:
	for j in range(k + 1, n + 1, 2 * k + 1):
		l.append(j)
elif liek <= k + 1:
	for j in range(1, n + 1, 2 * k + 1):
		l.append(j)
elif liek > k + 1:
	for j in range(int(liek // 2), n + 1, 2 * k + 1):
		l.append(j)
print(len(l))
print(' '.join((str(x) for x in l)))


(n, k) = map(int, input().split())
if n % (2 * k + 1) == 0:
	print(n // (2 * k + 1))
	c = []
	a = k + 1
	while a <= n:
		c.append(a)
		a = a + 2 * k + 1
	print(*c)
else:
	d = n % (2 * k + 1)
	c = []
	if d >= k + 1:
		a = d - k
	else:
		a = 1
	count = 1
	while a <= n:
		c.append(a)
		count += 1
		a = a + 2 * k + 1
	print(count - 1)
	print(*c)


import math
(n, k) = [int(x) for x in input().split()]
l = 2 * k + 1
print(math.ceil(n / l))
if n % l == 0 or n % l > k:
	diff = l
	i = k + 1
else:
	diff = -l
	i = n
r = []
while 0 < i <= n:
	r.append(str(i))
	i += diff
print(' '.join(r))


(n, k) = map(int, input().split())
steps = n / (2 * k + 1)
steps = int(steps) if steps == int(steps) else int(steps) + 1
print(steps)
req = steps * (2 * k + 1)
if req - n > k:
	start = 1
	while start <= n:
		print(start, end=' ')
		start += 2 * k + 1
else:
	start = 1 + k
	while start <= n:
		print(start, end=' ')
		start += 2 * k + 1


import sys
import math
(n, k) = map(int, sys.stdin.readline().strip().split())
if k == 0:
	print(n)
	for i in range(1, n + 1):
		print(i, end=' ')
	exit(0)
if k >= n:
	print(1)
	print(1)
	exit(0)
x = math.ceil(n / (2 * k + 1))
print(x)
m = []
p = k + 1
for i in range(x):
	m.append(p)
	p += 2 * k + 1
	if p > n:
		cnt = 0
		while p > n:
			p -= 1
			cnt += 1
		if len(m) < x:
			for j in range(len(m)):
				m[j] -= cnt
			m.append(n)
		break
for i in m:
	print(i, end=' ')


(n, k) = map(int, input().split())
l = []
i = 1
m = []
while i < n + 1:
	l.append(i)
	i = i + 2 * k + 1
j = 1 + k
while j < n + 1:
	m.append(j)
	j = j + 2 * k + 1
if len(m) == len(l):
	print(len(m))
	for i in range(len(l)):
		print(m[i], end=' ')
else:
	print(len(l))
	for i in range(len(l)):
		print(l[i], end=' ')


from math import ceil
(n, k) = [int(x) for x in input().split(' ')]
prop = k * 2 + 1
print(ceil(n / prop))
delta = n % prop
ans = [*range(1 + delta // 2, n + 1, prop)]
while ans[-1] + k < n:
	ans = [x + 1 for x in ans]
print(*ans)


import sys
f = sys.stdin
out = sys.stdout
(n, k) = map(int, f.readline().rstrip('\r\n').split())
if n % (2 * k + 1) == 0:
	out.write(str(n // (2 * k + 1)) + '\n')
	a = k + 1
	for i in range(n // (2 * k + 1)):
		out.write(str(a) + ' ')
		a += 2 * k + 1
elif n % (2 * k + 1) > k:
	out.write(str(n // (2 * k + 1) + 1) + '\n')
	a = k + 1
	for i in range(n // (2 * k + 1) + 1):
		out.write(str(a) + ' ')
		a += 2 * k + 1
else:
	ans = n % (2 * k + 1)
	a = ans
	out.write(str(n // (2 * k + 1) + 1) + '\n')
	for i in range(a, n + 1, 2 * k + 1):
		out.write(str(i) + ' ')


(n, k) = map(int, input().split())
rast = 2 * k + 1
ost = n % rast
celoe = n // rast
count = celoe + (ost != 0)
print(count)
if ost == 0 or ost >= k + 1:
	nach = k + 1
else:
	nach = ost
a = [nach + i * rast for i in range(count)]
print(*a)


from math import ceil
(n, k) = map(int, input().split())
step = 2 * k + 1
m = ceil(n / step)
a = (m * step - n) // 2
b = k - a + 1
print(m)
print(' '.join([str(i) for i in range(b, n + 1, step)]))


import math
(n, k) = map(int, input().split())
a = [0] * (2 * n)
baze = 2 * k + 1
tedad = math.ceil(n / baze)
ezafi = n % baze
print(tedad)
if ezafi == 0:
	start = k + 1
elif ezafi >= k + 1:
	start = ezafi - k
else:
	ezafi_jadid = (ezafi + (2 * k + 1)) // 2
	start = ezafi_jadid - k
for i in range(tedad):
	print(start + i * baze, end=' ')


(n, k) = list(map(int, input().split()))
a = []
z = 0
avail = n // (2 * k + 1)
rem = n % (2 * k + 1)
if rem == 0:
	beg = 1 + k
	a.append(beg)
	for i in range(1, avail):
		beg += 2 * k + 1
		a.append(beg)
elif rem <= k:
	beg = rem
	a.append(beg)
	for i in range(1, avail + 1):
		beg += 2 * k + 1
		a.append(beg)
else:
	beg = 1 + k
	a.append(beg)
	for i in range(1, avail + 1):
		beg += 2 * k + 1
		a.append(beg)
print(len(a))
if k == 0:
	for i in range(1, n + 1, 1):
		print(i, end=' ')
else:
	for i in a:
		print(i, end=' ')
print()


def kr5(n, k, now, l):
	if len(l) > 0:
		now = n - l[-1] - k
	x = k + 1 - now
	if x > 0 and x <= k:
		l = [i - x for i in l]
		l.append(n)
	elif x == 0:
		l.append(n)
	elif x < 0:
		l.append(n - now + k + 1)
	if len(l) > 0:
		print(len(l))
		print(*l)
	elif len(l) == 0 or k > n:
		print(1)
		print(max(1, n // 2))
(n, k) = map(int, input().split())
rem = n // (2 * k + 1)
l = []
for i in range(1, rem + 1):
	if (2 * k + 1) * i - k <= n:
		l.append((2 * k + 1) * i - k)
now = 0
kr5(n, k, now, l)


import math

def solv(total, adj):
	span = 2 * adj + 1
	time = math.ceil(total / span)
	results = []
	if total <= span:
		results.append(int((total + 1) / 2))
	elif adj == 0:
		results = range(1, total + 1)
	else:
		rem = total % span
		start = adj + 1
		if rem < adj + 1 and rem != 0:
			start -= adj + 1 - rem
		current = start
		while current <= total:
			results.append(current)
			current += 2 * adj + 1
	print(time)
	print(' '.join(map(str, results)))
(total, adj) = map(int, input().split())
solv(total, adj)


s = input().split()
(n, k) = (int(s[0]), int(s[1]))
l = 2 * k + 1
m = n % l
if m == 0:
	m = 2 * k + 1
if m <= k + 1:
	pos = 1
else:
	pos = m - k
res = n // l
if n % l != 0:
	res += 1
print(res)
for i in range(res):
	print(pos + l * i, end=' ')
print('')


(n, k) = [int(i) for i in input().split()]
m = n % (k * 2 + 1)
l = n // (k * 2 + 1)
if m != 0:
	l += 1
print(l)
s = list()
d = 0
if l * (2 * k + 1) - k > n:
	d = l * (2 * k + 1) - k - n
for i in range(l):
	r = k + 1 + (2 * k + 1) * i - d
	s.append(r)
print(' '.join((str(i) for i in s)))


(n, k) = map(int, input().split())
b = 2 * k + 1
if b >= n:
	print(1)
	print(n // 2 + 1)
elif n % b == 0:
	print(n // b)
	print(' '.join([str(z) for z in range(n + 1)[k + 1::b]]))
elif n % b > k:
	print(n // b + 1)
	print(' '.join([str(z) for z in range(n + 1)[k + 1::b]]))
else:
	print(n // b + 1)
	print(' '.join([str(z) for z in range(n + 1)[n % b::b]]))


import sys
from collections import defaultdict as dd
from collections import deque
from functools import *
from fractions import Fraction as f
from copy import *
from bisect import *
from heapq import *
from itertools import permutations, product

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def bo(i):
	return ord(i) - ord('A')

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j):
	return 0 <= i < n and 0 <= j < n

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = 1
while t > 0:
	t -= 1
	(n, k) = mi()
	p = 2 * k + 1
	r = n - n // p * p
	f = h = 0
	if r and r < k + 1:
		f = k + 1 - r
	else:
		h = r - k - 1
	c = n // p + int(n % p != 0)
	print(c)
	g = k + 1 - f
	for i in range(n // p):
		print(g + i * (2 * k + 1), end=' ')
	if n % p != 0:
		print(n - h)


import heapq
import math
(n, k) = map(int, input().split())
ans = []
var = math.ceil(n / (2 * k + 1))
pos = k + 1
rem = n % (2 * k + 1)
if n % (2 * k + 1) != 0:
	if rem < k + 1:
		pos -= k + 1 - rem
for i in range(var):
	if pos > n:
		break
	ans.append(pos)
	pos += 2 * k + 1
if rem == k + 1 and ans[-1] != n:
	ans.append(n)
print(len(ans))
print(*ans)


from math import ceil
(n, k) = map(int, input().split())
if n <= k:
	print(1)
	print(1)
else:
	x = ceil(n / (2 * k + 1)) * (2 * k + 1) - n
	print(ceil(n / (2 * k + 1)))
	a = min(k, x)
	c = k - a + 1
	while c <= n:
		print(c, end=' ')
		c += 2 * k + 1


(n, k) = map(int, input().split(' '))
x = n % (2 * k + 1)
arr = []
if x > k + 1:
	i = k
	while i <= n:
		arr.append(i)
		i += 2 * k + 1
	print(len(arr))
	print(*arr)
elif x < k + 1 and x != 0:
	i = x
	while i <= n:
		arr.append(i)
		i += 2 * k + 1
	print(len(arr))
	print(*arr)
else:
	i = k + 1
	while i <= n:
		arr.append(i)
		i += 2 * k + 1
	print(len(arr))
	print(*arr)


import math
(n, k) = (int(_) for _ in input().split(' '))
nr = math.ceil(n / (2 * k + 1))
start = 1
while start + (2 * k + 1) * (nr - 1) + k < n:
	start += 1
toturn = list()
for i in range(nr):
	toturn.append(start + (2 * k + 1) * i)
print(nr)
print(' '.join((str(_) for _ in toturn)))


(n, k) = map(int, input().split(' '))
ma = 2 * k + 1
kma = n // ma
rest = n - kma * ma
backshift = k + 1 - rest if 0 < rest < k + 1 else 0
res = list(range(k + 1 - backshift, 1 + n, ma))
print(len(res))
print(*res)


(n, k) = map(int, input().split())

def g():
	l = 2 * k + 1
	if (n - 1) % l <= k:
		return range(n, 0, -l)
	else:
		return range(n - k, 0, -l)
r = [*g()]
print(len(r))
print(' '.join(map(str, r)))


from math import *
(n, k) = list(map(int, input().split()))
if k >= n:
	print(1)
	print(1)
else:
	arr = []
	count = ceil(n / (2 * k + 1))
	val1 = n % (2 * k + 1)
	if val1 >= k + 1 or val1 == 0:
		i = 0
		val = 0
	else:
		i = 1
		val = k + 1 - (k + 1 - val1) + k
		arr.append(k + 1 - (k + 1 - val1))
	while i < count:
		if val + k + 1 <= n:
			arr.append(val + k + 1)
		else:
			arr.append(n)
		val += 2 * k + 1
		i += 1
	print(count)
	print(*arr)


def main():
	(n, k) = map(int, input().split())
	m = k * 2 + 1
	(x, y) = divmod(n + m - 1, m)
	print(x, ' '.join(map(str, range(y // 2 + 1, n + 1, m))), sep='\n')
main()


(n, k) = [int(i) for i in input().split()]
(places, placee) = (0, 0)
ans = 2 * n
for start in range(k + 1, 2 * k + 2):
	for end in range(k + 1, 2 * k + 2):
		if (n - start - end) % (2 * k + 1) == 0:
			if 2 + (n - start - end) // (2 * k + 1) < ans:
				ans = min(ans, 2 + (n - start - end) // (2 * k + 1))
				places = start
				placee = end
print(ans)
print(places - k, end=' ')
if ans > 1:
	for j in range((n - places - placee) // (2 * k + 1)):
		print(places - k + (j + 1) * (2 * k + 1), end=' ')
	last = placee - k - 1
	print(n - last)


def mi():
	return map(int, input().split(' '))
(n, k) = mi()
t = 2 * k + 1
m = n % t
start = 0
ans = []
if m == 0:
	print(int(n / t))
	start = 2 * k
else:
	print(int(n / t) + 1)
	start = m
for i in range(start // 2 + 1, n + 1, t):
	ans.append(i)
print(*ans)


(n, k) = map(int, input().split())
if n <= 2 * k + 1:
	print(1)
	print(n // 2 + 1)
	return
l = 2 * (k + 1)
r = 2 * (2 * k + 1)
cnt = 0
while not l <= n <= r:
	cnt += 1
	l += 2 * k + 1
	r += 2 * k + 1
print(cnt + 2)
m = n - cnt * (2 * k + 1)
a = m // 2
ans = [a - k - 1]
r = ans[0] + k
while r < n - 1:
	if r + k + 1 < n:
		ans.append(r + k + 1)
	r = ans[-1] + k
for i in ans:
	print(i + 1, end=' ')
print()


import math
(n, k) = map(int, input().split())
s = 0
if 2 * k + 1 >= n:
	print(1)
	print(math.ceil(n / 2))
else:
	for i in range(2 * k + 2, 4 * k + 3):
		if (n - i) % (2 * k + 1) == 0:
			s = i
	p = (n - s) // (2 * k + 1)
	a1 = s // 2
	a2 = s - a1
	print(2 + p)
	print(a1 - k, n - (a2 - k) + 1, end=' ')
	for i in range((n - a1 - a2) // (2 * k + 1)):
		print(a1 + k + 1 + (2 * k + 1) * i, end=' ')


import math
import sys
from bisect import bisect_right, bisect_left, insort_right
from collections import Counter, defaultdict
from heapq import heappop, heappush
from itertools import accumulate
from sys import stdout
R = lambda : map(int, input().split())
(n, k) = R()
if 2 * k + 1 >= n:
	print(1)
	print((n + 1) // 2)
else:
	rem = (n + 2 * k) // (2 * k + 1) * (2 * k + 1) - n
	if not rem:
		c = k + 1
	elif rem < k:
		c = k - rem + 1
	else:
		c = 1
	print((n - c + 1 + 2 * k) // (2 * k + 1))
	while c <= n:
		print(c, end=' ')
		c += 2 * k + 1


import sys

def init_skewers(n):
	return [False] * n

def check_skewers(skewers):
	for s in skewers:
		if not s:
			return False
	return True

def turn_skewers(skewers, i, k):
	n = len(skewers)
	for s in range(i - k, i + k + 1, 1):
		if s >= 0 and s < n:
			skewers[s] = not skewers[s]
(n, k) = (0, 0)
for line in sys.stdin:
	vars = line.split(' ')
	n = int(vars[0])
	k = int(vars[1])
skewers = init_skewers(n)
solution = []
i = 0
while not check_skewers(skewers):
	skewers = init_skewers(n)
	solution = []
	for s in range(i, n, 2 * k + 1):
		turn_skewers(skewers, s, k)
		solution.append(str(s + 1))
	i = i + 1
print(len(solution))
print(' '.join(solution))


(n, k) = [int(x) for x in input().strip().split(' ')]
tam_seccion = min((k << 1) + 1, n)
num_secciones = n // tam_seccion
sobrante_secciones = n % tam_seccion
puntos_de_volteo = list(range(min(k, n - 1), n, tam_seccion))
ultimo_abarcado = puntos_de_volteo[-1] + k
if ultimo_abarcado < n - 1:
	punto_extra = ultimo_abarcado + k + 1
	puntos_de_volteo += [punto_extra]
	puntos_de_volteo = list(map(lambda p: p - max(0, punto_extra - n + 1), puntos_de_volteo))
puntos_de_volteo = list(map(lambda p: p + 1, puntos_de_volteo))
print('{}'.format(len(puntos_de_volteo)))
print('{}'.format(' '.join(map(str, puntos_de_volteo))))


gi = lambda : list(map(int, input().split()))
(n, k) = gi()
if 2 * k + 1 >= n:
	print(1)
	print(n // 2 + 1)
	exit()
if n % (2 * k + 1) == 0:
	cur = k + 1
	ans = []
	while cur <= n:
		ans.append(str(cur))
		cur += 2 * k + 1
	print(len(ans))
	print(' '.join(ans))
	exit()
if k + 1 >= n % (2 * k + 1):
	cur = k + 1 - (k + 1 - n % (2 * k + 1))
else:
	cur = k + 1
ans = []
while cur <= n:
	ans.append(str(cur))
	cur += 2 * k + 1
print(len(ans))
print(' '.join(ans))


(n, k) = map(int, input().split())
one_time = k * 2 + 1
if n % one_time == 0:
	times = n // one_time
else:
	times = n // one_time + 1
ans = []
first_and_last = n - (times - 2) * one_time
first = (first_and_last - (k + 1) * 2) // 2
ans = [first + x * one_time + 1 for x in range(times)]
print(times)
print(*ans)


data = input()
a = [int(n) for n in data.split()]
opt = 0
opt_n = 0
opt_k = 0
opt_l = 0
if a[0] <= 2 * a[1] + 1:
	print(1)
	print(a[0] // 2 + 1)
elif a[0] < 4 * a[1] + 2 and a[0] > 2 * a[1] + 1:
	print(2)
	if a[0] % 2 == 1:
		opt = a[0] // 2
		opt_n = opt - a[1]
		opt_k = opt + 1
		opt_l = opt_k - a[1]
		print(opt_n, a[0] - opt_l + 1)
	if a[0] % 2 == 0:
		opt = a[0] // 2
		opt_n = opt - a[1]
		print(opt_n, a[0] - opt_n + 1)
else:
	i = a[0]
	col = 0
	while i > 4 * a[1] + 2:
		i -= 2 * a[1] + 1
		col += 1
	print(col + 2)
	if i % 2 == 1:
		opt = i // 2
		opt_n = opt - a[1]
		opt_k = opt + 1
		opt_l = opt_k - a[1]
		print(opt_n, end=' ')
		l = opt_n
		for k in range(col):
			l += 2 * a[1] + 1
			print(l, end=' ')
		print(a[0] - opt_l + 1)
	else:
		opt = i // 2
		opt_n = opt - a[1]
		l = opt_n
		print(opt_n, end=' ')
		l = opt_n
		for k in range(col):
			l += 2 * a[1] + 1
			print(l, end=' ')
		print(a[0] - opt_n + 1)


(n, k) = map(int, input().split())
ans = n // (2 * k + 1)
val = n % (2 * k + 1)
if val != 0:
	ans += 1
if (n - 1) % (2 * k + 1) > k:
	n -= k
print(ans)
for j in range(n, 0, -(2 * k + 1)):
	print(j, end=' ')


def main():
	(n, k) = map(int, input().split())
	ans = [k + 1]
	while ans[0] > n:
		ans = [ans[0] - 1]
	while True:
		cur = ans[-1] + 2 * k + 1
		while cur <= n:
			ans.append(cur)
			cur += 2 * k + 1
		if ans[-1] + k >= n:
			print(len(ans))
			print(*ans)
			return
		elif ans[0] - 1 > 0:
			ans[0] -= 1
			ans = [ans[0]]
		else:
			print('ops')
			return
main()


(n, k) = map(int, input().split())
for i in range(k + 1):
	ost = n - (i + 1 + k)
	ost = ost % (k * 2 + 1)
	if k + 1 <= ost or ost == 0:
		ans = []
		for j in range(i, n, k * 2 + 1):
			ans.append(j + 1)
if k == 0:
	ans = [i + 1 for i in range(n)]
print(len(ans))
print(*ans)


import sys
(n, k) = map(int, input().split())
if k >= n:
	print(1)
	print(1)
	sys.exit()
i = k + 1
ans = []
for i in range(k + 1, n + 1, 2 * k + 1):
	ans.append(i)
if ans[-1] + k < n:
	r = ans[-1]
	for i in range(len(ans)):
		ans[i] -= k + 1 - (n - r - k)
	ans.append(n)
print(len(ans))
print(' '.join(map(str, ans)))


[n, k] = list(map(int, input().split()))
if n < k + 1:
	print('1\n1')
elif n < 2 * k + 2:
	print('1\n{}'.format(k + 1))
else:
	rem = n % (2 * k + 1)
	ops = ''
	if rem == 0:
		print(int(n / (2 * k + 1)))
		for i in range(k + 1, n + 1, 2 * k + 1):
			ops += str(i) + ' '
	elif rem < k + 2:
		print(int((n - rem) / (2 * k + 1) + 1))
		for i in range(rem, n + 1, 2 * k + 1):
			ops += str(i) + ' '
	else:
		print(int((n - rem) / (2 * k + 1) + 1))
		for i in range(k + 1, n + 1, 2 * k + 1):
			ops += str(i) + ' '
	print(ops)


import sys
import math
import collections
import heapq
input = sys.stdin.readline
(n, k) = (int(i) for i in input().split())
i = k
if k >= n - 1:
	print(1)
	print(1)
else:
	ans = []
	prev = -1
	print(math.ceil(n / (2 * k + 1)))
	for j in range(math.ceil(n / (2 * k + 1))):
		ans.append(i + 1)
		prev = i
		i += k
		i += k + 1
	for i in range(len(ans)):
		print(ans[i] - max(0, ans[-1] - n), end=' ')


import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, k) = list(map(int, input().split()))
z = 2 * k + 1
if n % z == 0:
	print(n // z)
	for i in range(k + 1, n + 1, z):
		print(i, end=' ')
else:
	print(int(math.ceil(n / z)))
	for i in range(n % z // 2 + 1, n + 1, z):
		print(i, end=' ')


(a, b) = map(int, input().split())
if b == 0:
	print(a)
	for i in range(a):
		print(i + 1)
	exit()
k = b * 2 + 1
n = (a + k - 1) // k
print(n)
if a % k == 0:
	for i in range(b + 1, a, k):
		print(i, end=' ')
else:
	for i in range(min(a % k, b + 1), a + 1, k):
		print(i, end=' ')


(n, k) = map(int, input().split())
step = k * 2 + 1
ranges = n // step
if k == 0:
	print(n)
	print(' '.join([str(i) for i in range(1, n + 1)]))
elif k >= n:
	print(1)
	print(1)
else:
	turn_points = []
	for i in range(1, n + 1, step):
		turn_points.append(i + k)
	if turn_points[-1] > n:
		a = turn_points[-1] - n
		turn_points = [str(el - a) for el in turn_points]
	else:
		turn_points = [str(el) for el in turn_points]
	print(len(turn_points))
	print(' '.join(turn_points))


X = input()
X = X.split()
x = int(X[0])
y = int(X[1])
l = []
m = x % (y * 2 + 1)
if m == 0 or m > y:
	i = y
else:
	i = y - (y + 1 - m)
total = 0
while i < x:
	l.append(str(i + 1))
	i += y * 2 + 1
	total += 1
print(total)
s = ' '.join(l)
print(s)


(n, k) = map(int, input().split())
left = n % (2 * k + 1)
print(n // (2 * k + 1) + (left > 0))
print(*range((1 if left > 0 else k + 1) if left <= k else left - k, n + 1, 2 * k + 1))


import math
(n, k) = map(int, input().split())
if k > n:
	k = n
if k == 0:
	print(n)
	for i in range(n):
		print(i + 1, end=' ')
elif n <= 2 * k + 1:
	print(1)
	if n == k:
		print(n)
	else:
		print(n - k)
else:
	print(int(math.ceil(n / (2 * k + 1))))
	l = [i for i in range(k + 1, 2 * k + 2)]
	d = n % (2 * k + 1)
	if d == 0:
		d += 2 * k + 1
	if d <= k + 1:
		e = l[0] - k
		print(e, end=' ')
		v = int(math.ceil(n / (2 * k + 1))) - 2
		e += 2 * k + 1
		for i in range(v):
			print(e, end=' ')
			e += 2 * k + 1
		print(e)
	else:
		e = l[d - (k + 1)] - k
		print(e, end=' ')
		v = int(math.ceil(n / (2 * k + 1))) - 2
		e += 2 * k + 1
		for i in range(v):
			print(e, end=' ')
			e += 2 * k + 1
		print(e)


(n, k) = map(int, input().split())
ans = [0] * n
dst = 0
m = 2 * k + 1
if n <= m:
	i = min(k + 1, n)
else:
	d = n % m
	if d == 0:
		i = k + 1
	else:
		i = 1 if d <= k else k + 1
for j in range(i, n + 1, m):
	ans[dst] = j
	dst += 1
print(dst)
print(' '.join(map(str, ans[:dst])))


import math
(n, k) = map(int, input().split())
if n <= 2 * k + 1:
	print(1)
	print(math.ceil(n / 2))
	exit()
x = math.ceil(n / (2 * k + 1))
k1 = n % (2 * k + 1)
ans = []
if k1 > 0 and k1 < k + 1:
	print(x)
	l = 2 * k + 1
	for i in range(1, n + 1, l):
		print(i, end=' ')
else:
	print(x)
	l = 2 * k + 1
	for i in range(k + 1, n + 1, l):
		print(i, end=' ')


from math import ceil
(n, k) = map(int, input().split())
(i, j) = (0, n)
_k = 2 * k + 1
m = n % _k
k = k + 1
print(ceil(n / _k))
if m != 0:
	if m >= k:
		print(m - k + 1, end=' ')
		i = m
	elif m < k:
		(l, r) = ((m + _k) // 2, ceil((m + _k) / 2))
		print(l - k + 1, end=' ')
		(i, j) = (l, n - r + k)
while i < n:
	print(min(i + k, j), end=' ')
	i += _k


num_input = input()
num_input = num_input.split(' ')
n = int(num_input[0])
k = int(num_input[1])
res = 0
res_temp = []
min = k + 1
max = 2 * k + 1
if n <= max:
	print(1)
	print(int(n / 2) + 1)
else:
	if n % max == 0:
		res = int(n / max)
		for i in range(0, res):
			res_temp.append(max)
	else:
		res = int(n / max) + 1
		if n % max < min:
			for i in range(0, res - 2):
				res_temp.append(max)
			temp = n % max + max
			res_temp.append(min)
			res_temp.append(temp - min)
		else:
			for i in range(0, res - 1):
				res_temp.append(max)
			res_temp.append(n % max)
	res_temp.insert(0, res_temp.pop())
	print(res)
	dp = []
	dp.append(1 + res_temp[0] - min)
	for i in range(1, len(res_temp)):
		dp.append(dp[i - 1] + max)
	for i in range(0, len(dp)):
		dp[i] = str(dp[i])
	ouput = ' '.join(dp)
	print(ouput)


(n, k) = map(int, input().split())
if n % (2 * k + 1) == 0:
	print(n // (2 * k + 1))
	for i in range(k + 1, n + 1, 2 * k + 1):
		print(i, end=' ')
elif n % (2 * k + 1) >= k + 1:
	print(n // (2 * k + 1) + 1)
	for i in range(k + 1, n + 1, 2 * k + 1):
		print(i, end=' ')
else:
	print(n // (2 * k + 1) + 1)
	for i in range(n % (2 * k + 1), n + 1, 2 * k + 1):
		print(i, end=' ')


(n, k) = map(int, input().split())
it = 2 * k + 1
if n == 1:
	print(1)
	print(1)
else:
	for start in range(k + 1, 2 * k + 2):
		indices = [start - k]
		while start < n:
			start += it
			indices.append(start - k)
		if start - k <= n:
			break
	print(len(indices))
	print(*indices)


def mi():
	return map(int, input().split())
(n, k) = mi()
t = 2 * k + 1
first = (t + 1) // 2
out = []
while first <= n:
	out.append(first)
	first += t
if out == []:
	out = [n]
if len(out) and out[-1] + k < n:
	out.append(n)
if len(out) > 1 and out[-1] - k <= out[-2] + k:
	diff = out[-2] + k - (out[-1] - k) + 1
	if diff:
		for i in range(len(out) - 1):
			out[i] -= diff
print(len(out))
print(*out)


read_numbers = lambda : list(map(int, input().split()))
INF = 1 << 64
(n, k) = read_numbers()
(l, r) = (1 + k, 1 + k * 2)
if r >= n:
	print(1, n // 2 + 1, sep='\n')
	exit(0)
off = m = 0
for i in range(l, r + 1):
	m = (n - i) % r
	if l <= m <= r or m == 0:
		off = i - l
test = [0 for i in range(n)]
print(1 + max((n - off - 1 - k) // r, 0) + (m != 0))
for i in range(off, n, r):
	print(i + 1, end=' ')
print()


import array
(n, k) = map(int, input().split())
kt = array.array('i', (int(0) for i in range(0, 2010)))
kt[0] = 1
for i in range(k + 1, k * 2 + 2):
	kt[i] = 1
(fs, mid, en) = (0, 0, 0)
div = k * 2 + 1
if k == 0:
	print(n)
	for i in range(1, n + 1):
		print(i, end=' ')
elif k >= n / 2:
	print(1)
	print(int(n / 2 + 1))
else:
	for i in range(k + 1, k * 2 + 2):
		if kt[(n - i) % div] == 1:
			fs = i
			en = (n - i) % div
			mid = n - fs - en
			sum = int(0)
			if fs > 0:
				sum += 1
			if en > 0:
				sum += 1
			if mid > 0:
				sum += int(mid / div)
			else:
				sum += 0
			print(sum)
			print(fs - k, end=' ')
			cnt = fs
			while cnt + k + 1 <= n:
				print(cnt + k + 1, end=' ')
				if mid > 0:
					cnt += div
				else:
					cnt += en
			break


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n, k) = I()
if n <= 2 * k + 1:
	print(1)
	print(n // 2 + 1)
else:
	l = []
	kk = 2 * k + 1
	if n % kk == 0:
		for i in range(n // kk):
			l.append(i * kk + k + 1)
	elif n % kk <= k:
		l.append(1)
		nnn = n // kk
		for i in range(nnn):
			l.append(k + 1 + i * kk + k + 1)
	elif n % kk > k:
		nnn = n // kk
		for i in range(nnn + 1):
			l.append(i * kk + k + 1)
	print(len(l))
	print(*l)


import math
(a, b) = map(int, input().split())
times = math.ceil(a / (2 * b + 1))
rem = a % (b * 2 + 1)
f = 0
if (rem <= b) & (b != 0) & (rem != 0):
	f = b + 1 - rem
print(times)
for i in range(b + 1 - f, a + 1, 2 * b + 1):
	print(i, end=' ')


(n, k) = [int(el) for el in input().split()]
if n <= 2 * k + 1:
	print(1)
	print(int(n / 2) + 1)
	raise SystemExit
if n % (2 * k + 1) == 0:
	l = int(n / (2 * k + 1))
else:
	l = int(n / (2 * k + 1)) + 1
ost = n % (2 * k + 1)
if ost == 0:
	start = k + 1
else:
	start = int((ost - 1) / 2) + 1
print(l)
l = []
for i in range(start, n + 1, 2 * k + 1):
	l.append(str(i))
print(' '.join(l))


(n, k) = map(int, input().split())
p = k * 2 + 1
o = n % p
m = k + 1
if o != 0 and n > p and (o < m):
	cd = m - o
	i = k + 1 - cd
	ans = []
	while i <= n:
		ans.append(i)
		i += p
elif k + 1 > n:
	ans = [1]
else:
	i = k + 1
	ans = []
	while i <= n:
		ans.append(i)
		i += p
print(len(ans))
print(*ans)


s = input().split()
(n, k) = (int(s[0]), int(s[1]))
pos = k + 1
while n - pos - (n - pos) // (2 * k + 1) * (2 * k + 1) > k:
	pos -= 1
res = []
while pos <= n:
	res.append(pos)
	pos += 2 * k + 1
print(len(res))
print(*res)


(n, k) = list(map(int, input().split()))
x = 2 * k + 1
y = n // x
z = n % x
if z != 0:
	y += 1
else:
	z = 2 * k
print(y)
a = 1 + z // 2
for i in range(a, n + 1, x):
	print(i, end=' ')


(n, k) = map(int, input().split())
v = 2 * k + 1
r = n // v
a = n % v
y = 1 if a > 0 else 0
m = k + 1
print(r + y)
if a < k + 1 and a != 0:
	m -= k + 1 - a
for i in range(r + y):
	print(m, end=' ')
	m += v


(n, k) = list(map(int, input().split()))
r = n % (k + k + 1)
if r == 0:
	s = k + 1
elif r > k + 1:
	s = r - k + 1
else:
	s = r
l = list(range(s, n + 1, 2 * k + 1))
print(len(l))
print(*l)


import sys
from math import ceil
alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')

def find(s1, s2):
	for i in alpha:
		if i != s1 and i != s2:
			return i
for _ in range(1):
	(n, k) = map(int, input().split())
	ans = ceil(n / (2 * k + 1))
	print(ans)
	if n % (2 * k + 1) <= k + 1 and n % (2 * k + 1) > 0:
		ans2 = n % (2 * k + 1)
	else:
		ans2 = k + 1
	l = []
	while ans2 <= n:
		l.append(ans2)
		ans2 += 2 * k + 1
	print(*l)


import sys
import bisect
from collections import Counter
read_int = lambda : int(sys.stdin.readline())
read_ints = lambda : map(int, sys.stdin.readline().split())
read_int_list = lambda : list(read_ints())
read = lambda : sys.stdin.readline().strip()
read_list = lambda : sys.stdin.readline().split()

def main():
	(n, k) = read_ints()
	res = []
	j = 0
	t = (1 + 2 * j) * k + 1 + j
	while t <= n:
		res.append(t)
		j += 1
		t = (1 + 2 * j) * k + 1 + j
	if k >= t - n > 0:
		diff = t - n
		res = [e - diff for e in res]
		res.append(n)
	print(len(res))
	print(*res)
main()


(n, k) = map(int, input().split())
if n == 1:
	print(1)
	print(1)
	exit()
if k >= n // 2:
	print(1)
	print((n + 1) // 2)
else:
	m = 1001
	temp = -1
	for r1 in range(0, k + 1):
		for r2 in range(0, k + 1):
			t = n - (r1 + 1 + k) - (r2 + 1 + k)
			if t < 0:
				continue
			if t % (2 * k + 1) == 0:
				x = t // (2 * k + 1)
				if x + 2 <= m:
					m = x + 2
					temp = [r1, r2, x]
	print(m)
	(r1, r2, x) = temp
	ans = [r1 + 1]
	for i in range(x):
		cur = ans[-1]
		ans.append(cur + 2 * k + 1)
	ans.append(n - r2)
	print(*ans)


def editor():
	import sys
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	import math
	(n, k) = map(int, input().split())
	if k >= n // 2:
		print(1, n // 2 + 1, sep='\n')
		return
	l = math.ceil(n / (2 * k + 1))
	print(l)
	separate = 2 * k + 1
	maxi = separate * l
	s = max(0, k - (maxi - n)) + 1
	for i in range(s, n + 1, separate):
		print(i, end=' ')
solve()


(n, k) = input().split(' ')
n = int(n)
k = int(k)
ans = []
if k == n or k > n:
	ans.append(n)
elif n % (k * 2 + 1) == 0 or k >= n / 2:
	ans.extend([i for i in range(k + 1, n + 1, k * 2 + 1)])
else:
	ans.extend([i for i in range(k + 1, n + 1, k * 2 + 1)])
	x = n - (ans[-1] + k)
	if x > 0:
		y = k - x + 2
		ans = [elt - y for elt in ans]
		ans.append(n - 1)
	if ans[0] == 0:
		ans = [elt + 1 for elt in ans]
print(len(ans))
for elt in ans:
	print(elt, end=' ')


from math import ceil
(n, k) = map(int, input().split(' '))
cover = 2 * k + 1
turns = ceil(n / cover)
print(turns)
shift = turns * cover - n
first_index = k - shift
if first_index >= 0:
	for i in range(turns):
		print(first_index + 1 + i * cover, end=' ')
else:
	for i in range(turns):
		print(0 + 1 + i * cover, end=' ')


(n, m) = input().split()
n = int(n)
m = int(m)
if m == 0:
	print(n)
	k = 1
	while k <= n:
		print(k, end=' ')
		k += 1
elif n == 0:
	print(0)
elif n <= 2 * m + 1:
	print(1)
	if n < m + 1:
		print(1)
	else:
		print(m + 1)
else:
	e = 2 * m + 1
	array = []
	if n % e < m + 1 and n % e > 0:
		i = 1
		while i <= n:
			array.append(i)
			i = i + e
	else:
		i = m + 1
		while i <= n:
			array.append(i)
			i = i + e
	print(len(array))
	for j in array:
		print(j, end=' ')


import sys
(n, k) = map(int, input().split(' '))
s = [k + x * (2 * k + 1) for x in range(int((n + 2 * k) / (2 * k + 1)))]
if s[-1] >= n:
	s = [x - k for x in s]
s = [x + 1 for x in s]
print(len(s))
print(*s, sep=' ')


(n, k) = map(int, input().split())
width = 2 * k + 1
rem = n % width
print(n // width + bool(rem))
shift = k if 0 < rem <= k else 0
current = k + 1 - shift
while current <= n:
	print(current, end=' ')
	current += width
print()


import math
(n, k) = map(int, input().split())
ans = math.ceil(n / (2 * k + 1))
print(ans)
r = n % (2 * k + 1)
if r <= k + 1 and r > 0:
	t = r
else:
	t = k + 1
while t <= n:
	print(t, end=' ')
	t = t + 2 * k + 1


(n, k) = map(int, input().split(' '))
l = (n - 1) // (2 * k + 1) + 1
x = l * (2 * k + 1) - n
a = min(n, k, x)
if n < 2 * k + 1:
	print(1)
	print(n // 2 + 1)
else:
	print(l)
	for i in range(l):
		print(k + 1 + i * (2 * k + 1) - a, end=' ')


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
(n, k) = f()
fg = 0
i = 1
j = 1
while i <= k + 1:
	j = i
	while j <= n:
		j += 2 * k + 1
	j -= 2 * k + 1
	if n - j <= k:
		fg = 1
		break
	i += 1
l = [k for k in range(i, n + 1, 2 * k + 1)]
print(len(l))
print(*l)


I = lambda : map(int, input().split())
(n, k) = I()
x = 2 * k + 1
z = n // x
a = n % x
y = 1 if a > 0 else 0
ini = k + 1
print(z + y)
if a < k + 1 and a != 0:
	ini -= k + 1 - a
for i in range(z + y):
	print(ini, end=' ')
	ini += x


(n, k) = list(map(int, input().split()))
r = n % (2 * k + 1)
a = []
if n <= 2 * k + 1:
	a.append((n + 1) // 2)
	print(len(a))
	print(*a)
	return
if r >= k + 1 or r == 0:
	l = [i for i in range(k + 1, n + 1, 2 * k + 1)]
	print(len(l))
	print(*l)
else:
	d = k + 1 - r
	s = k + 1 - d
	l = [i for i in range(s, n + 1, 2 * k + 1)]
	print(len(l))
	print(*l)


(n, k) = map(int, input().split())
count = n
count1 = 0
last1 = []
if n % (2 * k + 1) < k + 1 and n % (2 * k + 1) != 0:
	last = k + 1 - (k + 1 - n % (2 * k + 1))
	last1.append(last)
	count1 += 1
	count -= k + last
	while count > 0:
		last += 2 * k + 1
		last1.append(last)
		count1 += 1
		count -= 2 * k + 1
else:
	last = k + 1
	last1.append(last)
	count1 += 1
	while count > 2 * k + 1:
		last += 2 * k + 1
		last1.append(last)
		count1 += 1
		count -= 2 * k + 1
print(count1)
print(' '.join(map(str, last1)))


(n, k) = tuple(map(int, input().strip().split(' ')))
l = 0
arr = []
cu = 0
yo = n % (2 * k + 1)
if yo >= k + 1 or yo == 0:
	for t in range(k + 1, n + 1, 2 * k + 1):
		arr.append(t)
else:
	for t in range(1, n + 1, 2 * k + 1):
		arr.append(t)
print(len(arr))
for k in arr:
	print(k, ' ', end='')


import sys
import math
import itertools
import collections

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
(n, k) = mi()
t = n // (2 * k + 1)
if k == 0:
	print(n)
	print(wr([i for i in range(1, n + 1)]))
elif t == 0 or (t == 1 and n % (2 * k + 1) == 0):
	print(1)
	print((n + 1) // 2)
elif n % (2 * k + 1) == 0:
	print(t)
	for i in range(t):
		print(k + 1 + i * (2 * k + 1), end=' ')
elif n % (2 * k + 1) >= k + 1:
	print(t + 1)
	for i in range(t + 1):
		print(k + 1 + i * (2 * k + 1), end=' ')
else:
	print(t + 1)
	for i in range(t + 1):
		print(1 + i * (2 * k + 1), end=' ')


(n, k) = map(int, input().split())
k2 = k * 2 + 1
print(n // k2 + int(n % k2 != 0))
print(' '.join(map(str, range(min(k + 1, (n - 1) % k2 + 1), n + 1, k2))))


(n, k) = map(int, input().rstrip().split())
maxm = 2 * k + 1
ans = n // maxm
rem = n % maxm
if rem != 0:
	ans += 1
x = ans * maxm - n
if x >= k:
	st = 1
else:
	st = k - x + 1
print(ans)
for i in range(st, n + 1, maxm):
	print(i, end=' ')


(n, m) = map(int, input().split())
s = 2 * m + 1
ans = n // s
if s * ans != n:
	ans += 1
md = n % s
print(ans)
fst = m + 1
if md <= m and md > 0:
	fst -= m + 1 - md
for i in range(ans):
	print(fst, end=' ')
	fst += s


(n, k) = map(int, input().split())
for i in reversed(range(k + 1)):
	if (n - i - 1 - k) % (2 * k + 1) >= k + 1 or (n - i - 1 - k) % (2 * k + 1) == 0:
		a = []
		j = i
		while j < n:
			a.append(j + 1)
			j += 2 * k + 1
		print(len(a))
		print(*a, sep=' ')
		break


(n, k) = map(int, input().split())
c = 0
l = [1]
z = 1
f = 0
p = 0
t = n
while n > 0:
	n = n - (2 * k + 1)
	c = c + 1
print(c)
c = c - 1
while c > 0:
	z = z + (2 * k + 1)
	c = c - 1
	l.append(z)
while p <= k:
	if l[len(l) - 1] + p == t:
		p = p + 1
		f = 1
		break
	else:
		f = 0
		p = p + 1
if f == 1:
	for i in range(len(l)):
		print(l[i], end=' ')
else:
	for i in range(len(l)):
		print(l[i] + k, end=' ')


import sys
in_lines = [line.rstrip() for line in sys.stdin]
(n, k) = map(int, in_lines[0].split())
li = []
if n < 2 * k + 1:
	li.append(str(min(k + 1, n)))
else:
	i = k
	while i < n:
		li.append(i)
		i += 2 * k + 1
	yu = n % (2 * k + 1)
	yu_sub = k + 1 - yu
	if yu != 0 and yu_sub > 0:
		li = [e - yu_sub for e in li]
		li.append(n - 1)
	li = [str(e + 1) for e in li]
print(len(li))
print(' '.join(li))


(n, k) = map(int, input().split())
a = []
if n <= 2 * k + 1:
	a.append(n // 2 + 1)
elif n > 2 * k + 1:
	if n % (2 * k + 1) > k or n % (2 * k + 1) == 0:
		for i in range(k + 1, n + 1, 2 * k + 1):
			a.append(i)
	else:
		for i in range(1, n + 1, 2 * k + 1):
			a.append(i)
print(len(a))
for i in a:
	print(i, end=' ')


A = list(map(int, input().split()))
n = A[0]
k = A[1]
Atv = (n - 1) // (2 * k + 1) + 1
print(Atv)
if Atv == 1:
	print(1 + (n - 1) // 2)
else:
	A = []
	for i in range(k + 1, n, 2 * k + 1):
		A.append(i)
	if len(A) == Atv - 1:
		if n - A[-1] > 2 * k + 1:
			A.append(A[-1] + 2 * k + 1)
		else:
			for i in range(len(A)):
				A[i] -= 2 * k + 1 - n + A[-1]
			A.append(n)
	for elem in A:
		print(elem, end=' ')


import math
(n, k) = map(int, input().split())
print(math.ceil(n / (2 * k + 1)))
g = 0
if k == 0:
	for _ in range(1, n + 1):
		print(_, end=' ')
elif n % (2 * k + 1) > k or n % (2 * k + 1) == 0:
	print(k + 1, end=' ')
	for i in range(1, int(math.ceil(n / (2 * k + 1)))):
		print(k + 1 + i * (2 * k + 1), end=' ')
else:
	print(n % (2 * k + 1), end=' ')
	for i in range(1, n // (2 * k + 1) + 1):
		print(n % (2 * k + 1) + (2 * k + 1) * i, end=' ')


R = lambda : list(map(int, input().split()))
(n, k) = R()
t = n // (2 * k + 1)
if n % (2 * k + 1) == 0:
	l = [k + 1 + (2 * k + 1) * i for i in range(0, t)]
	print(t)
	print(*l, sep=' ')
else:
	r = n - t * (2 * k + 1)
	if r >= k + 1:
		l = [k + 1 + (2 * k + 1) * i for i in range(0, t)]
		l.append(n - (r - k - 1))
	else:
		p = (n - (k + 1)) // (2 * k + 1)
		if (n - (k + 1)) % (2 * k + 1) == 0:
			l = [1 + (2 * k + 1) * i for i in range(0, p + 1)]
		else:
			l = [1 + (2 * k + 1) * i for i in range(0, p + 1)]
			r = n - (k + 1) - p * (2 * k + 1)
			l.append(n - (r - k - 1))
	print(t + 1)
	print(*l, sep=' ')


import math
(n, l) = map(int, input().split())
z = math.ceil(n / (2 * l + 1))
print(z)
x = (2 * l + 1) * z - n
m = 2 * l - x
if m <= l:
	for i in range(m + 1, n + 1, 2 * l + 1):
		print(i, end=' ')
else:
	for i in range(l + 1, n + 1, 2 * l + 1):
		print(i, end=' ')


(n, k) = [int(i) for i in input().split(' ')]
if k >= n // 2:
	print(1)
	print(max(n // 2 + 1, 1))
	exit(0)
mark = [i + 1 for i in range(n)]
for i in range(2 * k + 1):
	if (n + i) % (2 * k + 1) == 0:
		n += i
		break
if i > k:
	mark = [-1 for i in range(k)] + mark + [-1 for i in range(i - k)]
elif i == k:
	[-1 for i in range(k)] + mark
elif i == 0:
	pass
else:
	[-1 for i in range(i)] + mark
idx = [False for i in range(len(mark))]
prev = 1
for i in range(1, n // (2 * k + 1) + 1):
	high = i * (2 * k + 1)
	idx[(high + prev) // 2 - 1] = True
	prev = high + 1
print(sum(idx))
for i in range(len(idx)):
	if idx[i] is True and mark[i] != -1:
		print(mark[i], end=' ')


(n, k) = list(map(int, input().split()))
c = 2 * k + 1
count = int(n / c) if round(n / c) == n / c else int(n / c) + 1
print(count)
f = 1 if count * c - k > n else n - (count * c - k) + 1
print(' '.join([str(i) for i in range(f, n + 1, c)]))


(n, k) = map(int, input().split())
span = 2 * k + 1
l = (n + span - 1) // span
print(l, end='')
i = n - ((l - 1) * span + k + 1) + 1
if i <= 0:
	i = 1
while l > 0:
	print(' ' + str(i), end='')
	i += span
	l -= 1


(n, k) = [int(x) for x in input().split()]
mid = k * 2 + 1
low = k + 1
ans = 0
if k == 0:
	print(n)
	for i in range(1, n + 1):
		print(i, end=' ')
	print()
elif n % mid == 0:
	ans = n // mid
	print(ans)
	i = k + 1
	while i < n:
		print(i, end=' ')
		i += mid
	print()
else:
	ans = n // mid + 1
	print(ans)
	if n % mid > low:
		p = n % mid - k
		while p < n:
			print(p, end=' ')
			p += mid
		print()
	else:
		damage = n % mid + mid
		p = damage // 2 + damage % 2 - k
		q = damage // 2
		while p <= n - q:
			print(p, end=' ')
			p += mid
		p -= mid
		p += k
		left = n - p
		tp = n - left + 1 + k
		print(tp)


(n, k) = [int(x) for x in input().split()]
if k == 0:
	print(n)
	a = list(range(1, n + 1))
	print(*a)
elif k * 2 >= n:
	if k >= n - 1:
		print(1)
		print(1)
	else:
		ans = k + 1
		print(1)
		print(ans)
else:
	minn = n / (2 * k + 1)
	if minn == int(minn):
		minn = int(minn)
	else:
		minn = int(minn)
		minn += 1
	print(minn)
	st = k + 1
	ans = []
	for i in range(minn):
		ans.append(st)
		st += 2 * k + 1
		if st > n:
			diff = st - n
			if len(ans) < minn:
				for j in range(len(ans)):
					ans[j] -= diff
				ans.append(n)
			break
	print(*ans)


inp = list(map(int, input().split()))
n = inp[0]
k = inp[1]
result = None
for i in range(1, k + 2):
	sub = []
	j = i
	while j <= n:
		sub.append(j)
		j += k * 2 + 1
	if j - k > n:
		if not result or len(result) > len(sub):
			result = sub
print(len(result))
out = ''
for x in result:
	out += str(x) + ' '
print(out)


import math
text = input('')
[n, k] = [int(z) for z in text.split()]
if k == 0:
	print(n)
	print(' '.join((str(z) for z in range(1, n + 1))))
elif 2 * k + 1 >= n:
	print(1)
	print(math.ceil(n / 2))
else:
	stride = k * 2 + 1
	l = math.ceil(n / stride)
	print(l)
	arr = []
	if n % stride >= k + 1 or n % stride == 0:
		for i in range(l):
			arr.append(stride * i + k + 1)
		print(' '.join((str(v) for v in arr)))
	else:
		initial = 1
		arr.append(initial)
		for i in range(l - 1):
			arr.append(initial + k + stride * i + k + 1)
		print(' '.join((str(v) for v in arr)))


(n, k) = map(int, input().split())
l = 2 * k + 1
r = [*range(n - k * ((n - 1) % l > k), 0, -l)]
print(len(r), *r)


(n, k) = list(map(int, input().split()))
t = 2 * k + 1
rem = n % t
res = n // t
start = k + 1
if rem > 0:
	res += 1
	if rem < k + 1:
		start -= k + 1 - rem
print(res)
print(*[start + j * (2 * k + 1) for j in range(res)])


(n, k) = map(int, input().split())
c = 0
ans = ''
if n <= 2 * k + 1:
	print(1)
	print(n // 2 + n % 2)
else:
	ost = n % (2 * k + 1)
	if ost == 0:
		s = k + 1
		count = n // (2 * k + 1)
	elif ost >= k + 1:
		s = k + 1
		count = n // (2 * k + 1) + 1
	else:
		s = k + 1
		s -= k + 1 - ost
		count = n // (2 * k + 1) + 1
	for i in range(count):
		c += 1
		ans += str(s) + ' '
		s += 2 * k + 1
	print(c)
	print(ans)


(n, k) = map(int, input().split())
kf = 2 * k + 1
z = (n + kf - 1) // kf
ar = [k + 1]
for i in range(z - 1):
	ar.append(ar[-1] + kf)
diff = ar[-1] - n
if diff > 0:
	for i in range(len(ar)):
		ar[i] -= diff
print(z)
print(' '.join(map(str, ar)))


import math
n = input().split()
d = int(n[0]) % (2 * int(n[1]) + 1)
t = math.ceil(int(n[0]) / (2 * int(n[1]) + 1))
print(t)
if d > int(n[1]) or d == 0:
	p = [k * (2 * int(n[1]) + 1) + int(n[1]) + 1 for k in range(t)]
	for k in p:
		print(k, end=' ')
else:
	p = [k * (2 * int(n[1]) + 1) + 1 for k in range(t)]
	for k in p:
		print(k, end=' ')


(n, k) = map(int, input().split())
K = 2 * k + 1
a = [i for i in range(1, n + 1, K)]
l = n - a[len(a) - 1]
l = int(l / 2)
b = [i + l for i in a]
print(len(b))
print(' '.join((str(x) for x in b)))


from math import ceil
(n, k) = map(lambda s: int(s), input().split(' '))
step = 2 * k + 1
count = ceil(n / step)
print(count)
cut = count * step - n
start = k + 1
if cut > k:
	start -= cut - k
print(*[start + step * n for n in range(count)])


import sys
(n, k) = map(int, input().split())
if k == 0:
	print(n)
	for i in range(1, n + 1):
		print(i, end=' ')
	sys.exit(0)
l = []
step = 0
nn = n
curr = 0
if n >= 2 * (2 * k + 1):
	step = int(n / (2 * k + 1))
	step -= 2
	nn -= step * (2 * k + 1)
if nn > 2 * (2 * k + 1):
	nn -= 2 * k + 1
	step += 1
if nn <= 2 * k + 1:
	l.append(int(n / 2) + 1)
else:
	s1 = int(nn / 2)
	curr = s1
	s2 = nn - s1
	l.append(s1 - k)
	l.append(n - (s2 - k) + 1)
print(step + len(l))
for i in l:
	print(i, end=' ')
for i in range(step):
	print(curr + k + 1, end=' ')
	curr += 2 * k + 1


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	zz = 0
	for _ in range(1):
		(n, k) = ria()
		z = 1
		ans = [z]
		while True:
			z += 2 * k + 1
			if z > n:
				break
			ans.append(z)
		if ans[-1] + k < n:
			z = n - ans[-1] - k
			for i in range(len(ans)):
				ans[i] += z
		print(len(ans))
		print(*ans)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


from functools import reduce
(n, k) = map(int, input().split())
flip = 2 * k + 1
l = -(-n // flip)
max = k + 1 + (l - 1) * flip
i = k + 1
if max > n:
	i -= max - n
arr = []
while i <= n:
	arr.append(i)
	i += flip
s = reduce(lambda x, y: str(x) + ' ' + str(y), arr)
print(l)
print(s)


(n, k) = [int(x) for x in input().split()]
l = 1000000000.0
res = []
if k == 0:
	l = n
	for i in range(1, n + 1):
		res.append(i)
elif k > 0:
	for i in range(1, k + 2):
		(j, temp) = (i, 0)
		arr = []
		while j <= n:
			arr.append(j)
			temp += 1
			if j + k * 2 + 1 <= n:
				j += k * 2 + 1
			else:
				j += k + 1
		if temp < l and temp > 0:
			l = temp
			res = arr
print(l)
for i in res:
	print(i)


(n, k) = list(map(int, input().split()))
l = 0
h = n - 1
a = []
lside = 0
rside = 1
while True:
	rem = n - (lside + rside)
	if rem % (2 * k + 1) == 0:
		a.append(l)
		a.append(h)
	if h + k > n - 1:
		h -= 1
		rside += 1
	elif l < k:
		l += 1
		lside += 1
	else:
		break
start = a[0] + 1
end = a[1] + 1
output = list(range(start, end + 1, 2 * k + 1))
print(len(output))
print(*output)


def point_generator(n, k):
	reminder = (n - (k + 1)) % (2 * k + 1)
	offset = 2 * k + 1 - reminder if reminder > k else 0
	point = k - offset
	while point < n:
		yield (point + 1)
		point += 2 * k + 1
(n, k) = tuple(map(int, input().split()))
lst = list(point_generator(n, k))
print(len(lst))
for i in lst:
	print(i, end=' ')


(n, k) = map(int, input().split())
window = 2 * k + 1
skewers_spaced = list(range(1, n + 1, window))
bias = (n - skewers_spaced[-1]) // 2
skewers_to_turn = [i + bias for i in skewers_spaced]
print(len(skewers_to_turn))
for skewer in skewers_to_turn:
	print(skewer, end=' ')


(n, k) = map(int, input().split())
(i, p) = (k + 1, 2 * k + 1)
t = n // p
st = []
if n % p != 0:
	t += 1
if t * p - k > n:
	i -= t * p - k - n
print(t)
while t > 0:
	st.append(i + (t - 1) * p)
	t -= 1
print(' '.join(list(sorted(map(str, st)))))


(n, k) = map(int, input().split())
l = -(-n // (2 * k + 1))
x = l * (2 * k + 1) - n
print(l)
pos = k - x // 2
for i in range(l):
	print(pos + 1, end=' ')
	pos += 2 * k + 1


import math
(n, b) = map(int, input().split())
k = 2 * b + 1
s = int(math.ceil(float(n) / k))
print(s)
a = []
p = b + 1
for i in range(s):
	a.append(p)
	p += k
d = max(0, a[-1] - n)
for i in a:
	print(i - d, end=' ')


import math
(n, k) = tuple(map(int, input().split()))
span = 2 * k + 1
turns = math.ceil(n / span)
if span >= n:
	print(str(turns) + '\n' + str(n // 2 + 1))
else:
	i = 1
	mx = i + span * (turns - 1) + k
	while mx < n:
		i += 1
		mx = i + span * (turns - 1) + k
	print(str(turns) + '\n' + ' '.join(map(str, range(i, n + 1, span))))


(n, k) = map(int, input().split())
c = k + 1 if n % (2 * k + 1) >= k + 1 or n % (2 * k + 1) == 0 else 1
ans = []
while c <= n:
	ans.append(c)
	c += 2 * k + 1
if ans[-1] + k < n:
	ans.append(min(n, ans[-1] + k * 2 + 1))
print(len(ans))
print(*ans)


import math
(n, k) = map(int, input().split())
total = math.ceil(n / (k * 2 + 1))
left = total * (k * 2 + 1) - n
ans = []
if left > 0:
	tl = left // 2
	tr = left - left // 2
	ans.append(k + 1 - tl)
	if total > 1:
		ans.append(n - k + tr)
	for i in range(1, total - 1):
		ans.append(k + 1 - tl + (k * 2 + 1) * i)
else:
	ans.append(k + 1)
	for i in range(1, total):
		ans.append(k + 1 + i * (k * 2 + 1))
print(len(ans))
print(*ans)


(n, k) = map(int, input().split())
if n % 2 and (n - 1) // 2 <= k or (not n % 2 and n // 2 <= k):
	print(1)
	print((n + 1) // 2)
	exit()
else:
	kl = k + 1
	kh = 2 * k + 1
	if not n % kh:
		an = n // kh
		print(an)
		inn = k + 1
		for i in range(an):
			print(inn, end=' ')
			inn += 2 * k + 1
	else:
		an = n // kh
		r = n - kh * (an - 1)
		ans = an - 1
		if r % 2:
			p1 = (r + 1) // 2
			p2 = r // 2
		else:
			p1 = p2 = r // 2
		print(ans + 2)
		print(1 + abs(kl - p1), end=' ')
		ark = p1 + (kh + 1) // 2
		for i in range(ans):
			print(ark, end=' ')
			ark += kh
		print(n - abs(kl - p2), end=' ')


(n, k) = map(int, input().split())
cook = []
r = n % (2 * k + 1)
if r == 0:
	cook.append(k + 1)
	for i in range(0, int(n / (2 * k + 1)) - 1):
		cook.append(cook[-1] + 2 * k + 1)
	print(len(cook))
	for x in cook:
		print(x, end=' ')
if k + 1 <= r < 2 * k + 1:
	cook.append(k + 1)
	for i in range(0, int(n / (2 * k + 1))):
		cook.append(cook[-1] + 2 * k + 1)
	print(len(cook))
	for x in cook:
		print(x, end=' ')
if 0 < r < k + 1:
	p = k + 1 - r
	cook.append(k - p + 1)
	for i in range(0, int(n / (2 * k + 1))):
		cook.append(cook[-1] + 2 * k + 1)
	print(len(cook))
	for x in cook:
		print(x, end=' ')


(n, k) = map(int, input().strip().split())
a = []
cnt = 0
x = 2 * k + 1
r = n % x
if r == 0 or r > k:
	i = k + 1
	while i <= n:
		a.append(i)
		i = i + x
		cnt = cnt + 1
else:
	i = r
	while i <= n:
		a.append(i)
		i = i + x
		cnt = cnt + 1
print(cnt)
for i in range(cnt):
	print(a[i], end=' ')


[n, m] = map(int, input().split())
length = 1 + m * 2
ret = []
if n <= length:
	ret.append(min(n, m + 1))
else:
	mod = n % length
	if mod == 0:
		mod = m + 1
	elif mod > m:
		mod = mod - m
	cur = mod
	ret.append(cur)
	while cur + length <= n:
		cur = cur + length
		ret.append(cur)
print(len(ret))
print(' '.join(map(str, ret)))


import sys

def minp():
	return sys.stdin.readline().strip()
(n, k) = map(int, minp().split())
kk = 2 * k + 1
r = []
if n % kk < k + 1 and n % kk > 0:
	for i in range((n % kk + 1) // 2, n + 1, kk):
		r.append(i)
else:
	for i in range(1 + k, n + 1, kk):
		r.append(i)
print(len(r))
for i in r:
	print(i, end=' ')


(n, k) = map(int, input().split())
nn = 2 * k + 1
start = k + 1
start -= max(0, k + 1 - n % nn)
if start != 0:
	start = max(1, start)
else:
	start = k + 1
arr = []
ans = 0
while start <= n:
	arr.append(start)
	start += nn
	ans += 1
print(ans)
for i in range(len(arr)):
	print(arr[i], end=' ')


import math
(n, k) = map(int, input().split())
r = k * 2 + 1
c = math.ceil(n / r)
if r * (c - 1) == n:
	print(c - 1)
	for i in range(k + 1, n + 1, r):
		print(i, end=' ')
else:
	h = n - r * (c - 1)
	print(c)
	if h > k:
		for i in range(k + 1, n + 1, r):
			print(i, end=' ')
	else:
		for i in range(h, n + 1, r):
			print(i, end=' ')


def solve():
	(n, k) = map(int, input().split())
	i = 1
	res = []
	while i <= n:
		i += k
		if i > n:
			for j in range(len(res)):
				res[j] -= i - n
			i = n
		if len(res) > 0 and i - res[-1] < 2 * k:
			for j in range(len(res)):
				res[j] -= n - (2 * k - (i - res[-1]))
		res.append(i)
		i += k + 1
	print(len(res))
	print(' '.join((str(x) for x in res)))
solve()


import math
(n, k) = [int(x) for x in input().split()]
if k == 0:
	print(n)
	a = []
	for i in range(1, n + 1):
		a.append(i)
	print(*a)
	exit()
num = 2 * k + 1
if n <= num:
	print(1)
	print(min(n, 1 + k))
	exit()
mina = 9999999
idx = 0
for i in range(1, k + 2):
	c = 1
	f = 1
	for j in range(i + k, n, num):
		if j + k + 1 > n:
			f = 0
			break
		c += 1
	if c < mina and f == 1:
		mina = c
		idx = i
print(mina)
while mina > 0:
	print(idx, end=' ')
	idx += num
	mina -= 1


(n, k) = list(map(int, input().split()))
w1 = 2 * k + 1
w2 = k + 1
(count, mod) = divmod(n, w1)
if mod:
	count += 1
	start = mod
	if mod > k:
		start = mod - k
else:
	start = w2
print(count)
print(' '.join([str(i * w1 + start) for i in range(count)]))


(n, k) = map(int, input().split())
m = 2 * k + 1
if n % m == 0:
	l = n // m
	x = k + 1
else:
	l = n // m + 1
	r = m - n % m
	if r < k:
		x = k - r + 1
	else:
		x = 1
res = []
res.append(str(x))
for i in range(l - 1):
	x += m
	res.append(str(x))
print(l)
print(' '.join(res))


import math
s = input()
x = s.split()
n = int(x[0])
k = int(x[1])
if n % (2 * k + 1) == 0:
	print(n // (2 * k + 1))
	for i in range(k + 1, n + 1, 2 * k + 1):
		print(i, end=' ')
elif n % (2 * k + 1) >= k + 1:
	print(n // (2 * k + 1) + 1)
	for i in range(k + 1, n + 1, 2 * k + 1):
		print(i, end=' ')
else:
	print(n // (2 * k + 1) + 1)
	for i in range(k + 1, n + 1, 2 * k + 1):
		print(i - (k + 1 - n % (2 * k + 1)), end=' ')
	print(n)


(n, k) = map(int, input().split())
c = n // (2 * k + 1)
r = n % (2 * k + 1)
a = []
if r == 0:
	print(c)
	for i in range(k + 1, n + 1, 2 * k + 1):
		a.append(str(i))
	print(' '.join(a))
elif r > k:
	print(c + 1)
	for i in range(r - k, n + 1, 2 * k + 1):
		a.append(str(i))
	print(' '.join(a))
else:
	print(c + 1)
	for i in range(1, n + 1, 2 * k + 1):
		a.append(str(i))
	print(' '.join(a))


t = input().split()
(n, k) = (int(t[0]), int(t[1]))
a = n % (2 * k + 1)
l = []
s = 0
if not a:
	print(n // (2 * k + 1))
	for e in range(k + 1, n + 1, 2 * k + 1):
		print(e)
elif a >= k + 1:
	print(n // (2 * k + 1) + 1)
	for e in range(k, n + 1, 2 * k + 1):
		print(e)
else:
	print(n // (2 * k + 1) + 1)
	for e in range((2 * k + 1 + n % (2 * k + 1)) // 2 - k, n + 1, 2 * k + 1):
		print(e)


import math
(n, k) = map(int, input().strip().split(' '))
if n % (2 * k + 1) == 0:
	print(n // (2 * k + 1))
	for i in range(k + 1, n + 1, 2 * k + 1):
		print(i, end=' ')
else:
	if n % (2 * k + 1) > k:
		k1 = n % (2 * k + 1) - k
	else:
		k1 = n % (2 * k + 1)
	l = []
	for i in range(k1, n + 1, 2 * k + 1):
		l.append(i)
	print(len(l))
	for i in range(len(l)):
		print(l[i], end=' ')


import math
[n, k] = [int(t) for t in input().split(' ')]
res = [0] * math.ceil(n / (2 * k + 1))
for tstart in range(k + 1):
	i = 0
	pos = tstart
	while True:
		right = pos + k + 1
		res[i] = pos
		i += 1
		pos += 2 * k + 1
		if pos >= n:
			break
	if right >= n:
		print(i)
		print(*[t + 1 for t in res[:i]])
		break


from math import ceil
(n, k) = map(int, input().split())
kf = 2 * k + 1
z = ceil(n / kf)
y = z * kf - n
ar = [k + 1]
for i in range(z - 1):
	ar.append(ar[-1] + kf)
diff = ar[-1] - n
if diff > 0:
	for i in range(len(ar)):
		ar[i] -= diff
print(z)
print(' '.join(map(str, ar)))


import os
from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline()]

def read_str_list():
	return [x for x in stdin.readline().split()]
(nops, k) = read_ints()
OFFSET = 2 * k + 1
rem = nops % OFFSET
if nops < k + 1:
	ans = [1]
elif rem <= k and rem != 0:
	ans = range(k + 1 - (k + 1 - rem), nops + 1, OFFSET)
else:
	ans = range(k + 1, nops + 1, OFFSET)
print(len(ans))
print(*ans)


(n, k) = map(int, input().split())
w = k * 2 + 1
a = n % w
b = n // w
e = 0 if a == 0 else 1
ans = b + e
print(b + e)
f = n - w * (ans - 1) - k
if f <= 0:
	f = 1
while f <= n:
	print(f, end=' ')
	f += k * 2 + 1
print()


(n, k) = map(int, input().split())
jump = 2 * k + 1
for i in range(1, n + 1):
	offset = i
	while offset + jump <= n:
		offset += jump
	if offset + k >= n:
		ans = []
		for idx in range(i, n + 1, jump):
			ans.append(idx)
		print(len(ans))
		print(*ans)
		exit(0)


(n, k) = list(map(int, input().split()))
m = n % (2 * k + 1)
if not k:
	print(n)
	print(' '.join(list(map(str, range(1, n + 1)))))
elif not m:
	print(n // (2 * k + 1))
	print(' '.join(list(map(str, range(k + 1, n + 1, 2 * k + 1)))))
else:
	s = m + 2 * k + 1
	(l, r) = (s // 2 + s % 2, s // 2)
	li = l - k - 1
	ri = n - r + k
	print((ri - li - k - k) // (2 * k + 1) + 2)
	print(' '.join(list(map(str, range(li + 1, ri + 2, 2 * k + 1)))))


(b, k) = [int(i) for i in input().split()]
m = 2 * k + 1
c = b // m
d = b % m
if d == 0:
	c == c
else:
	c += 1
dd = d
dc = k + 1
print(c)
for i in range(c):
	if d == 0:
		print(dc, end=' ')
	elif d <= k:
		print(dd, end=' ')
	else:
		print(dc, end=' ')
	dc = dc + m
	dd = dd + m


import math
(n, k) = map(int, input().split())
if n <= 2 * k + 1:
	print(1)
	print(math.ceil(n / 2))
	exit()
x = math.ceil(n / (2 * k + 1))
ans = [k + 1]
for i in range(1, x - 1):
	ans.append(ans[-1] + (2 * k + 1))
if n - ans[-1] - k <= k:
	shift = k - (n - ans[-1] - k) + 1
	for i in range(len(ans)):
		ans[i] -= shift
	print(x)
	ans.append(n)
else:
	print(x)
	ans.append(ans[-1] + (2 * k + 1))
print(*ans)


readints = lambda : map(int, input().strip('\n').split())
(n, k) = readints()
rng = 2 * k + 1
l = (n + 2 * k) // rng
first = 1 + k
last = first + (l - 1) * rng
shift = max(0, last - n)
print(l)
cur = first - shift
for _ in range(l):
	print(cur, end=' ')
	cur += rng
print()


(n, k) = map(int, input().split())
indicies = []
for i in range(k, n + k, 2 * k + 1):
	indicies.append(i)
m = len(indicies)
if indicies[m - 1] > n or indicies[0] < 1 or indicies[m - 1] < n - k:
	shift = 0
	while indicies[m - 1] - shift >= n and indicies[0] - shift > 0:
		shift += 1
	while indicies[0] - shift < 1:
		shift -= 1
	while indicies[m - 1] - shift < n - k:
		shift -= 1
	for k in range(m):
		indicies[k] -= shift
print(len(indicies))
print(' '.join(map(str, indicies)))


(n, k) = map(int, input().split())
t = 2 * k + 1
ans = list(range(min((n - 1) % t + 1, k + 1), n + 1, t))
print(len(ans))
print(' '.join(map(str, ans)))


import math
(sashliks, spread) = [int(i) for i in input().split(' ')]
if sashliks <= spread * 2 + 1:
	print('1\n' + str(sashliks // 2 + 1))
elif 2 * spread + 1 < sashliks and sashliks <= 2 * (2 * spread + 1):
	if sashliks - 2 * (spread + 1) <= spread:
		print('2\n' + str(1 + sashliks - 2 * (spread + 1)) + ' ' + str(sashliks))
	else:
		print('2\n' + str(1 + spread) + ' ' + str(2 * spread + 1 + spread + 1))
else:
	res = 0
	res = math.ceil((sashliks - 2 * (2 * spread + 1)) / (2 * spread + 1))
	sashliks -= res * (2 * spread + 1)
	printres = ''
	if sashliks - 2 * (spread + 1) <= spread:
		printres += str(1 + sashliks - 2 * (spread + 1))
	else:
		printres += str(1 + spread)
	last = int(printres)
	for i in range(res):
		printres += ' ' + str(last + 2 * spread + 1)
		last = last + 2 * spread + 1
	if sashliks - 2 * (spread + 1) <= spread:
		printres += ' ' + str(sashliks + res * (2 * spread + 1))
	else:
		printres += ' ' + str(2 * spread + 1 + spread + 1 + res * (2 * spread + 1))
	print(res + 2)
	print(printres)


(n, k) = list(map(int, input().split()))
r = 2 * k + 1
rem = n % r
re = ''
if rem > 0:
	print(n // r + 1)
	if rem <= k + 1:
		re += '1' + ' '
		if rem < k + 1:
			rem = k + 1
		for i in range(rem + k + 1, n + 1, r):
			re += str(i) + ' '
		print(re)
	else:
		re += str(rem - k) + ' '
		for i in range(rem + k + 1, n + 1, r):
			re += str(i) + ' '
		print(re)
elif rem == 0 and k == 0:
	print(n)
	for i in range(1, n + 1):
		re += str(i) + ' '
	print(re)
else:
	print(n // r)
	for i in range(k + 1, n + 1, r):
		re += str(i) + ' '
	print(re)


(n, k) = list(map(int, input().split()))
ans = []
if n % (2 * k + 1) >= k + 1 or n % (2 * k + 1) == 0:
	i = k + 1
	while i <= n:
		ans.append(i)
		i += 2 * k + 1
else:
	i = 1
	while i <= n:
		ans.append(i)
		i += 2 * k + 1
print(len(ans))
print(*ans)


(n, k) = map(int, input().split())
if k == 0:
	print(n)
	print(' '.join((str(i) for i in range(1, n + 1))))
else:
	x = 2 * k + 1
	for i in range(k + 1, x + 1):
		if (n - i) % x == 0 or (n - i) % x >= k + 1:
			if (n - i) % x == 0:
				y = (n - i) // x
			else:
				y = (n - i) // x + 1
			print(y + 1)
			l = [i - k]
			while 1:
				if i + k + 1 <= n:
					l.append(i + k + 1)
				else:
					break
				i += x
			print(' '.join((str(i) for i in l)))
			break


from sys import stdin
input = lambda : stdin.readline()
from math import ceil, sqrt, gcd
(n, k) = map(int, input().split())
z = [k + 1 + i for i in range(k + 1)]
if 2 * k + 1 >= n:
	print(1)
	print(ceil(n / 2))
else:
	a = n // (2 * k + 1)
	r = n % (2 * k + 1)
	if r == 0:
		print(a)
		i = k + 1
		while i <= n:
			print(i, end=' ')
			i += 2 * k + 1
	elif r in z:
		print(a + 1)
		i = z.index(r) + 1
		while i <= n:
			print(i, end=' ')
			i += 2 * k + 1
	else:
		r += 2 * k + 1
		for i in range(len(z)):
			for j in range(len(z)):
				if z[i] + z[j] == r:
					x = i
					b = j
					break
		print(a + 1)
		l = [n - b]
		i = x + 1
		while i < n - b:
			l.append(i)
			i += 2 * k + 1
		print(*sorted(l))


from math import ceil
(n, k) = [int(x) for x in input().split()]
reg = 2 * k + 1
result = ceil(n / reg)
print(result)
shift_val = 0
if (n - 1) % (2 * k + 1) > k:
	shift_val += (n - 1) % (2 * k + 1) - k
id_of_skewers = 1 + shift_val
for i in range(result):
	print(id_of_skewers, end=' ')
	id_of_skewers += 2 * k + 1


(n, k) = map(int, input().split())
ans = []
c = 2 * k + 1
if c >= n:
	print(1)
	print((n - 1) // 2 + 1)
	exit(0)
l = 1
r = n
while (r - k - (l + k) - 1) % c and l < k + 1:
	l += 1
while (r - k - (l + k) - 1) % c and n - r + 1 < k + 1:
	r -= 1
ans = [l, r]
for i in range(l + c, r - c + 1, c):
	ans += [i]
print(len(ans))
print(*ans)


(n, k) = map(int, input().split())
num = []
if n > k:
	for i in range(1, k + 2):
		j = i
		b = 0
		while j <= n:
			b += 1
			if n - j <= k:
				j += 2 * k + 1
				continue
			elif j + 2 * k >= n:
				break
			j += 2 * k + 1
		if j > n:
			num.append([b, i])
	if num:
		num.sort()
		print(num[0][0])
		j = num[0][1]
		while j <= n:
			print(j, end=' ')
			j += 2 * k + 1
		print()
else:
	print(1)
	print(1)


(n, k) = map(int, input().split())
A = []
if 2 * (k + 1) <= n:
	a = -1
	b = 0
	for i in range(k + 1):
		if (n - (k + 1) - (k + 1 + i)) % (2 * k + 1) == 0:
			a = i
			break
	if a == -1:
		a = k
		for i in range(k + 1):
			if (n - (k + k + 1) - (k + 1 + i)) % (2 * k + 1) == 0:
				b = i
				break
	A.append(a + 1)
	p = 0
	for i in range((n - (a + 1 + k) - (b + 1 + k)) // (2 * k + 1)):
		A.append(A[p] + k + k + 1)
		p += 1
	A.append(A[p] + k + k + 1)
else:
	A.append(n // 2 + 1)
print(len(A))
print(*A)


(n, k) = map(int, input().split())

def check_start(start):
	step = 2 * k + 1
	end = n // step * step + start
	if end >= n:
		end -= step
	if n - 1 <= end + k:
		return True
	return False
for i in range(k + 1):
	if check_start(i):
		j = i
		cnt = 0
		while j < n:
			cnt += 1
			j += 2 * k + 1
		j = i
		print(cnt)
		while j < n:
			print(j + 1, end=' ')
			j += 2 * k + 1
		exit(0)


(n, k) = map(int, input().split())
l = 2 * k + 1
m = n % l
if m == 0:
	m = 2 * k + 1
if m <= k + 1:
	p = 1
else:
	p = m - k
r = n // l
if n % l != 0:
	r += 1
print(r)
for i in range(r):
	print(p + l * i, end=' ')


(n, k) = map(int, input().split())
if n % (2 * k + 1) == 0 or n % (2 * k + 1) >= k + 1:
	if n % (2 * k + 1) == 0:
		print(n // (2 * k + 1))
	else:
		print(n // (2 * k + 1) + 1)
	j = k + 1
	while j <= n:
		print(j, end=' ')
		j += 2 * k + 1
else:
	print(n // (2 * k + 1) + 1)
	j = 1
	while j <= n:
		print(j, end=' ')
		j += 2 * k + 1