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



Sample input:
6 2


Sample output:
2

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 20:47:47 2019

@author: Owner
"""

import numpy as np
import sys
import collections
import scipy.misc
import math
from operator import itemgetter
import itertools
import copy
import bisect
import heapq

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]
    

"""
N, X = map(int, input().split())

x = list(map(int, input().split()))

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

# 多次元配列の宣言（あとでintにすること。）（タプルにすること。）
dp = np.zeros((N+1, 4,4,4))
    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break
# 累積和
add = 1 # 問題によって決まる
res = 0
sums = [0]*(len(nums)+1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]
for i in range(0, len(nums), 2):
    left = i
    right = min(i+add, len(nums))
    tmp = sums[right] - sums[left]
    res = max(tmp, res)

#２分探索
li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    

#ソート関数
org_list = [3, 1, 4, 5, 2]
new_list = sorted(org_list)
print(org_list)
print(new_list)
# [3, 1, 4, 5, 2]
# [1, 2, 3, 4, 5]

#Distance Transformation
    for h in range(0,H):
        for w in range(0,W):
            if h == 0 and w == 0:
                pass
            elif h == 0:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h-1][W-w]+1)
            elif w == 0:   
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1)
            else:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1, D[H-h-1][W-w]+1, D[H-h][W-w]+2)
            d_max = max(D[H-h-1][W-w-1], d_max)

