Problem:


Score : 200 points

Problem Statement

There are N apple trees in a row. People say that one of them will bear golden apples.

We want to deploy some number of inspectors so that each of these trees will be inspected.

Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).

Find the minimum number of inspectors that we need to deploy to achieve the objective.

Constraints

All values in input are integers.

1 \leq N \leq 20

1 \leq D \leq 20

Input

Input is given from Standard Input in the following format:

N D

Output

Print the minimum number of inspectors that we need to deploy to achieve the objective.

Sample Input 1

6 2

Sample Output 1

2

We can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.

Sample Input 2

14 3

Sample Output 2

2

Sample Input 3

20 4

Sample Output 3

3



Sample input:
6 2


Sample output:
2

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
def main():
    n, d = map( int, input().split())
    print( (n+d*2)//(d*2+1))
if __name__ == '__main__':
    main()

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

import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N,D=MAP()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n,d=map(int,raw_input().split())
ans=0
while n>0:
  ans+=1
  n-=2*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:
inputing=input()
N=int(inputing.split()[0])
D=int(inputing.split()[1])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
arboles = a[0]
D = a[1]
API = (D*2)+1
inspectors = arboles//API
if arboles%API>0:
    print((inspectors)+1)
else:
    print(inspectors)

Submission status: Accepted

Solution code:
import sys, math, itertools, bisect, copy, re
from collections import Counter, deque, defaultdict

# from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
# from functools import reduce
# from math import ceil, floor, log10, log2, factorial
# from pprint import pprint

INF = float('inf')
MOD = 10 ** 9 + 7
EPS = 10 ** -7
sys.setrecursionlimit(1000000)

# N = int(input())
# N,M = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]
# DP = [[0] * 100 for _ in range(100)]
# DP = defaultdict(lambda: float('inf'))


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

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

pass

Submission status: Accepted

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

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

Submission status: Accepted

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

w = d * 2 + 1

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

Submission status: Accepted

Solution code:
'''input
20 4
'''

from math import ceil;

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

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

Submission status: Accepted

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

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

    if answer == int(answer):
        print(int(answer))
    else:
        print(int(answer+1))
        
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# ABC134
from math import ceil


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

range_of_i = D + 1
range_of_i += D

rem = N % range_of_i
tmp = N // range_of_i

ans = 0
if rem > 0:
    ans = tmp + 1
else:
    ans = tmp

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if x.is_integer():
    print( int(x//1) )
else:
    print( int( (x//1) + 1) )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1,20):
    if n-(d*2+1)*i <= 0:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tree,R=[int(i) for i in input().split(" ") ]
w =0
r= 2*R+1
while tree>0:
    tree-=r
    w+=1
print(w)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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().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:
import numpy as np
n, d = list(map(int, input().split()))
print(int(np.ceil(n/(d*2+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())
"""
i-D i+D
2D+1個見ることができる

15 1 -> 5コずつ見られる

1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
"""
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()]
print(-(-N // (2 * D + 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 -*-

import sys
import copy

sys.setrecursionlimit(1000000)

# input = sys.stdin.readline
from collections import defaultdict

# ~~~~~~~~~~~~~~~~~~~~~_(＾～＾ ｣ ∠)_~~~~~~~~~~~~~~~~~~~~~

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

K = D * 2 + 1

print((N + K - 1) // K)

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

Submission status: Accepted

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

hon = 2 * d + 1
a = (n + (hon - 1)) // hon

print(a)

Submission status: Accepted

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

if N%a==0:b-=1
print(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:
import math
n,d=map(int,input().split())

man=d*2+1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
temp = input().split()
N=int(temp[0])
D=int(temp[1])
can_read=2*D+1
cnt=0
while(N>0):
    N=N-can_read
    cnt=cnt+1
print(cnt)

Submission status: Accepted

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

#監視員は2D+1本の木を監視する
#最小の監視員はN/2D+1 の切り上げ
print(-(-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(0--n//(d-~d))

Submission status: Accepted

Solution code:
## ABC133-B
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
n,d=IL()
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:

S=input()

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

result=float(N/(2*D+1))

if result-int(result)>0:
    result=int(result)+1
else:
    result=int(result)

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N: int, D: int):
    i, area = 1, (D*2 + 1)

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

    print(i)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    solve(N, D)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nums = input().split()

n = int(nums[0])
d = int(nums[1])

m = 1

while n > m * ((2 * d) + 1):
    m += 1

print(m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

(N,M) = (int(i) for i in input().split(" "))
print(int((N+M*2)/(1+M*2)))

Submission status: Accepted

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

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

s= False

for i in range(20):
    s= 2*b+1
    t=i
    if(s*i>=a):
        break
print(t)

Submission status: Accepted

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

N = i[0]
D = i[1]

r = 2*D + 1

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
if N//2 <= D:
    print(1)
else:
    cnt = 0
    i = 1
    j = 1
    while i <= N:
    #     print(i)
        if i != 1 and (i-j) % D == 0:
            cnt += 1
            j += 1
    #         print(cnt)
            if ((i + D) < N) and ((i + 2*D) > N):
    #             print(cnt)
                cnt += 1
                break
            else:
                i += 2*D
        i += 1

    print(cnt)

Submission status: Accepted

Solution code:
n , m = map(int,input().split())
print( (n+2*m)//(2*m+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())
re=2*D+1
co=0

while True:
  N-=re
  co+=1
  if(N<=0):
    break
    
print(co)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i=1
answer=0
while(True):
    i = i + 2*d + 1
    answer += 1
    if (i-1)>=n:
        break
        
print(answer)

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 -*-
# スペース区切りの整数の入力
b, c = map(int, input().split())
# 文字列の入力
d = c * 2 + 1
e = -(-b // d)
# 出力
print(e)

Submission status: Accepted

Solution code:
def main():
	import sys
	input = sys.stdin.readline
	N, D = map(int, input().split())
	div = 2 * D + 1
	ans = -(-N // div)
	print(ans)

if __name__ == '__main__':
    main()

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().split())
x = N//((2*D)+1)
if(x*((2*D)+1)>= N):
	print(N//((2*D)+1))
else:
	print((N//((2*D)+1)+1))

Submission status: Accepted

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

Submission status: Accepted

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

    print(x)

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

max = (n - d) - d
count = 1

for i in range(1000):
  if max <= 1:
    break
  max = (max - (d*2) -1) 
  count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
INPUT = sys.stdin.readline
#入力関数
def SORO_INT(): return int(INPUT())
def MULT_INT_LIST(): return list(map(int, INPUT().split()))
def MULT_INT_MAP(): return map(int, INPUT().split())
def SORO_STRING(): return INPUT()
def MULT_STRING(): return INPUT().split()

N,D = MULT_INT_MAP()
x = D*2+1
y = N/x


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

if is_integer_num(y):
    print(int(y))
else:
    y = int(y)
    print(y+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; ansli = []; tmpli = []; candili = []
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]#WideIntPoint
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]#HeightString
def mi(n): return [wi() for _ in range(n)]#MatrixInt
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

cnt = (B * 2) + 1

for i in range(1, 1+A):
  if i*cnt >= A:
    print(i)
    break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, d = map(int, input().split())
ans = 1
guard = 2 * d + 1
while n > guard * ans:
    ans += 1
print(ans)

Submission status: Accepted

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

while N > 0:
    N -= number
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split(" "))
lis = [1]*N
range_ = (2 * D) + 1

sho   = len(lis) // range_
amari = len(lis) %  range_

ninzu = amari // range_

if amari == 0:
  print(sho)
else:
  print(sho + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i = 1
left = 1
res = 0
while i <= N:
    if i - D == left:
        left = i + D + 1
        res += 1
    i += 1

if left <= N: res += 1

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,d=map(int,input().split())
if(n%(2*d+1)==0):
  print('{0}'.format(n//(2*d+1)))
if(n%(2*d+1)!=0):
  print('{0}'.format(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:
#!/usr/bin/env python
import math

N, D = input().split()

i = 1 + int(D)

L = i + int(D)

print(math.ceil(int(N)/L))

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
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

a, b = readmi()

count = 1
n = b + 1
while(n + b < a):
    n += (b * 2) + 1
    count += 1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
a=input().split()
n=int(a[0])
d=int(a[1])

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

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

Submission status: Accepted

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

L = D*2 + 1

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

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

t = D * 2 + 1
p = ceil(N/t)
print(p)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

m = d * 2 + 1

ans = n // m
if n % m != 0:
    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:
#!/usr/bin/env python
import math

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

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n, d = [int(i) for i in input().split()]
    num = n // (d * 2 + 1)
    print(num + (n % (d * 2 + 1) != 0))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

x = input()
data = x.split(" ")
print(math.ceil(int(data[0])/(int(data[1])*2+1)))

Submission status: Accepted

Solution code:
import math

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

kanshi = 2*d + 1

result = math.ceil(n/kanshi)

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

p = 1+2*d
res = 1
while p < n:
    p += 1+2*d
    res += 1
print(res)

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

Submission status: Accepted

Solution code:
import math

s = input().split(' ')
n = int(s[0])
d = int(s[1])

perP = 2 * d + 1
ans = n // perP
# print('{:1.0f}'.format(ans))
if(n % perP == 0):
    print(ans)
else:
    print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,D=input().split()
N = int(N)
D = int(D)
import numpy as np
print(int(np.ceil(N / ( D + D + 1.0))))

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

Submission status: Accepted

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


def solve(N: int, D: int):
    a = (N // (2 * D + 1))
    b = (N % (2 * D + 1))
    if b is not 0:
        a = a+1
    print(a)
    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())
if n < 2*d:
  print(1)
elif n % (2*d +1) == 0:
  print(n // (2*d + 1))
else:
  ans = n // (2*d + 1) + 1
  print(ans)

Submission status: Accepted

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

Submission status: Accepted

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