Problem:
 Score : 200 points    Problem Statement 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 1 6 2      Sample Output 1 2  We can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4 .       Sample Input 2 14 3      Sample Output 2 2       Sample Input 3 20 4      Sample Output 3 3

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

Solution (Python):


import math

if __name__ == '__main__':
    N, D = input().split()
    N = float(N)
    D = float(D)
    numPerUser = 2 * D + 1
    print(math.ceil(N / numPerUser))

Solution (Python):
import sys
import math

input = sys.stdin.readline

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

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

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

Solution (Python):

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

Solution (Python):

"""n = int(input())
print(3*(n*n))
"""
import math as m
N,D = list(map(int,input().split(" ")))
print(m.ceil(N / (2*D+1)))

Solution (Python):
n, d = map(int, input().split())
x = d * 2 + 1
ans = (n + x - 1) // x
print(ans)

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

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

Solution (Python):
N, D = (map(int, input().split()))

for i in range(1, N + 1):
	if i * (1 + D * 2) >= N:
		print(i)
		break

Solution (Python):
N,D=map(int,input().split())

w = D*2+1
div = N // w
mod = N % w

if mod != 0:
    ans = div+1
else:
    ans = div
print(ans)

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

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

Solution (Python):


import math



N,D = map(int, input().split())
ans = 0
while N>0:
  ans += 1
  N -= 2*D+1
print(ans)

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

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

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

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

Solution (Python):
import sys, math

readline = sys.stdin.readline

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

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

print(a)

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

Solution (Python):
import math

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

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

Solution (Python):
import sys,collections as cl,bisect as bs,math
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l(): 
	return list(map(int,input().split()))
def m(): 
	return map(int,input().split())
def onem(): 
	return int(input())
def s(x): 
	a = []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): 
	return " ".join(map(str,x))
def max2(x): 
	return max(map(max,x))

n,m = m()

