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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=list(input().split())
n=int(x[0])
d=int(x[1])
range=2*d+1
print(-(-n//range))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

r = 2 * d + 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:
from math import ceil
N, D = map(int, input().split())
print(ceil(N/(D*2+1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

from math import ceil

result = ceil(N / (D + D + 1))

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

a = 2 * d + 1

print(math.ceil(n / a))

Submission status: Accepted

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

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

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#134b
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())
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 = input().split()
N = int(n)
D = int(d)
dis = 0
count = 0
while dis < N:
    dis += D
    count += 1
    dis += 1
    dis += D
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
cover = m*2+1
p = n / cover
if p.is_integer():
    print(int(p))
else:
    print(int(p) + 1)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,8):
    if i >= n[0]/(2*n[1]+1):
        print(i)
        break

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


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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(10 ** 7)


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


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools
# (tips: You use the default template now. You can remove this line by using your custom template)
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:
n, d = map(int, input().split())
print(n // (d*2 + 1)) if n % (d*2 + 1) <= 0 else print(n // (d*2 + 1) +1)

Submission status: Accepted

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

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

else:
	print(k+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(x)

Submission status: Accepted

Solution code:

import math




def main():
    line = input()
    numbers = [int(x) for x in line.split()]
    n = numbers[0]
    d = numbers[1]
    interval = 2 * d + 1
    print(math.ceil(n / interval))



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
def func():
    num_apple, index = input('').rstrip().split(' ')
    return math.ceil(int(num_apple) / (2*int(index) + 1))

if __name__ == '__main__':
    print(func())

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, d = list(map(int, input().split(' ')))
now = 0
ans = 0

while now < n:
    ans += 1
    now += 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:
N,D =  [int(i) for i in input().split()]

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf8 -*-

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

def main(): 

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

    dp = d*2 + 1

    print(math.ceil(n / dp))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import stdin
import math

n,d = [int(x) for x in stdin.readline().rstrip().split()]
print(math.ceil(n / (2*d+1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(-((-a)//(2*b+1)))

Submission status: Accepted

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

Submission status: Accepted

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

moniter = D+(D+1)
print(math.ceil(N / moniter))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, d = map(int, input().split())
result = int(n//(2*d+1))
m = n % (2*d+1)
if m != 0:
    result += 1
print(result)

Submission status: Accepted

Solution code:
#Coding:Utf-8

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 = map(int, raw_input().split())
Divider = (D * 2 + 1)
ans = (N + Divider - 1) / Divider
print ans

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
from heapq import *
sys.setrecursionlimit(10**8)

input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

if __name__ == '__main__':
    N, D = map(int, input().split())
    observ_area = (2 * D) + 1
    observers = math.ceil(N / observ_area)
    print(observers)

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(float,input().split())
d = 2 * D + 1

n = math.ceil(N / d)
print(n)

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

Submission status: Accepted

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

Submission status: Accepted

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

if 2 * d >= n - 1:
    print(1)
    exit()
cnt = 1
wide = 2*d
while(wide < n - 1):
    cnt += 1
    wide += 2 * d + 1
print(cnt)

Submission status: Accepted

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

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 = list(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:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# 初項s, 交差dのn個の数列の和
def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

import numpy as	np

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

print(ans)

Submission status: Accepted

Solution code:
from math import ceil

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n, d = list(map(int, input().rstrip('\n').split()))
    print((n + d * 2) // (d * 2 + 1))


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = list(int(num) for num in input().split(' '))

i=1

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

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
import math
from copy import deepcopy
from collections import deque
sys.setrecursionlimit(20000000)


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

    p = D*2 + 1
    ans = math.floor(N / p)

    if ans * p >= N:
        print(ans)
    else:
        print(ans+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:
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 = 0
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:
N, D = map(int, input().split())

d = 2 * D + 1
ans = -(-N // d) #切り上げ

print(ans)

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

r = d * 2 + 1

ob1, ob2 = divmod(n, r)

if ob2 > 0:
	ob1 += 1

print(ob1)

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:
import math
a = list(map(int, input().split()))
#b = int(input().split())
print(math.ceil(a[0] / ( 2 * a[1] + 1)))

Submission status: Accepted

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

Submission status: Accepted

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

wch = 2*b + 1
if a%wch == 0:
    print(int(a/wch))
    exit()
print(a//wch+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from math import ceil

def solve(N: int, D: int):
    print(ceil(N/(2*D+1)))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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:
n = list(map(int,input().split()))

if n[0]%(n[1]*2+1) > 0:
  i = 1
else:
  i = 0

print(int( n[0]//(n[1]*2+1) )+i)

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 = (int(a) for a in input().split())
print(-(-N//(D*2+1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2d+1 監視できる

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, d = na()
id = d * 2 + 1
print(n // id if n % id == 0 else n // id + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

n,d = map(int,stdin.readline().rstrip().split())

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

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

Submission status: Accepted

Solution code:

#N本のりんごの木、D人の監視
N,D = map(int,input().split())

#監視員の目の範囲(自分がいるマスと左右D分)
me = 2 * D + 1

#答え
ans = 0

while True:
    ans += 1
    N = N - me
    if N <= 0:
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,D = MI()
    M = 2*D + 1
    print(ceil(N/M))
if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: UTF-8 -*-
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) if n%(2*d+1)==0 else 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

inputs = [int(x) for x in input().split()]
n, d = inputs[0], inputs[1]

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(100):
  if N <= 2*D*i + i:
    break
print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = 2 * D + 1

ans = 1
while True:
    if ans * x >= N:
        break
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

e = d*2+1

if n%e==0:
	print(int(n/e))
else:
	print(int(n/e)+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())
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:
n, d = map(int, input().strip().split())
print(int((n + (2 * d + 1) - 1) / (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:
# coding: utf-8
ind = list(map(int,input().split()))
n = ind[0]
d = ind[1]
kansatsu = 2*d+1
if n%kansatsu == 0:
    print(int(n/kansatsu))
else:
    print(int(n/kansatsu)+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

while N > a*cnt :
    cnt += 1
    if N < a*cnt :
        break

print(cnt)