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:
# -*- coding: utf-8 -*-

from math import ceil,floor

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# list = list(map(int, input().split()))

# def func(a):
#    return tmp

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC134-B

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,d=LI()
  return -(-n//(2*d+1))

# main()
print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
data = input().split()
N = int(data[0])
D = int(data[1])
import math
ans = math.ceil(N/(2*D+1))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N,band = [int(x) for x in input().split()]
M = 2*band+1

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

Submission status: Accepted

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

ans = 0

n -= (d+1)  # 一人目の立つ場所
ans += 1
if n <= 0:
    print(ans)
    exit()
while True:
    if (n - d) <= 0:
        break
    else:
        n -= (2*d + 1)
        ans += 1
        if n <= 0:
            break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    n, d = MAP()
    print(ceil(n/(2*d+1)))

if  __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n, d = MAP()
ans = 0
while(1):
    n -= (2 * d + 1)
    ans += 1
    if n <= 0:
        break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
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 = list(map(int,input().split())) 
print(-(-n // (2*d+1)))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

print("{}".format(math.ceil(N / (2 * D + 1))))

Submission status: Accepted

Solution code:
N,D = (int(i) for i in 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:
input_line = list(input().split())

N = int(input_line[0])
D = int(input_line[1])

count = 0

while(N > ((1 + D * 2) * count)):
  count += 1
  
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    if tmp*i < n:
        result += 1

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math as m
N, D = map(int, sys.stdin.readline().strip().split(" "))
print(m.ceil(N/(D*2+1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

ND = input()
ND2= ND.split()
num=0
amari=0

N=ND2[0]
D=ND2[1]

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

Submission status: Accepted

Solution code:
def main():
    N, D = map(int, input().split())
    tmp = 2 * D + 1
    ans = 1

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

    print(ans)

    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(anser)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for i in range(N):
    if N - (2*D + 1)*i <= 0:
        print(i)
        sys.exit(0)

print(N)

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
import math

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

diff = 2 * D + 1

print(math.ceil(N / diff))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

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

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())
c  = 0
a = N
for i in range(20):
    c += 1
    a = a -1 -(2*D)
    if a <= 0:
        break
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B
import math

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

Submission status: Accepted

Solution code:
# ' 'dで区切ってprintする方法
# print(*a, sep=' ')

import math

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

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

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:
a = input().split()
a = [int(i) for i in a]
count_1 = a[1]
count_2 = 0

while (True):
    if a[0] < a[1]:
        count_2 += 1
        break
    a[0] -= (a[1] * 2 + 1)
    count_2 += 1
    if a[0] < 0 or a[0] == 0:
        break

print(count_2)

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

watch = 0
tree = 0

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

Submission status: Accepted

Solution code:
N, D = list(map(int, input().split()))
# 1人の監視員で何個の木を見れるか
tree = D*2 + 1

if N % tree > 0:
  print(N // tree + 1)
else:
  print(N // tree)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(N)
D = int(D)

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

Submission status: Accepted

Solution code:
from sys import stdin

n, d = [int(x) for x in stdin.readline().rstrip().split()]

f = d*2+1

if n % f == 0:
    human = n // f
else:
    human = n // f + 1

print(human)

Submission status: Accepted

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

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

# solve & output
print(math.ceil(N / (2 * D + 1)))

Submission status: Accepted

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

q, mod = divmod(N, 2*D+1)
if mod >= 1:
  print(q+1)
else:
  print(q)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

x = (d * 2 + 1)

r = 0
while(1):
    if r*x >= n:
        print(r)
        exit()
    
    r+=1

Submission status: Accepted

Solution code:
from math import ceil

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

print(ceil(n / temp))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    N, D = [int(x) for x in stdin.readline().rstrip().split()]
    print(N // (D * 2 + 1) + (1 if N % (D * 2 + 1) else 0))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

dd = d * 2 + 1

aa = n % dd
a = n // dd

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

Submission status: Accepted

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

    if (N % ((D*2)+1)) == 0:
        print("{}".format(N//((D*2)+1)))
    else:
        print("{}".format(N//((D*2)+1)+1))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp = int(N / (1 + D * 2))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


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

Submission status: Accepted

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

if q == int(q):
        print(int(q))
else:
        print(int(q) + 1)

Submission status: Accepted

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

check = D * 2 + 1
q, mod = divmod(N, check)
if mod == 0:
    ans = q
else:
    ans = q + 1

print(ans)

Submission status: Accepted

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

import math
input = list(map(int, input().split()))

N = input[0]
D = input[1]

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

print(ninnzuu)

Submission status: Accepted

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


preans = N/(2*D + 1)

#print(preans)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

# 2*D+1で割った商+1
print(math.ceil(N / (2*D+1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    import math
    input = sys.stdin.readline
 
    n, d = [int(i) for i in input().split()]
 
    
    print(math.ceil(n / (2 * d + 1)))
 
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def main():

	N,D = map(int,input().split())
	#S = list(input())
	#L,R = map(int, input().split(" "))
	#L = list(map(int, input().split(" ")))

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

	print(ans)


if __name__ == "__main__":
	main()

Submission status: Accepted

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

watchTree = d * 2 + 1

print(-(-n//watchTree))

Submission status: Accepted

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

dist = 2 * D + 1

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nd = [int(i) for i in input().split()]
print(int(-1 * ((-1*(float(nd[0]))) // (nd[1]*2+1))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

x = input().split()

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

m = n / (2*d+1)

print(math.ceil(m))

Submission status: Accepted

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

x = 1 + (2 * d)

print(math.ceil(n/x))

Submission status: Accepted

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

while(N > Dcnt):
    cnt += 1
    Dcnt += 2*D + 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
i = list(map(int, input().split()))
N = i[0]
D = i[1]

if N % (2 * D + 1) == 0:
    A = N / (2 * D + 1)
else:
    A = math.ceil(N / (2 * D + 1))

print(int(A))

Submission status: Accepted

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

Submission status: Accepted

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

n = 0
i = 0
while i <= (N-1):
    n += 1
    i += (2*D+1)

print(n)

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 sys
input=sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


def LI(): return list(map(int, input().split()))


n, d = LI()
a = n // (2*d + 1)
b = (n % (2*d + 1)) / (2*d + 1)

print(a + math.ceil(b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

s = list(map(int, input().split(" ")))

t = s[0] // (s[1]*2+1)
if s[0] % (s[1]*2+1) != 0:
    t = t + 1
print(t)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def inpl():
    return list(map(int, input().split()))


N, D = inpl()

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

Submission status: Accepted

Solution code:
import math

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
#    !/usr/bin/env python3
#    encoding: UTF-8
#    Modified: <20/Jul/2019 05:39:19 PM>


#    ✪ H4WK3yE乡
#    Mohd. Farhan Tahir
#    Indian Institute Of Information Technology (IIIT), Gwalior


import sys
import os
from io import IOBase, BytesIO


def main():
    n, d = get_ints()
    from math import ceil
    print(ceil(n / ((2 * d) + 1)))


BUFSIZE = 8192


class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill():
            pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill()
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        py2 = round(0.5)
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2 == 1:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode("ascii"))
            self.read = lambda: self.buffer.read().decode("ascii")
            self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def get_array(): return list(map(int, sys.stdin.readline().split()))


def get_ints(): return map(int, sys.stdin.readline().split())


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N, D = map(int, input().split())
div = N // (2 * D + 1)
mod = N % (2 * D + 1)
if mod == 0:
    print(div)
else:
    print(div + 1)

Submission status: Accepted

Solution code:
import math

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

eye = 2*d + 1

result = math.ceil(n / eye)

print(result)

Submission status: Accepted

Solution code:
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    N,D= map(int, sys.stdin.readline().split())
    ans = math.ceil(N/(2*D+1))
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from math import ceil

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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