print(-(-n//(m*2+1)))

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

Solution (Python):

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

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

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

Solution (Python):

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

ans = N // (2*D + 1)
if N % (2*D + 1) != 0:
    ans += 1


print(ans)

Solution (Python):

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


base = 2*d + 1

ans = n//base + (1 if n%base >=1 else 0)

print(ans)

Solution (Python):
n, d = map(int, input().split())
d = 2 * d + 1
ans = n // d
if n % d > 0:
    ans += 1

print(ans)

Solution (Python):



import sys
import math


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

N,D = myinput_int()

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

Solution (Python):
N, D = map(int, input().split())

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

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

Solution (Python):
n,d = map(int,input().split())

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

Solution (Python):
n, d = (int(_) for _ in input().split())
total = d+d+1
if n % total != 0:
    print(n//total + 1)
else:
    print(n//total)

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

Solution (Python):
n, d = list(map(int, input().split()))
d = 2*d + 1

ans = n//d
if n%d !=0:
    ans += 1
print(ans)

Solution (Python):
n, d = map(int,input().split())

a=n%(2*d+1)

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

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

Solution (Python):

import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
MOD = 10**9 + 7
sys.setrecursionlimit(10**7)

dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())


N, D = mi()
D = D * 2 + 1

print(ceil(N/D))

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

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

Solution (Python):
n, d = map(int, input().split())

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

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

Solution (Python):
def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A
    
if __name__ == '__main__':
    N, D = InputToInt()

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

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

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

Solution (Python):
n,d = map(int,input().split())

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

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

Solution (Python):


import sys
inf = float("inf")













from bisect import bisect_left,bisect_right



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

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

Solution (Python):
import math

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

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

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

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

Solution (Python):
import collections as c
ip = lambda : map(int, input().split())

mod = 1e9+7
N,D = ip()
ans = (N+2*D)//(2*D+1)
print(ans)

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

Solution (Python):
import math

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

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

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

Solution (Python):
import numpy as np

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

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

Solution (Python):
N, D = map(int, input().split())
r = 2*D + 1
if divmod(N, r)[1] == 0:
  print( divmod(N, r)[0] )
else:
  print( divmod(N, r)[0] + 1 )

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

N,D=LI()

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

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

Solution (Python):
N, D = map(int, input().split())

cnt = 0
while N >= 1:
    N -= 2 * D + 1
    cnt += 1

print(cnt)

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

Solution (Python):
n, d= [ int(v) for v in input().split() ]
d = 2*d + 1 
ans = n // d
if n % d != 0:
    ans += 1
print(ans)

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

index = 0
count = 0
while True:
    index += D * 2 + 1
    count += 1
    if index >= N:
        break

print(count)

Solution (Python):
N,D=map(int,input().split())

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

Solution (Python):
from math import ceil


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


if __name__ == '__main__':
    main()

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

Solution (Python):
N, D = map(int, input().split())

hitoribun = D + D + 1

ninzuu = N // hitoribun
if N % hitoribun != 0:
    ninzuu += 1

print(ninzuu)

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

Solution (Python):



import sys  
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools



sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe


def local_input():
    from pcm.utils import set_stdin
    import sys
    from pathlib import Path
    parentdir = Path(os.path.dirname(__file__)).parent
    inputfile = parentdir.joinpath('test/sample-1.in')
    if len(sys.argv) == 1:
        set_stdin(inputfile)


def solve():
    n,d = map(int,input().split())

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

if __name__ == "__main__":
    try:
        local_input()
        def dump(*args):
            names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
            print(', '.join(names.get(id(arg),'???')+' => '+repr(arg) for arg in args), file=sys.stderr)
    except:
        def dump(*args):
            pass

    solve()

Solution (Python):
import math
N, D = map(int, input().split())
a = D * 2 + 1
print("{:.0f}".format(math.ceil(N/a)))

Solution (Python):
n, d = map(int, input().split())

window = 2 * d + 1

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

Solution (Python):

import sys


def solve(N: int, D: int):
    res = 0
    while N > 0:
        res += 1
        N -= 1 + 2*D
    print(res)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    D = int(next(tokens))  
    solve(N, D)

if __name__ == '__main__':
    main()

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

Solution (Python):
N,D = map(int,input().split(' '))

p = 2*D+1

print(-(-N//p))

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


main()

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

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

Solution (Python):
import math

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

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

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

Solution (Python):
def main():

    """ convenient functions
    
    
    
    
    
    """

    """convenient decorator
    
    
        
        
        
        
        
        
        
        
        
        
    """
    
    
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product 
    
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  
        b, e = 2, 0  
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict 
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest 
    from copy import deepcopy, copy 
    import operator
    from operator import itemgetter
    
    
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd 
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    
    
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) 
    def modinv(a, p = MOD):
        
        
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        
        
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    """ initialize variables and set inputs
    
        
        
    
        
        
        
        
        
    
        
        
        
        
    
        
        
    """

    
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    
    
    
    
    
    
    
    """

    if __name__ != '__main__':
        
        sys.stdin = open('sample.txt')

    
    

    N, D = R()
    print(ceil(N/(2*D+1)))
    
    
    

    """memo: how to use defaultdict of list
    
    Dic = defaultdict(list)
    
    Dic[x].append(y)
    
    for k, v in Dic.items():
    """

if __name__ == '__main__':
    main()

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

Solution (Python):
n, d = map(int, input().split())

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

if n % (2*d + 1) != 0:
    ans += 1

print(ans)

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

Solution (Python):
n, d = map(int, input().split())

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

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

import math

n,d = na()
g = d*2+1

print(math.ceil(n/g))

Solution (Python):
N, D = map(int, input().split())

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

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

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

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

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

Solution (Python):
import sys
import math

input = sys.stdin.readline

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

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

Solution (Python):
from math import ceil



if __name__ == "__main__":
    n,d = map(int,input().split())
    print(ceil(n/(2*d+1)))

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

Solution (Python):
N,D = map(int,input().split())

d = 2*D+1
ans = N//d

if(N%d != 0):
    ans+=1

print(ans)

Solution (Python):
import sys


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


r = 1+D+D

print(int((N+r-1)/r))

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

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

Solution (Python):
import sys

input = sys.stdin.readline

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

Solution (Python):



 
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 tt in range(t):
    
    n,d= map(int, sys.stdin.readline().split(' '))
    dis = 2*d+1
    val = n//dis
    if val*dis <n:
        val+=1
    print(val)
    
    
    

if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Solution (Python):
import math

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

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

Solution (Python):
n,d = map(int,input().split())

s = 1 + d*2

if n%s != 0:
    ans = n//s + 1
else:
    ans = n//s

print(ans)

Solution (Python):
words = lambda t : list(map(t, input().split()))
n,d = words(int)

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

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

Solution (Python):
def getlist():
	return list(map(int, input().split()))

N, D = getlist()

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

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

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

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

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

Solution (Python):

import sys


def solve(N: int, D: int):
    p, r = divmod(N, D * 2 + 1)
    res = p
    if r > 0:
        res += 1
    print(res)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    D = int(next(tokens))  
    solve(N, D)

if __name__ == '__main__':
    main()

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

Solution (Python):
n, d = map(int, input().split())

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

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


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


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, D):
    return math.ceil(N / (2*D+1))


def main():
    N, D = read_int_n()
    print(slv(N, D))


if __name__ == '__main__':
    main()

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

Solution (Python):
import math

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

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

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

Solution (Python):
a,b = map(int, input().split())
t = 2*b + 1
print((a-1)//t+1)

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

Solution (Python):
import math

N,D = [int(s) for s in input().split()]
print(math.ceil(N/(2*D+1)))

Solution (Python):
import math
N, D = [int(x) for x in input().split()]
print(math.ceil(N/(D*2+1)))

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

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

Solution (Python):
n, d = map(int, input().split())

p = n // (2*d + 1)
q = n % (2 * d + 1)

if q == 0:
    print(p)
else:
    print(p+1)

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

Solution (Python):
N, D = map(int, input().split())

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

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

Solution (Python):
N, D = [int(i) for i in input().split()]
c = 2*D + 1
if N%c == 0:
    print(N//c)
else:
    print(N//c + 1)

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

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

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

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

Solution (Python):
import numpy as np

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

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

Solution (Python):
n, d = map(int, input().split())

pos = d*2 +1
res = n // pos
if n % pos != 0:
    res += 1
print(res)

Solution (Python):
import math

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

Solution (Python):
def solve(N, D):
    if N % (D * 2 + 1) == 0:
        return N // (D * 2 + 1)
    else:
        return N // (D * 2 + 1) + 1

def main():
    A, B = [int(x) for x in input().split()]
    print(solve(A, B))


main()

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

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

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

Solution (Python):
N,D=list(map(int,input().strip().split(" ")))
ans=N//(2*D+1)
if N%(2*D+1)==0:
    print(ans)
else:
    print(ans+1)

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

Solution (Python):
import math
N,D = [int(x) for x in input().split()]
print(math.ceil(N/(D*2+1)))

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

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

Solution (Python):
n, d = map(int, input().split())

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

Solution (Python):
from math import ceil,floor

from sys import exit

from copy import deepcopy
import numpy as np

def main():
    n,d = map(int,input().split())
    d = d*2 +1
    ans = ceil(n/d)


    print(ans)

main()

Solution (Python):
from math import ceil

N,D = [int(zz) for zz in input().split()]

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

Solution (Python):
N,M= map(int,input().split())
chk= M*2+1
print(((N-1)//chk)+1)

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

Solution (Python):
from collections import *
import sys
inp = raw_input

def err(s):
    sys.stderr.write('{}\n'.format(s))

def ni():
    return int(inp())

def nl():
    return [int(_) for _ in inp().split()]

N, D = nl()
lo = 2*D + 1
print((N + lo - 1)/lo)

Solution (Python):

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

Solution (Python):
N, D = map(int, input().split())

div, mod = divmod(N, 2*D+1)

if mod != 0:
    div += 1

print(div)

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

n, k = getList()
hitori = k * 2 + 1
print((n - 1)// hitori + 1)

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