There are N apple trees in a row. People say that one of them will bear golden apples.
We want to deploy some number of inspectors so that each of these trees will be inspected.
Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).
Find the minimum number of inspectors that we need to deploy to achieve the objective.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N \leq 20
 - 1 \leq D \leq 20

-----Input-----
Input is given from Standard Input in the following format:
N D

-----Output-----
Print the minimum number of inspectors that we need to deploy to achieve the objective.

-----Sample Input-----
6 2

-----Sample Output-----
2

We can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.

Difficulty: introductory

Starter code:

Solutions:
N,D=list(map(int,input().split()))
print(((N-1)//(2*D+1)+1))


n,d = map(int, input().split())
print((n+d*2)//(2*d+1))

n, d = map(int, input().split())
print((n + 2 * d) // (2 * d + 1))

n,d=map(int, input().split())
print((n+d*2)//(d*2+1))

n,d = map(int,input().split())
if n / (d*2+1) <= 1:
    print(1)
elif n % (d*2+1) == 0:
    print(n//(d*2+1))
else:
    print(n//(d*2+1)+1)

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

ans=(n+2*d)//(1+2*d)
print(ans)

# 入力を受ける
N,D = map(int,input().split())

# 監視員は、2*D+1本みれる
k = 2*D+1

# 出力する
print(N//k if N%k == 0 else (N//k)+1)

N, D = map(int, input().split())
 
# 前から最適に配置せよ
# 一人目は, 1,...,D, D+1, D+2,...,2D+1 を監視
# 二人目は, 2D+2,..., 3D+2, ...,4D+2 を監視
# x人まで繰り返すと、1,...,x(2D+1)まで監視できる
 
# x(2D+1) > N を満たす最小のxは？
# x_min = ceil(N/(2D+1))
 
print(-(-N//(2*D+1)))

N, D = map(int, input().split())
a = 2*D + 1
if N % a == 0:
  ans = N // a
else:
  ans = N // a + 1
print(ans)

N,D = map(int,input().split())

print(-(-N//(D*2+1)))

N, D = map(int, input().split())
if N%(2*D+1)==0:
    print(N//(2*D+1))
else:
    print(N//(2*D+1)+1)

import math
n, d = map(int, input().split())

print(math.ceil(n / (d * 2 + 1)))

n,d=[int(x) for x in input().split()]
if n%(2*d+1)==0:
  print(n//(2*d+1))
else:
  print(n//(2*d+1)+1)

3
import sys
input = lambda: sys.stdin.readline().strip()
n, d = [int(x) for x in input().split()]
l = 2 * d + 1
print((n + l - 1) // l)

import math
tree_num, range = list(map(int,input().split()))

range_num = range * 2 + 1

print((math.ceil(tree_num / range_num)))


N,D = map(int,input().split())
print(-(-N//(2*D+1)))

n,d = map(int,input().split())
print((n+(2*d+1)-1)//(2*d+1))

import math
n, k = list(map(int, input().split()))
print(math.ceil(n / (2 * k + 1)))

N,D=map(int, input().split())

if N%(2*D+1)==0:
	print(N//(2*D+1))
else:print(N//(2*D+1)+1)

def answer(n: int, d: int) -> int:
    from math import ceil
    return ceil(n / (d * 2 + 1))

def main():
    n,d = map(int,input().split())
    print(answer(n,d))

def __starting_point():
    main()
__starting_point()

N, D = map(int, input().split())

import numpy as np
print(int(np.ceil(N / (2*D + 1))))

import math
n,d = map(int,input().split())
print(math.ceil(n/(2*d+1)))

N,D = map(int, input().split())
hani = (N+D) - (N-D) +1
import math
print(math.ceil(N/hani))

N,D = [int(v) for v in input().split()]
ans = int(N / (2*D + 1)) + int(N % (2*D+1) != 0)
print(ans)


a,b = list(map(int,input().split()))
ans = a//(b*2+1)
if ans == a/(b*2+1):
  print(ans)
else:
  print((ans + 1))


n,d = map(int,input().split())
print((n+d*2)//(d*2+1))

n, d = list(map(int, input().split(' ')))

print(((n + d * 2) // (d * 2 + 1)))


import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print((k.join(list(map(str, lst)))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque, defaultdict
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N, D = MI()
    print(((N+2*D)//(1+2*D)))

def __starting_point():
    solve()


__starting_point()

n,d=map(int,input().split())
if n%(2*d+1)==0:
  print(n//(2*d+1))
else:
  print(n//(2*d+1)+1)

n,d = map(int,input().split())
from math import ceil
print(ceil(n/(2*d+1)))

a,b=map(int,input().split())
b=b*2+1
c=0
while a>0: a-=b; c+=1
print(c)

n, d = [int(i) for i in input().split()]
ans = n // (2 * d + 1)
ans = ans if n % (2 * d + 1) == 0 else ans + 1
print(ans)

N,D = map(int,input().split())

for i in range(20):
    if 2*D*i + i >= N:
        print(i)
        return

n,d = list(map(int,input().split()))

import math
print((math.ceil(n / (2 * d + 1))))


#ABC134 B

N,D = map(int,input().split())
import math
print(math.ceil(N/(2*D + 1)))

import math

N, D = map(int, input().split())
print(math.ceil(N / (2 * D + 1)))

import math

N, D = list(map(int, input().split()))

print((math.ceil(N/(2*D+1))))


import math
n,d=map(int,input().split())
ans=math.ceil(n/(2*d+1))
print(ans)

a = list(map(int,input().split()))
print((-(-a[0]//(2*a[1]+1))))


N, D = list(map(int, input().split()))
print(( int((N+D*2) / (D*2+1)) ))


def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, d = Input()
    d = 2 * d + 1
    return (n+d-1)//(d)

print(main())

import math
N, D = map(int, input().split())
 
# 前から最適に配置せよ
# 一人目は, 1,...,D, D+1, D+2,...,2D+1 を監視
# 二人目は, 2D+2,..., 3D+2, ...,4D+2 を監視
# x人まで繰り返すと、1,...,x(2D+1)まで監視できる
 
# x(2D+1) > N を満たす最小のxは？
# x_min = ceil(N/(2D+1))
 
print(math.ceil(N/(2*D+1)))

N, D = map(int,input().split())

# 監視員は2D+1本の木を見れる
kanshi = 2 * D + 1

print(N//kanshi if N%kanshi==0 else N//kanshi+1)

N, D = map(int,input().split())

moniter = D * 2 + 1
if N <= moniter:
    print(1)
elif N % moniter == 0:
    print(N // moniter)
else:
    print(N // moniter + 1)

import math
N,D = map(int,input().split())
print(math.ceil(N/(2*D+1)))

import math
N, D = list(map(int, input().split()))

print((math.ceil(N/(D*2+1))))



import math
N, D = map(int, input().split())
print(math.ceil(N/(2*D+1)))

n,d=list(map(int,input().split()))
print(((n+(2*d))//(2*d+1)))


N, D = map(int, input().split())
# 一人の監視員は2D + 1本の木を監視できる
# N//(2D + 1) と 余りがあれば1を足した人数が必要になる
from numpy import ceil
print(int(ceil(N / (2*D + 1))))

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

x = 2*d+1
if n%x == 0:
    print(n // x)
else:
    print(n//x + 1)

n,d=map(int,input().split())
if n%(2*d+1)==0:
    print(n//(2*d+1))
else:
    print((n//(2*d+1))+1)

n, d = map(int, input().split())
c = 0
p = d*2 + 1
tmp = 0
while n > tmp:
    tmp = tmp+p
    c += 1
print(c)

N, D = map(int,input().split())
n_list = []

for i in range(1,N+1):
    n_list.append(i)
num = len(n_list) % ((2 * D) + 1)
if num == 0:
    print(len(n_list) // ((2 * D) + 1))
else:
    print((len(n_list) // ((2 * D) + 1))+1)

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

# 一人の監視員がカバーできる範囲
cover_area = (d*2+1)
ans = n // cover_area
if (n % cover_area) != 0:
    print(ans+1)
else:
    print(ans)

n, d = map(int,input().split())
print((n-1)//(2*d+1)+1)

import math
N, D = list(map(int,input().split()))
num = math.floor(N/(D*2+1))
if N%(D*2+1) != 0:
    print((num+1))
else:
    print(num)


from math import ceil
a,b=map(int,input().split())
print(ceil(a/(b*2+1)))

n,d=map(int,input().split())
k=2*d+1
if n%k==0:
    print(n//k)
else:
    print(n//k+1)

import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print((k.join(list(map(str, lst)))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque, defaultdict
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N, D = MI()
    ans = 0
    while N > 0:
        N -= 1 + 2 * D
        ans += 1
    print(ans)

def __starting_point():
    solve()


__starting_point()

N, D = map(int, input().split())
 
# 前から最適に配置せよ
# 一人目は, 1,...,D, D+1, D+2,...,2D+1 を監視
# 二人目は, 2D+2,..., 3D+2, ...,4D+2 を監視
# x人まで繰り返すと、1,...,x(2D+1)まで監視できる
 
# x(2D+1) > N を満たす最小のxは？
# x_min = ceil(N/(2D+1))
 
# ceil(B/A) = floor((A+B-1)/A)
print((N+2*D) // (2*D+1))

n, d = list(map(int,input().split()))
x = 2*d + 1
print(((n + (x - 1))//x))


n,d = list(map(int,input().split(" ")))
d = d*2 + 1
answer = 0
while n >0:
  n-=d
  answer += 1
  
print(answer)


n, d = list(map(int, input().split()))

if n//(2*d+1) == n/(2*d+1):
    print((n//(2*d+1)))
else:
    print((n//(2*d+1)+1))


i, d = list(map(int, input().split()))
a = d * 2 + 1
print(((i + a - 1) // a))


a,b=input().split()
a=int(a)
b=int(b)
if a%(b*2+1)==0:
  print(a//(b*2+1))
else:
  print(a//(b*2+1)+1)

a = list(map(int,input().split()))
N = a[0]
D = a[1]

z = N//(2*D+1)
if N%(2*D+1) == 0:
    print(z)
else:
    print(z+1)

n, d = map(int,input().split())
ans = (n+2*d) // (1+2*d)
print(ans)

from math import floor,ceil
N, D = list(map(int, input().split()))

print((ceil(N/(2*D + 1))))





N,D=map(int,input().split())
ans=0

while N>0:
    N-=D*2+1
    ans+=1
 
print(ans)

n,d=map(int,input().split())
d=d*2+1
if n%d==0:
    print(n//d)
else:
    print(n//d+1)

N, D = map(int, input().split())

if N % (2*D + 1):
    print(N//(2*D + 1) + 1)

else:
    print(N//(2*D + 1))

n,d = map(int,input().split())
print(-(-n//(2*d+1)))

import math as mt
n,d=map(int, input().split())   
print(mt.ceil(n/(2*d+1)))

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

eye = 2 * d +1

if n % eye == 0:
  print(n//eye)
  
else:
  print(n//eye +1)

import math
N,D=map(int,input().split())
print(math.ceil(N/(2*D+1)))

N,D = map(int,input().split())
if(N % (D*2+1) != 0):
    print((N // (D*2+1)) + 1)
else:
    print(N // (D*2+1))

N, D = map(int, input().split())
# 一人の監視員は2D + 1本の木を監視できる
# N//(2D + 1) と 余りがあれば1を足した人数が必要になる
import math
print(int(math.ceil(N / (2*D + 1))))

n,d=map(int,input().split())
i=1
d=2*d+1
while n>d*i:
  i+=1
print(i)

# B Golden Apple
n, d = list(map(int, input().split()))
deco = d * 2 + 1
if n % deco == 0:
    print((n // deco))
else:
    print(((n // deco) + 1))


import math
x,y =map(int,input().split())
print(math.ceil(x/((y+y)+1)))

n,d = map(int,input().split())
a = 2 * d + 1
if n % a == 0:
    print(n // a)
else:
    print(n // a + 1)

N,D=map(int,input().split())
x=2*D+1
if N%x==0:
    print(N//x)
else:
    print(N//x+1)

N, D = map(int, input().split())
rg = D * 2 + 1
print((N + rg - 1) // rg)

import math
n, d = (int(i) for i in input().split())
print(math.ceil(n / (d * 2 + 1)))

N, D = map(int,input().split())
M = 2 * D + 1
if N % M == 0:
  print(N // M)
else:
  print(N // M + 1)

N, D = map(int, input().split())

monitor, ans = 0, 0
while monitor < N:
  monitor += 2*D + 1
  ans += 1
print(ans)

N,D = list(map(int,input().split()))
gard = (D * 2) + 1
print(((int(N/gard),int(N/gard) +1)[N%gard !=0]))


N, D = map(int,input().split())
x = 2 * D +1

if N % x == 0:
    print(N // x)
else:
    print(N // x + 1)

import math
N, D = map(int,input().split())
print(math.ceil(N/(2*D+1)))

N, D = map(int, input().split())
R = N%(2*D+1)
if R != 0:
  L = (N-R)/(2*D+1)+1
else:
  L = N/(2*D+1)
print(int(L))

from math import ceil
n, d = list(map(int, input().split()))
print((ceil(n / (1 + 2 * d))))


N, D = map(int, input().split())

for n in range(1, 25):
    if N <= (2 * D + 1) * n:
        print(n)
        break

N, D = map(int, input().split())
# 一人の監視員は2D + 1本の木を監視できる
# N//(2D + 1) と 余りがあれば1を足した人数が必要になる
import numpy as np
print(int(np.ceil(N / (2*D + 1))))

r=input().split()
N=int(r[0])
D=int(r[1])
if N%(2*D+1)==0:
    print(N//(2*D+1))
else:
    print(N//(2*D+1)+1)

N, D = map(int, input().split())
print(-(-N//(2*D+1)))

N,D = map(int,input().split())
area = D*2 + 1
ans = (N+area-1)//area
print(ans)

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

area = (d*2)+1
if n%area == 0:
    ans = int(n//area)
else:
    ans = int(n//area) + 1

print(ans)

n,d=map(int,input().split())
D=2*d+1
print((n+D-1)//D)

import math

n, d = list(map(int, input().split()))
scope = d * 2 + 1
print((math.ceil(n / scope)))