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

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

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

Submission status: Accepted

Solution code:
import sys

N, D = map(int, sys.stdin.readline().split())
print((N - 1)// (2*D+1) + 1)

Submission status: Accepted

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

area = D * 2 + 1

result = -(-N // area)
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

loop = D*2+1

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

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

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

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc134/tasks/abc134_a

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

persons = (n - 1) // (2 * d + 1) + 1

print(persons)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N, D = M()
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:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,d=mp()
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:
# AtCoder Beginner Contest 134
# B - Golden Apple

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

d=2*D+1
n=N/d

if n>N//d:
    print(int(n)+1)
else:
    print(int(n))

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())
x = 1
ans = 0
while x <= n:
    x = x + (2*d+1)
    ans += 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())
security_range_per_person  = d*2+1
for i in range(1,n+1):
    if n / (security_range_per_person *i) <= 1:
        print(i)
        break

Submission status: Accepted

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

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()))
import math
ans = math.ceil(N / (D * 2 + 1))
print(ans)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
from collections import defaultdict,deque
from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

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

Submission status: Accepted

Solution code:
n, d = list(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())
h=2*d+1
ans=0
while ans*h<n:
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n, d = map(int, input().split())
    x = 1

    while True:
        monitoring = (2*d+1) * x

        if monitoring < n:
            x += 1
        else:
            break

    print(x)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = list(map(lambda n: int(n), input().split(" ")))
import math
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:
N, D = map(int,input().split())

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

import math

def main():

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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if n % r == 0:
  obs = n // r
else:
  obs = n // r + 1

print(obs)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
MM = input().split()
N = int(MM[0])
D = int(MM[1])
a = 2*D +1
ans1 = N//a

if N%a !=0:
  ans1 +=1
print(ans1)

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# abc134_b.py
# https://atcoder.jp/contests/abc134/tasks/abc134_b

# B - Golden Apple /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 一列に並んだ N本の林檎の木のうちいずれかに黄金の林檎が実ると言われています。
# そこで、何人かの監視員を配置してどの林檎の木もいずれかの監視員に監視された状態にしたいです。
# それぞれの監視員は N本の木のうちいずれかに配置します。便宜上、これらの木に 1 から N までの番号をつけます。
# 番号 i の木に配置された監視員は、番号が i−D 以上 i+D以下のすべての林檎の木を監視します。
# 条件を満たすために少なくとも何人の監視員を配置する必要があるか求めてください。

# 制約
#     入力は全て整数である。
#     1≤N≤20
#     1≤D≤20

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N D

# 出力
# 条件を満たすために配置する必要のある監視員の人数の最小値を出力せよ。

# 入力例 1
# 6 2

# 出力例 1
# 2

# 例えば、番号 3,4の木に 1人ずつ監視員を配置すれば条件を満たすことができます。

# 入力例 2
# 14 3

# 出力例 2
# 2

# 入力例 3
# 20 4

# 出力例 3
# 3


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    N, D = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    # 1人あたり2D+1本を監視可能
    result = -(N // (-2*D - 1))

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['6 2']
        lines_export = [2]
    if pattern == 2:
        lines_input = ['14 3']
        lines_export = [2]
    if pattern == 3:
        lines_input = ['20 4']
        lines_export = [3]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

shubihani=2*d + 1

tmp = n // shubihani
if n % shubihani != 0:
    tmp += 1
print(tmp)

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
if N%t==0:
  print(N//t)
else:
  print(N//t+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:
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())
print(math.ceil(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:
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())
a = 0
block = 2*D+1
a = N /block
b = int(a)
if a-b > 0:
  a = a+1
print(int(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列


    a=K*2+1
    print(math.ceil(N/a))



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())
q, r = divmod(N, 2*D + 1)
print(q + (r > 0))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

x = 2 * d + 1
y = -(-n//x)


print(y)

Submission status: Accepted

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

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

def input():
    return sys.stdin.readline().rstrip()


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

Submission status: Accepted

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

if not ( 1 <= N <= 20 and 1 <= D <= 20 ): sys.exit()

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

Submission status: Accepted

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

Submission status: Accepted

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

p = 2 * D + 1

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

Submission status: Accepted

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

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())
print(math.ceil(N / (2 * D + 1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def main():
    n,d=map(int, input().split())
    #一人当たり2*d+1
    print(math.ceil((n)/(2*d+1)))

if __name__ == '__main__':
    main()

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 / (d * 2 + 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:
import sys, math
from collections import defaultdict
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

N, D = rl()

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

Submission status: Accepted

Solution code:
n, k = map(int,input().split())
s, count = 1 + k, 0
while(True):
    if n-s > k:
        s += (2*k) + 1
        count += 1
    else:
        count += 1
        break
print(count)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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:
#create date: 2020-07-07 11:00

import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n, d = na()
    m = 2 * d + 1
    print((n-1)//m + 1)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

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

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, d = map(int, input().split())
    tree = 1
    ans = 0
    while True:
        ans += 1
        tree += 2 * d
        if tree >= n:
            print(ans)
            return
        tree += 1

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

num = -(-n // (2*d+1))

print(num)

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, d = map(int, input().split())
print(-(-n // (1 + d * 2)))

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

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

Submission status: Accepted

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

Submission status: Accepted

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

# 一人でカバーできる範囲
monitored_range = (d*2) + 1
if n%monitored_range == 0:
    print(n//monitored_range)
else:
    print(n//monitored_range+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
n,d = [int(z) for z in input().split()]

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

Submission status: Accepted

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

t = d*2 + 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0
while n > 0:
    n -= 2 * d + 1
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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)