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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
from math import *

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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)

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

Submission status: Accepted

Solution code:
input_data=input()
input_data=input_data.split()
N=int(input_data[0])
D=int(input_data[1])

x=N/(2*D+1)

if  int(x)==x:
    output=x
    output=int(x)
else :
    output=int(x)+1

print(output)

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


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


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

hani = d*2 + 1

ans = int(n/hani)

if(ans - (n/hani) < 0):
  ans += 1

print(ans)

Submission status: Accepted

Solution code:
import math


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

Submission status: Accepted

Solution code:
import math

inp = list(map(int, input().strip().split(' ')))

a = inp[0]
b = inp[1]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# B - Golden Apple

N, D = map(int, input().split())
print(int((N+2*D)/(2*D+1)))
# print((N+2*D)//(2*D+1)) # これでも可

Submission status: Accepted

Solution code:
# B - Golden Apple

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Golden Apple

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 math

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

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

Submission status: Accepted

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

o1 = ((i1[0]) // (i1[1]*2 + 1))
o2 = ((i1[0]) % (i1[1]*2 + 1))
if o2 == 0:
    print(o1)
else:
    print(o1 + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if num_y != 0:
  print(num_x+1)
else:
  print(num_x)

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

Submission status: Accepted

Solution code:
s = input().split()
n = int(s[0])
d = int(s[1])
drange = d * 2 + 1
num = 0
for i in range(10):
  num += 1
  n -= drange
  if n <= 0:
    print(num)
    break

Submission status: Accepted

Solution code:
def main():
  n, d = map(int, input().split(' '))
  p = d * 2 + 1
  for i in range(1, n + 1):
    if n / (i * p) <= 1:
      print(i)
      break


if __name__ == '__main__':
  main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, d = map(int, input().split())
q, m = divmod(n,d*2+1)
print(q + (m!=0))

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())
avility = (2 * D + 1)

z = -( (-1 * N) // avility)
print(z)

Submission status: Accepted

Solution code:
def abc_134(N, D):
    gurad_cnt = 1
    range = D * 2 + 1
    while 1:
        if N <= range * gurad_cnt:
            break
        else:
            gurad_cnt += 1

    print(gurad_cnt)


if __name__ == "__main__":
    N, D = [int(i) for i in input().split()]
    abc_134(N, D)

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())
avility = (2 * D + 1)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
#入力をaにいれる
a=input()
#分解してN,Dにする
n,d = a.split()
n= float(n)
d =float(d)
#計算して繰り上げ
p = math.ceil(n/(d*2+1))
print (p)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

d_look = 2 * d + 1

print(math.ceil(n/d_look))

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

Submission status: Accepted

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

Submission status: Accepted

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

people = N / (2*D+1)
if people % 1.0 != 0:#割り切れないのであれば？？
    people+=1
print(int(people))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

unit=2*width+1

print((treenum-1)//unit+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

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__":
# 2D + 1 の木を見ることが出来る
    N, D = map(int, sys.stdin.readline().split())
    r = 2*D + 1
    if N % r == 0:
        print(int(N / r))
    else:
        print(int(N / r) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

a = N % (2*D+1)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

judge = 0
remain = A[0]

for i in range(A[0]):
	remain -= 2*A[1] + 1
	if remain <= 0:
		judge = i + 1 
		break
print(judge)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n, d = [int(t) for t in 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:
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())

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

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

Solution code:
import math

nums = [int(e) for e in input().split()]
N = nums[0]
D = nums[1]

can_watch = 2 * D + 1

min_guard_num = N / can_watch
min_guard_num = math.ceil(min_guard_num)
print(min_guard_num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math 
n1, n2 = [int(i) for i in input().split()]

r1 = math.ceil(n1 / ((n2 * 2) + 1))
print(r1)

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

p = (N-1) // (2*D+1) + 1

print(p)

Submission status: Accepted

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

i = 0
while (2 * d + 1) * i < n:
    i += 1

print(i)

Submission status: Accepted

Solution code:
s=list(map(int,input().split()))
a=0
b=s[0]
i=0
j=0
for i in range(s[0]):
  if b>0:
    b=b-1-s[1]*2
    j=j+1
  else:
    break
print(j)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a = d * 2 + 1

b=n/a
b = int(b)
c=n%a
if c>0:
    b = b + 1
    
print(b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
temp=input().split()
n_trees=int(temp[0])
d=int(temp[1])

n_people=1
while (2*d+1)*n_people<n_trees:
  n_people+=1
  
print(n_people)

Submission status: Accepted

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

# d = 2   1 2 3 4 5

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

#n = int(input())
a, b = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = input()
#list = list(s)
#temp = [[0 for _ in range(13)] for _ in range(13)]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n,d = map(int,raw_input().split())
    print -(- n // (d*2+1))

Submission status: Accepted

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

Submission status: Accepted

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

def main():
	n, d = map(int, input().strip().split())
	p = n / (2*d+1)
	if p == int(p):
		print(int(p))
		return
	print(int(p+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:
inputs = [int(x) for x in input().split()]

N = inputs[0]
D = inputs[1]
answer = 0
if N > (D*2) + 1:
  check = N % ((D*2) + 1)
  answer = N / ((D*2) + 1) 
  answer = int(answer)
  if check != 0:
    answer += 1
  
else:
  answer = 1
  
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B問題
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())
ans = a // (b*2 + 1)
if a % (b*2 + 1) == 0:
  print(round(ans))
else:
  print(round(ans + 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())
warukazu = 2*(d+1)-1
if n % warukazu == 0:
    print(n // warukazu)
else:
    print((n // warukazu) + 1)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    n, d = [int(x) for x in stdin.readline().rstrip().split()]
    cover = 2*d+1
    count = n // cover
    if n%cover != 0:
        count+=1

    print(count)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    solve()

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

Submission status: Accepted

Solution code:
n, d = (int(x) for x in input().split())
tmpmin = n//(2*d+1)
if n%(2*d+1)!=0:
    tmpmin = tmpmin+1
print(tmpmin)

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

X = D * 2 + 1

pre_answer = N / X
print(math.ceil(pre_answer))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():

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

    power = D*2+1

    if N <= power:
        print(1)
        exit()

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



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

Submission status: Accepted

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

Submission status: Accepted

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

# N, D = [20,4]

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

d = D*2+1

count = N // d
if N % d > 0:
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=list(map(int,input().split()))
#A=list(map(int,input().split()))

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

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

Submission status: Accepted

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

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

if ans-int_ans!=0:
    ans+=1

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

Submission status: Accepted

Solution code:
import sys
import math
input = sys.stdin.readline
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 - 1) // (2 * d + 1) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

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

monitorable_num = D * 2 + 1

guard_num = N // monitorable_num
additional = 0 if N % monitorable_num == 0 else 1
print(guard_num + additional)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math

if sys.platform =='ios':
  sys.stdin=open('input134b.txt')

#+++++

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

res = (n + d - 1) // d

print(res)

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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