"""


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

    
def main(): 
    cnt = 0
    now = 0
    for i in range(N):
        cnt +=1
        now = now + 2*D+1
        if now >= N:
            break
        
    print(cnt)
                
                
                
            
            
                

    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

first=d+1
c=1

for i in range(first,n+1):
    if first+d>=n:
        break
    first=first+2*d+1
    c=c+1

print(c)

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
see_area = D * 2 + 1
count = 1
while True:
    if see_area < N:
        N -= see_area
        count += 1
    else:
        break

print(count)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
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 II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

debug = True
#debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    N, D = LI()

    # 初めの監視員の位置
    pos = D + 1
    # first + D + 1 まで見れる

    m = 2*D + 1
    ans = N // m
    if ans * m == N:
        print(ans)
    else:
        print(ans+1)
solve()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
def main():
    N,D = map(int,input().split())
    out = N/(1+D*2)
    print(math.ceil(out))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
line = input();
nums = line.split(" ")
N = int(nums[0])
D = int(nums[1]);
ans = math.ceil(N/(2*D+1))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = (int(_) for _ in input().split())
print(-(-N  // ((D * 2 + 1))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = [int(nd) for nd in input().split()]
observer = D*2 + 1
if N % observer == 0:
  ans = N // observer
else:
  ans = N // observer + 1
print(ans)

Submission status: Accepted

Solution code:
import numpy as np


def main():
	N, D = [int(x) for x in input().split()]
	
	p = N // (1+D*2)
	if not N % (1+D*2) == 0:
		p += 1
	print(p)
	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

kanshi = 2*D + 1
ans = (N + 2*D) // kanshi

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans,mod = divmod(n,watch)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A=[int(n) for n in input().split()]
print(math.ceil(A[0]/(A[1]*2+1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n, d = (int(i) for i in input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,heapq,math,resource
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def setrlim():
  sys.setrecursionlimit(250000)
  soft,hard = resource.getrlimit(RLIMIT_STACK)
  # setrlimit works on ubuntu (and atcoder), but not on WSL
  #resource.setrlimit(RLIMIT_STACK, (128*1024*1024,hard))


n,d = inm()
e = 2*d+1
print((n+e-1)//e)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
import math
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


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

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


# region fastio

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")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    ans = N // (D*2 + 1)

else:
    ans = N // (D*2 + 1) + 1

print(ans)

Submission status: Accepted

Solution code:
n,d=map(int,input().split())
k=2*d+1
ans=n/k
ANS=n//k
if ans==ANS:
  print(int(ans))
else:
  print(ANS+1)

Submission status: Accepted

Solution code:
n,d=map(int,input().split())
s=2*d+1
ans=0
a=0
while n>a:
  a=a+s
  ans=ans+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os, sys, re, math

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    N, D = map(int, input().split())

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

input = lambda: stdin.readline().rstrip()
main()

Submission status: Accepted

Solution code:
from sys import stdin
N,D = [int(x) for x in stdin.readline().rstrip().split()]
F = D*2 + 1
ans = N // F
if (N % F) > 0:
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n,d = map(int,input().split())
#左から純に配置．d+1,3*d+2,,(2i-1)*d+i
#iばんめの人...(2i)*d+iまで見れる．これがn以上
for i in range(1,n+1):
    if 2*i*d+i >= n:
        print(i)
        break

Submission status: Accepted

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

tmp = n
c = 0
while tmp >= 0:
	if tmp > 0:
		c+=1
	tmp-=(2*d)+1
print(c)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math


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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    token = lines[0].split()
    n = int(token[0])
    d = int(token[1])

    return (n, d)


def solve(n, d):

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




def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

r = (d * 2 + 1)

rrr = n // r
if (n % r != 0):
    rrr += 1

print(rrr)

Submission status: Accepted

Solution code:
import math
#input = raw_input


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

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

Submission status: Accepted

Solution code:
# coding: utf-8

n, d = [int(x) for x in input().split(' ')]

d_range = 2 * d + 1

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N,D=map(int,input().split())
if 2*D+1>=N:
    ans=1
elif N%(2*D+1)==0:
    ans=int(N/(2*D+1))
else:
    ans=(N//(2*D+1))+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, d = map(int, input().split())
count = 0
cover = 2 * d + 1

#print(n // cover)

while n > 0:
    n -= cover
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
n, d = list(map(int,input().split()))
ans = 0
while True:
	ans = ans + 1
	if (1 + 2 * d) * ans >= n:
		print(ans)
		break

Submission status: Accepted

Solution code:
t,d=map(int,input().split())

res=1

for i in range(20):
	if t>2*d+1:
		res+=1
		t-=2*d+1

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, D = tuple([int(s) for s in input().split(' ')])
if (N % (2 * D + 1) == 0):
    print(N // (2 * D + 1))
else:
    print(N // (2 * D + 1) + 1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
import math
print(math.ceil(a[0]/(2*a[1]+1)))

Submission status: Accepted

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

Submission status: Accepted

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

num = 1
look = 2*D+1
while(1):
    if look*num >= N:
        break
    num += 1
print(num)

Submission status: Accepted

Solution code:
import math
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)

Submission status: Accepted

Solution code:
import io
import sys
from math import ceil


def IN_S():
  return input()


def IN_I():
  return int(input())


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


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


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
20 1
'''


def MAIN():
  # T_IN()
  A()


def A():
  n, d = IN_L_I()

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

  return None


def B():
  return None


def C():
  return None


MAIN()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


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

    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
[N, D] = [int(i) for i in input().split()]
E = 2*D + 1
ans = 0

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

Submission status: Accepted

Solution code:
import math

a, b = input().split()
a, b = int(a), int(b)

print(math.ceil((a/(b*2 +1))))

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
from functools import reduce
import sys
import math
import bisect
import random
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return list(map(float, sys.stdin.readline().split()))
def LS():return sys.stdin.readline().split()
def SR(n): return [list(sys.stdin.readline())[:-1] for i in range(n)]
def IR(n): return [int(sys.stdin.readline()) for i in range(n)]
def LIR(n): return [list(map(int, sys.stdin.readline().split())) for i in range(n)]
def LSR(n): return [list(map(list, sys.stdin.readline().split())) for i in range(n)]
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

N, D = LI()

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

Submission status: Accepted

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

ans = N // (2 * D + 1)
amr = N % (2 * D + 1)

if amr == 0:
  print(ans)

else:
  print(ans + 1)

Submission status: Accepted

Solution code:
import math

inp = input().split()
n = int(inp[0])
d = int(inp[1])

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# ABC 134, B -

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

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

Submission status: Accepted

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

a = (2 * d) + 1

ans = -(-n // a)

print(ans)

Submission status: Accepted

Solution code:
import math

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

one = D * 2 + 1
amari = N % one
res = math.floor(N / one)
if amari > 0:
    res += 1

print(res)

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
distance = 0
for i in range(20):
    distance += D * 2 + 1
    if distance >= N:
        print(i+1)
        exit()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


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

Submission status: Accepted

Solution code:
import sys
import numpy as np
from scipy.misc import comb
sys.setrecursionlimit(1000000)
 
n,d = map(int,input().split())

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

Submission status: Accepted

Solution code:
n, d = list(map(lambda x: int(x), input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n, d = map(int, input().split())
watch = d * 2 + 1
if n < d:
    print(1)
else:
    print(math.ceil(n/watch))

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

see = 2*D+1

if N%see==0:
    ans = N/see

else:
    ans = (N-(N%see))/see + 1

print(int(ans))

Submission status: Accepted

Solution code:
N,D=map(int,input().split())
R=int(2*D+1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n, d = list(map(int, input().split(" ")))
  
    p = n // (2*d+1)
    if n % (2*d+1):
        p += 1

    print(p)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = 1
if N % (D*2+1) == 0:
    a = 0

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

Submission status: Accepted

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

def hoge(n,d):
    if 0 >= n:
        return 0
    if d * 2 + 1 >= n:
        return 1
    return 2 + hoge(n - (d * 2 + 1)*2,d)

print(hoge(N,D))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, d = [int(i) for i in input().split()]
for i in range(20):
    if((2*d+1)*i >= n):
        print(i)
        exit()

Submission status: Accepted

Solution code:
ls=input().split()
n=int(ls[0])
d=int(ls[1])
dd=int(2*d+1)
a=n//dd
b=n%dd
if b!=0:
    print(int(a+1))
else:
    print(int(a))

Submission status: Accepted

Solution code:
n , d = list(map(lambda x: int(x), input().split()))

watch_range = 1 + 2*d

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

if __name__ == '__main__':
    N, D = [int(x) for x in stdin.readline().rstrip().split()]
    
    count = 0
    while (N > 0):
        N -= ( 2*D + 1 )
        count += 1
    print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys

sys.setrecursionlimit(10**7)

# Override `input` function because `stdin.readline()` is 10x faster than built-in `input()`
input = sys.stdin.readline


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h(typ) if m > 1 else typ(input()) for _ in range(n)]


def main():
    n, d = read_h()
    cov = 2 * d + 1

    import math
    ans = math.ceil(n / cov)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))
n = hoge[0]
d = hoge[1]

d = d*2 +1

ans = (n-1)//d + 1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

N, D = [int(x) for x in stdin.readline().rstrip().split()]

tmp = N // (2 * D + 1)
tmp2 = N % (2 * D + 1)

if tmp2 == 0:
    print(tmp)
else:
    print(tmp+1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    n, d = rli()
    ans = n // (2*d+1)
    if n % (2*d+1) > 0:
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, D = list(map(int, input().split()))
for i in range(1, 21):
    if (2*D+1)*i - N >= 0:
        print(i)
        break

Submission status: Accepted

Solution code:
ini=input().split()
ini=[int(i) for i in ini]
N=ini[0]
D=ini[1]

ans=N//(D*2+1)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a, b = divmod(n , (d*2+1))
if b!=0:
    a=a+1
    
print("{}".format(a))

Submission status: Accepted

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