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:
import math
n, d = [int(i) for i in input().split()]
print(math.ceil(n / (d*2+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())
count = 0
c = 0
while count < n:
    count += 2*d+1
    c += 1

print(c)

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

Submission status: Accepted

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

area = 2 * D + 1

if N % area != 0:
    print(N // area + 1)

else:
    print(N // area)

Submission status: Accepted

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

Submission status: Accepted

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

a=n//(2*d + 1)
if n%(2*d + 1)>=1:
  a+=1
print(a)

Submission status: Accepted

Solution code:
# import itertools
import math

import sys
input = sys.stdin.readline


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

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

# P = []
# S = []
# for i in range(N):
#     pp, ss = map(int, input().split())
#     P.append(pp)
#     S.append(ss)

print(solve(N, D))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

dd = 2*d + 1

print((n+dd-1) // dd)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int, D: int):
    from math import ceil
    print(ceil(N/(2*D+1)))
    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))  # type: int
    D = int(next(tokens))  # type: int
    solve(N, D)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

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

print(result2)

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(x) for x in input().split()]

r = (d * 2) + 1

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

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

Submission status: Accepted

Solution code:
x = input().split()
N, D= [int(i) for i in x]
t = 0
while N > 0:
  N -= (2*D+1)
  t += 1
print(t)

Submission status: Accepted

Solution code:
n,d=map(int,input().split())
cnt=0
nn=1
while True:
  cnt+=1
  nn = nn+d+d
  if nn >= n:
    break
  nn+=1
  
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
 
num = D*2 + 1
if N % num == 0:
    print(int(N / num))
else:
    print(N // num + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import math

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

scope = (D * 2) + 1

res = math.ceil(N / scope)

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

if (n % dis) == 0:
	ans = int(n / dis)
else:
	ans = int((n // dis)+1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
ans = 0
while A > 0:
    A -= (B*2+1)
    ans += 1
print(ans)

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:
import numpy as np
n, d = map(int, input().split())
num = 2 * d + 1
ans = np.ceil(n / num)
print(int(ans))

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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 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 % (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())
for i in range(1,n+1):
    if (d*2+1)*i >= n:
        a = i
        break
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

    one = 1 + 2 * d

    print(math.ceil(n/one))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,D=map(int,input().split())
cnt=1
while True:
  if cnt*(2*D+1)>=N:
    print(cnt)
    break
  cnt+=1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nd=list(map(int,input().split()))
ans=nd[0]//(2*nd[1]+1)
if nd[0]%(2*nd[1]+1)!=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(int((n + 2 * d) / (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:
import math
N, D = map(int, input().split())

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

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    import math

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

    
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:
from math import ceil

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

Submission status: Accepted

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

can_watch = D * 2 + 1
member = 0
for s in range(0, N+1):
    if can_watch * int(s) >= N:
        member += s # member = s
        break
print(member) # print(min(member))

Submission status: Accepted

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

while ((2 * D) + 1) * p < N:
    p += 1

print(p)

Submission status: Accepted

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

Submission status: Accepted

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

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

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 math
n,d=map(int, input().split())
print(math.ceil(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:
def main():
    n, d = map(int, input().split())
    res = n // (d * 2 + 1)
    if n % (d * 2 + 1) != 0:
        res += 1
    print(res)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

canlook=2*d+1

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

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:
n, d = [int(_) for _ in input().split()]

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

Submission status: Accepted

Solution code:
n, d = [int(_) for _ in input().split()]

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
c=2*b+1
i=1
while c*i<a:
    i+=1
else:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
def main():
    N, D = map(int, input().split(" "))
    print(round((D + N) / (2 * D + 1)))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
n, d = map(int, input().strip().split())
ans=math.ceil(n/(2*d+1))
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:
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:
# coding: UTF-8
import math

Arr = input().rstrip().split(' ')
N = int(Arr[0])
D = int(Arr[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

	if n // area_d == n/area_d:
		print(n//area_d)
	else:
		print(n//area_d + 1)

 
if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
i=1
while True:
  if (2*D+1)*i>=N:
    print(i)
    break
  else:
    i+=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:
import math
N,D=map(int,input().split())
print(math.ceil(N / (2*D+1)))

Submission status: Accepted

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

Submission status: Accepted

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

if n%a==0:
    print(n//a)
else:
    print(n//a+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:
def main():
    N, D = map(int, input().split())
    if (N/((D*2)+1)).is_integer():
        return (N/((D*2)+1))
    else:
        return (N//((D*2)+1)) + 1

if __name__ == '__main__':
    print(int(main()))

Submission status: Accepted

Solution code:
# Golden Apple

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

# solve
res = N // (2*D + 1) + 1 * (N % (2*D + 1) != 0)

# output
print(res)

Submission status: Accepted

Solution code:
import math
tree_num, monitor_distance = [int(x) for x  in input().split()]
hitori = monitor_distance*2 + 1
kazu = (tree_num + monitor_distance*2) / hitori
print(int(kazu))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

q, r = divmod(N, t)
print(q + 1 if r > 0 else q)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
cnt = 0
# * * * * * *
#     * *

while (True):
    if N > 0:
        cnt += 1
        N -= (2 * D + 1)

    else:
        break

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for _ in range(n):
    if num*(2*d+1)<n:
        num += 1

print(num)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

ava = d*2 + 1

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

Submission status: Accepted

Solution code:
(A, B), = [list(map(int, s.split())) for s in open(0)]

p = B*2 + 1
if A % p == 0:
    print(int(A / p))
else:
    print(A // p + 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,s=map(int,input().split())

count=n//(2*s+1)

if n%(2*s+1)==0:
    print(count)
else:
    print(count+1)

Submission status: Accepted

Solution code:
n, d = [int(x) for x in input().split()]

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n,d=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:
A,B = map(int,input().split())
print((A+2*B)//(2*B+1))

Submission status: Accepted

Solution code:
n, d = map(int, input().split())
cnt = 0
sum = 0
while sum < n:
    cnt+=1
    sum+=d*2+1
print(cnt)

Submission status: Accepted

Solution code:
N, D = map(int, input().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())
dd=d*2+1
if n%dd==0:
	print(n//dd)
else:
	print(n//dd+1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = [int(i) for i in input().split()]

q, r = divmod(N, (2*D)+1)

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

Submission status: Accepted

Solution code:
N,D=map(int,input().split())
a=(N%(D*2+1))
if a==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())
ans=math.ceil(n/(2*d+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:
import math
N, D = list(map(int, input().split(" ")))
print(math.ceil(N / (2 * D + 1)))

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

Submission status: Accepted

Solution code:
import math

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

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

print(math.ceil(ans))

Submission status: Accepted

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

idx = 1
cnt = 0

idx += D
cnt += 1
if idx + D >= N:
    print(cnt)
    exit()
else:
    while idx + D < N:
        idx += ((2 * D) + 1)
        cnt += 1
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = (int(x) for x in input().split())
X = N / (2 * D + 1)
#print(X)
if (X.is_integer()):
  print(int(X))
else:
  print(int(X) + 1)

Submission status: Accepted

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

tree = list(range(1,N+1))

answer = 0
while tree:
    tree = tree[1+2*D:]
    answer += 1

print(answer)

Submission status: Accepted

Solution code:
import math

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

wk = d * 2 + 1

ans = math.ceil(n / wk)

print(ans)

Submission status: Accepted

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

persons = n/(d*2+1)

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

else:
    print(int(persons))

Submission status: Accepted

Solution code:
N,D=map(int,input().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())
print((N-1)//(D*2+1)+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:
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:
# -*- coding: utf-8 -*-
N,D = [int(i) for i in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

ans = math.ceil(n / watch)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def golden_apple(N: int, D: int)->int:
    ans = N // (2*D+1)
    if N % (2*D+1):
        ans += 1
    return ans


if __name__ == "__main__":
    N, D = map(int, input().split())
    ans = golden_apple(N, D)
    print(ans)

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
ans = 0
checked = 0
while True:
    checked += (1 + 2* D)
    ans += 1
    if checked >= N:
        break
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:
import sys
import math

if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

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

Submission status: Accepted

Solution code:
n,a=map(int,input().split())
c=0
while True:
    n=n-(a*2+1)
    c+=1
    if n<=0:
        print(c)
        exit()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

n = N / (1 + 2 * D)

result = math.ceil(n)
print(result)

Submission status: Accepted

Solution code:
n, d = (int(i) for i in input().split())
p = d * 2 + 1
cnt = 0
while (n > 0):
    n -= p
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import sys

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

while True:
    if((2*D+1)*count>=N):
        print(count)
        sys.exit()
    count+=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())
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 = map(int, input().split())
d = D*2+1
print((N+d-1)//d)

Submission status: Accepted

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

if (a[0]%(1+a[1]*2)) ==0:
    print(int(a[0]/(1+a[1]*2)))
else:
  print((a[0]//(1+a[1]*2))+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())
r = d * 2 + 1
ans = math.ceil(n / r)
print(ans)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N,D=map(int,input().split())

temp=2*D+1

print(-(-N//temp))

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())
for i in range(1,8):
  if i*(2*d+1)>=n:
    print(i)
    exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
list1=input().split()
s=int(list1[0])/(1+2*int(list1[1]))
print(math.ceil(s))

Submission status: Accepted

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

Submission status: Accepted

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

n = nd[0]
d = nd[1]

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

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

Submission status: Accepted

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