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:
n, d = list(map(int,input().split(" ")))
ans = n//(1+2*d)
if n%(1+2*d) == 0:
  print(ans)
else:
  print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if n%(1+d+d) == 0:
  person = n//(1+d+d)
else:
  person = n // (1+d+d) + 1

print(person)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
if n % (k * 2 + 1) == 0:
  print(n//(k*2+1))
else:
  print(n//(k*2+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, b = map(int, input().split())
c = b * 2 + 1
d = a // c
if a % c != 0:
    print(d + 1)
else:
    print(d)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

look_len = D * 2 + 1

ans = N // look_len

am_zero = N % look_len
if am_zero != 0:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,D=map(int,input().split())
span=D*2+1
count=0
for i in range(1,N+1):
    if i%span==0:
        count+=1

if N%span!=0:
    count+=1
print(count)

Submission status: Accepted

Solution code:
import math
N, D = list(map(int, input().split()))
print(str(math.ceil(N/(D*2+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:
s = list(map(int, input().split()))

for i in range(1, s[0] + 1):
    n = 2 * s[1] * i + i
    if s[0] <= n:
        ans = i
        break

print(ans)

Submission status: Accepted

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

import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
i=1
while i*(a[1]*2+1)<a[0]:
  i+=1


print(i)

Submission status: Accepted

Solution code:
ND = input()
N,D = [int(i) for i in ND.split(" ")]
D_2 = D*2 + 1

cnt = 1
while(1):
    if (D_2 * cnt) >= N:
        print(cnt)
        break
    cnt += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

K = D * 2 + 1

if N < K:
  print(1)
elif N % K == 0:
  print(N // K)
else:
  print(N // K+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N, D = read_int()

def solve():
    return -(-N // (2 * D + 1))

if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

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:
nd = list(map(int, input().split(' ')))

a = nd[0] // (nd[1]*2+1)

if (nd[0]%(nd[1]*2+1)) != 0:
    a += 1

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, d = [int(x) for x in input().split()]
print((n + 2*d) // (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())
if n % (d * 2 + 1) == 0:
    print(n // (d * 2 + 1))
else:
    print(n//(d*2+1)+1)

Submission status: Accepted

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

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:
n , d = map(int , input().split())
cnt = 0
while (n):
  cnt += 1
  n -= 2 * d + 1
  if (n <= 0) : break
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())

c = a//(2*b+1)


if a % (2*b+1) ==0:
  print(c)
  
else:
  print(c+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    N, D = map(int, input().split())
    
    r = D * 2 + 1
    q , mod = divmod(N, r)
    
    print(q if mod == 0 else q + 1)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

d = d*2 +1
if d >= n:
    ans = 1
else:
    q = n//d
    mod = n % d
    ans = q
    if mod != 0:
        ans += 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())
print(n//(2*d+1) + bool(n%(2*d+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:
n, d = [int(i) for i in input().split()]

temp = d + 1
res = 1
while temp < n - d:
    temp += 2 * d + 1
    res += 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math 

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

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

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

calc = (n + 1) // (d * 2 + 1)
mod = (n + 1) % (d * 2 + 1)

if mod <= 1:
    ans = calc
else:
    ans = calc + 1

print(ans)

Submission status: Accepted

Solution code:
n, d = list(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())
d = 2 * d + 1
print(math.ceil(n / d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
shuru=input()
shuru=shuru.split()
n=int(shuru[0])
d=int(shuru[1])
d=2*d+1
ans=n//d
if n%d!=0 :
  ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s = N % (2 * D + 1)
n = int(N / (2 * D + 1))

if s == 0:
    print(n)
else:
    print(n+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nd = [int(i) for i in input().split()]
n = nd[0]
d = nd[1]
i = 0
while True:
    if n <= (2*d+1)*i:
        flag = i
        break
    else:
        i = i + 1
        
print(flag)

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) + int(N - N // (2 * D + 1) * (2 * D + 1) > 0)
print(ans)

Submission status: Accepted

Solution code:
i = input().split(" ")
n = int(i[0])
d = int(i[1])

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

Submission status: Accepted

Solution code:
import math

S = input()

S = S.split()

N = int(S[0])
D = int(S[1])

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())

# calc
if a % (b*2+1) == 0:
    print(a//(b*2+1))
else:
    print(a//(b*2+1)+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N, D = map(int, input().split())

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

Submission status: Accepted

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

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

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:
n,d = map(int, input().split(" "))
width = 2*d + 1
ans = n//width
if n%width == 0:
    print(ans)
else:
    print(ans+1)

Submission status: Accepted

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


def main():
    from math import ceil

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
INPUT_SENTENCES = 1                                                                                                                                                                                                 
ss = [input() for i in range(INPUT_SENTENCES)][0].split(" ")                                                                                                                                                        
N = int(ss[0])                                                                                                                                                                                                      
D = int(ss[1])                                                                                                                                                                                                      
result = []                                                                                                                                                                                                         
s = 0                                                                                                                                                                                                               
cnt = 0                                                                                                                                                                                                             
for i in range(N):                                                                                                                                                                                                  
    s += 2*D+1                                                                                                                                                                                                      
    cnt += 1                                                                                                                                                                                                        
    if s >= N:                                                                                                                                                                                                      
        break                                                                                                                                                                                                       
print(cnt)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

Submission status: Accepted

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

D=2*d+1
syou=N//D
amari=N%D

if amari != 0:
  syou=syou+1

print(syou)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,D=map(int,input().split(" "))
mem=0
while N>(D*2+1)*mem:
    mem+=1
print(mem)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,d = map(int,(input().split()))
q,r = divmod(n,(2*d+1))
if r==0:
    answer = q
else:
    answer = q+1
print(answer)

Submission status: Accepted

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

import itertools as ite
import math
import random
import sys
import codecs
from collections import defaultdict

INF = 10 ** 18
MOD = 10 ** 9 + 7

sys.setrecursionlimit(1000000)

N, D = map(int, raw_input().split())
print N / (2 * D + 1) + (N % (2 * D + 1) != 0)

Submission status: Accepted

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

d = d*2+1

for i in range(1,n+1):
    n -= d
    if n < 1:
        break

print(i)

Submission status: Accepted

Solution code:
import math

# スペース区切り整数の入力
N, D = map(int, input().split())
# 最小の監視員数の出力
print("{}".format(math.ceil(N / (2 * D + 1))))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#abc134b
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,D = map(int,input().split())
S = 0
cnt = 0
while S < N:
  S += 1+2*D
  cnt +=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/

import math
import statistics

n,d = map(int, input().split())
print((n + d * 2) // (d * 2 + 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:
from heapq import heappush, heappop
import re
from collections import deque
import sys
import math
input = sys.stdin.readline


def int_raw():
    return int(input())


def ss_raw():
    return input().split()


def ints_raw():
    return tuple(map(int, ss_raw()))


DIV = 10**9+7


def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


def main():
    N,D = ints_raw()
    D2 = D*2+1
    return (N+D2-1)//D2
print(main())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

D = 2 * D + 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

n=1
while N>(2*D+1)*n:
  n=n+1

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,d=map(int,input().split())
res=0
ans=0
for i in range(1,n+1):
    res=res+(2*d)+1
    if res>=n:
        ans=i
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main11():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    result = int(num[0] / (num[1] * 2 + 1))
    if int(num[0] % (num[1] * 2 + 1)) != 0:
        result = result + 1
    print(result)

if __name__ == "__main__":
    main11()

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:
n, d = list(map(int, input().split()))
s = d * 2 + 1

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

Submission status: Accepted

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

d, m = divmod(N, 2 * D + 1)
if m != 0:
    d += 1
print(d)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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



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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,d=input().split()
i=1+int(d)*2
count=1
while i<int(n):
    count+=1
    i=i+int(d)*2+1
print(str(count))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputLine = input().split()
N = int(inputLine[0])
D = int(inputLine[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

m = N // r
if N % r > 0:
    m += 1

print(m)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

q,mod = divmod(N ,((D*2)+1)) 
if ( mod == 0):
	print(q)
else:
	print(q+1)

Submission status: Accepted

Solution code:
import math
def q45(n, d):
    a = math.ceil(n/(2*d+1))
    return a

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

Submission status: Accepted

Solution code:
def solve(n, d):
    i = 0
    while i * (2* d + 1) < n:
        i += 1
    return i
 
n, d = map(int ,input().split())
print(solve(n, d))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def solve(n, d):
    i = 0
    while i * (2* d + 1) < n:
        i += 1
    return i

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

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())
a = 2*d+1
print(n//a) if n%a == 0 else print((n//a)+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

S = input().split()
N = int(S[0])
D = int(S[1])

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

Submission status: Accepted

Solution code:
import math

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

k = d*2 + 1

print(math.ceil(n/k))

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(N//d + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
i = list(map(int, input().split()))
N = i[0]
D = i[1]

shiya = 2*D + 1

if N%shiya == 0:
    human = int(N/shiya)
else:
    human = int(N/shiya)+1

print(human)

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:
import math
import fractions
import copy
import numpy as np

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
x,y = ips()
y= y*2+1
if x%y == 0:
    print(x//y)
else:print(x//y+1)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

c = D * 2 + 1

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

Submission status: Accepted

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

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 = list(map(int, input().split()))

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

Submission status: Accepted

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

print(N // (2*D + 1) if N % (2*D + 1) == 0 else N // (2*D + 1) + 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 = map(int, input().split())
ans = sum(1 for _ in range(0, N, 2*D + 1))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
N,D = map(int,input().split())
print(-(-N//(D*2+1)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil

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

t = 2 * d + 1

print(ceil(n/t))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
nd=input()
ndlis=['' for i in range(2)]
ndlis=nd.split()
n=int(ndlis[0])
d=int(ndlis[1])
on=0
cnt=0
while on==0:
	cnt=cnt+1
	if n<=cnt*(d*2+1):
		on=1
print(cnt)

Submission status: Accepted

Solution code:
from sys import stdin

N, D = [int(x) for x in stdin.readline().rstrip().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 = list(map(int,input().split()))
sight = 2*d+1
print((n//sight) + (n%sight != 0))

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())
print((n + 2*d) // (2 * d + 1))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys, math, bisect, random, itertools
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = II()
    print(n*n*3)
    return

#B
def B():
    n, d = LI()
    print((n-1)//(2*d+1)+1)
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

Solution code:
i = list(map(int,input().split()))
if i[0]%(2*i[1]+1):
  print((i[0]//(2*i[1]+1))+1)
else:
  print(i[0]//(2*i[1]+1))

Submission status: Accepted

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

x = 0
while True:
  if N <= (2 * D + 1) * x:
    break
  x += 1
print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

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