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

Submission status: Accepted

Solution code:
import math


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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

# n木の数 d監視員が監視する範囲+-d
n, d = map(int, input().split())
monitoring_range = (d * 2) + 1
print(math.ceil(n / monitoring_range))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Nは木の本数を示す。
N,D = map(int, input().split())
#一人の監視員がみることができる木の数
can_see = 2*D+1
#必要となる監視員の人数
number = 0

number =int( N / can_see)

if (N % can_see != 0):
    number += 1
print(number)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

    # if (N <= 2*D+1) :
    #     print(1)

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

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


main()

Submission status: Accepted

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

d = 2*D+1
answer = N//d
if N%d > 0:
    answer += 1
print(answer)

Submission status: Accepted

Solution code:
n, d = map(int, input().split())
x = 2*d+1	#監視可能範囲
if n%x == 0:
	print(n//x)
else:
  print(n//x + 1)

Submission status: Accepted

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

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

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


if __name__ == "__main__":
    test()

Submission status: Accepted

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

if N % l == 0:
    ans = N // l
else:
    ans = N // l + 1

print(ans)

Submission status: Accepted

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

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 sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [N, D] = string_to_int(inputs[0])
    counter = -D
    num_person = 0
    is_just_increase = False
    for i in range(N):
        is_just_increase = False
        if counter == D:
            counter = -D
            num_person += 1
            is_just_increase = True
        else:
            counter += 1
    if not is_just_increase:
        num_person += 1
    return num_person


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

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

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

Submission status: Accepted

Solution code:
import math 

list1=[int(i) for i in input().split()]
N = list1[0]
D = list1[1]
#目的の監視は　2*D+1
ans = math.ceil(N/(2*D+1))
print(ans)

Submission status: Accepted

Solution code:
from math import ceil

def solve(a:int, b:int):
    print(ceil(a/(b*2+1)))

def main():
    a, b = map(int, input().split(" "))
    solve(a, b)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

if temp-int(temp)>0:
  print(int(temp+1))
else:
  print(int(temp))

Submission status: Accepted

Solution code:
import math
ND = input()
N = int(ND.split(' ')[0])
D = int(ND.split(' ')[1])

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

Submission status: Accepted

Solution code:
input_data = input().split(" ")

N = int(input_data[0])
D = int(input_data[1])
cnt = 0
tree = [i+1 for i in range(N)]
#d_range = 2*D
while tree != []:
  if len(tree) > 2*D:
    del tree[0: 2*D+1]
    cnt += 1
  else:
    del tree[0:]
    cnt += 1
    
print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
n, d = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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

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

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

print(ans)

Submission status: Accepted

Solution code:
import math

a,b = [int(x) for x in input().split()]

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

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())
ans=0
while True:
  ans+=1
  tmp=(D*2+1)*ans
  if tmp >= N:
    break
print(ans)

Submission status: Accepted

Solution code:
import sys
import numpy as np

def input():
	return sys.stdin.readline().rstrip()
def main():
	N, D = (map(int, input().split()))
	if N % (D * 2 + 1) == 0:
		ans = 0
	else:
		ans = 1
	ans = ans + N//(D * 2 + 1)
	print(ans)
if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
def f(x,y):
    a=2*y+1
    b=x//a
    c=x%a
    if c==0:
        return b
    else:
        return b+1
xy=input().split(" ")
N=int(xy[0])
D=int(xy[1])
print(f(N,D))

Submission status: Accepted

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

n = 2 * D + 1

ans = - (-N // n)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - Golden Apple(ABC134)
X=list(map(int, input().split()))
for i in range(X[0]+1):
    if X[0]<=(X[1]*2+1)*i:
        print(i)
        break

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

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

Submission status: Accepted

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

if D ==0:
    print(N)
for i in range(1,N+1):
        P=N//(i*(2*D+1))
        L=N%(i*(2*D+1))
        if P < 1:
            print(i)
            break
        elif P == 1 and L == 0:
            print(i)
            break

Submission status: Accepted

Solution code:
l = list(map(int,input().split()))
n = l[0]
d = l[1]

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

Submission status: Accepted

Solution code:
import math
n,d=map(int,input().split())
print(math.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:
import glob
import math


# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\134\\B'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'


class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class B(Common):

    def resolve(self):

        tmp = [int(i) for i in self.input_data().split()]
        tree_num = int(tmp[0])
        D = int(tmp[1])

        result = math.ceil(tree_num / (2 * D + 1))
        print(str(result))

solver = B(REL_PATH)
solver.exec_resolve()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, n+1):
  max = (2*d+1)*i
  #print(str(i)+'人の時に監視できる最大の木の数は', max)
  if n  <= max:
    ans = i
    break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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,m = map(int,input().split())
print(math.ceil(n/(2 * m + 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())
ans = (n - 1) // (2 * d + 1) + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#######################################
import numpy as np
import math
import copy
import re
import sys
#sys.exit(0)

inf = float("inf")
prime = 1

def check_print(check_flag, text, end="\n"):
  if check_flag:
    print(text, end=end)

def c2i(x):
    if str.isdecimal(x):
        return int(x)
    else:
        return x

def cout(*args):
  arglist = []
  for arg in args:
    if hasattr(arg, "__iter__"):
      arglist.extend(arg)
    else:
      arglist.append(arg)
      
  arglist = list(map(str, arglist))
  print(" ".join(arglist))
  
def count2(num):
  count=0
  while num%2==0:
    num/=2
    count+=1
  return count

def ketasum(num):
  nums = [int(s) for s in str(num)]
  return sum(nums)

#math
def gcd(a, b): #最大公約数
  while b:
    a, b = b, a % b
  return a

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

def gcd3(lis): #最大公約数(3over)
  ans = lis[0]
  for li in lis:
    ans = gcd(ans,li)

def lcm3(lis): #最小公倍数(3over)
  ans = lis[0]
  for li in lis:
    ans = lcm(ans,li)

def divisor(n): #nの約数を全て求める
  i = 1
  table = []
  while i * i <= n:
    if n%i == 0:
      table.append(i)
      table.append(n//i)
    i += 1
  table = list(set(table))
  return table

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

def is_prime(n):
  for i in range(2, n + 1):
    if i * i > n:
      break
    if n % i == 0:
      return False
  return n != 1

#input stock
"""
n = int(input())

#list
a = map(int, input().split())
a,b = map(int, input().split())

d=[]
for i in range(n):
  d[i]=int(input())

#2dim-list
a = [list(map(int, input().split())) for i in range(n)]

s = input()
ss =  [int(si) for si in s]
"""

#processing stock
"""
a = sorted(a)
a = sorted(a, reverse=True)

"""

#regex
"""
pattern = ""
result = re.search(pattern, s)

result = re.fullmatch(pattern, s)

result = re.finditer(pattern, s)
for res in result:
    print res.group()   # 1回目: ca      2回目: ca   
    print res.start()   # 1回目: 0       2回目: 6      
    print res.end()     # 1回目: 2       2回目: 8      
    print res.span()    # 1回目: (0, 2)  2回目: (6, 8)
"""


#math
"""
#切り捨て
math.floor()
# 切り上げ
math.ceil()
"""

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

Submission status: Accepted

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

res = 0
count = 0
while  count < N:
    count += 2 * D + 1
    res += 1

print(res)

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 % (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())
import math

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

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:
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:
#!/usr/bin/env python3
import sys


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

print(result)

Submission status: Accepted

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

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

# 条件を満たす最小値→Nを2Dで割り整数に＋１した数
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
num = int(N // d)
 
if (N % d != 0):
  num += 1
  
print(num)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = []
# inputaList = list(inputa)
# inputbList = []
# inputbList = list(inputb)

# inputaint = []
# inputaint = [int(n) for n in inputa]
# inputbint = []
# inputbint = [int(n) for n in inputbList]

# inputa.sort()
# inputb.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math 
N,ability=map(int,input().split())
can_see=2*ability+1

Q=math.ceil(N/can_see)
print(Q)

Submission status: Accepted

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

r = N 
i = 0

"""
for k in range(50):
    r = r - (2 * D + 1)
    print("r = ", r)
    if r < (2 * D + 1):

        break
"""
a = N // (2*D+1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	N, D = map(int, input().split())
	ans, mod = divmod(N, 2*D+1)
	if mod != 0:
		ans += 1
	print(ans)


if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if __name__ == "__main__":
    B_GoldenApple()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0
while True:
  if n <= (2*d+1)*cnt:
    break
  cnt += 1
print(cnt)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,D = map(int,input().split(" "))
i = 1
while(1):
    if i * (2 * D + 1) >= N:
        break;
    else:
        i += 1
print(i)

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

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n,d = list(map(int,input().split()))
import math
print(math.ceil(n/(d * 2 + 1)))

Submission status: Accepted

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


if __name__ == '__main__':
    p_b()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
#20 ABC134B
n,d=map(int,input().split())
print(-(-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:

I = input()

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

d = 1+2*D

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N, D = map(int, input().split())
    r = N % (2*D+1)
    m = N // (2*D+1)
    if r != 0: m +=1

    return m


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

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

result = N // (2 * D + 1)
rest = N % (2 * D + 1)

if rest != 0:
  result += 1
  
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
# /usr/bin/python3

from math import ceil

def main():
  number_of_tree, monitering_range = map(int, input().split())
  monitering_range = monitering_range*2 + 1
  number_for_monitor = ceil(number_of_tree / monitering_range)
  print(number_for_monitor)
  pass

if __name__=='__main__':
  main()

Submission status: Accepted

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

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:
List = list(map(int,input().split()))
N = List[0]
D = List[1]
L = 2 * D + 1
count = 1
while N - L > 0:
    count += 1
    N = N - L
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

x=1



while (2*d+1)*x<n :
    x+=1
else:
    print(x)

Submission status: Accepted

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

c = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

n = i[1]*2 + 1

a = i[0] / n

if i[0] % n != 0:
    a = a + 1

print(int(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
n, d = map(int, input().split())

n_see = d*2+1

print(math.ceil(n/n_see))

Submission status: Accepted

Solution code:
def solve(string):
    n, d = map(int, string.split())
    return str((n - 1) // (2 * d + 1) + 1)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

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

for i in range(100):
    if n <= (1+d*2)*i:
        print(i)
        exit()

Submission status: Accepted

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

while rang < N:
    result += 1
    rang += D*2+1 

print(result)

Submission status: Accepted

Solution code:
#B https://atcoder.jp/contests/abc134/tasks/abc134_b
n,d=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#n,d = map(int,"20 4".split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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