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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
N, D = map(int, input().split(" "))

out = int(np.ceil(N / (2 *D + 1)))
print(out)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    N, D = map(int, input().split())
    logging.info("Hello!")

    print(-1 * ((-1 * N) // (D * 2 + 1)))
    
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
inplist = input().split(' ')
inplist_int = [int(i) for i in inplist]
print(math.ceil(inplist_int[0]/(inplist_int[1]*2+1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import fractions
from collections import deque
import numbers as np
import math


def main():
    N, D = map(int, input().split())
    tmp = 0
    cnt = 0
    while tmp < N:
        tmp += 2*D + 1
        cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

num = 2 * d + 1

ret = n // num

if n % num != 0:
    ret+=1
print(ret)

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
import sys
import math
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

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

Submission status: Accepted

Solution code:

ND = list(map(int, input().split()))

eye = ND[1]*2 + 1

i = 0
count = 0

while i < ND[0]:
    i += eye
    count += 1

print(count)

Submission status: Accepted

Solution code:
import math


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

window = 1 + 2*d
num_watcher = n / window

print(math.ceil(num_watcher))

Submission status: Accepted

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

if ans%1==0:
  print(int(ans))
else:
  print(int(ans)+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())
#l = 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,b=map(int,input().split())
print(int((a-0.01)//(2*b+1)+1))

Submission status: Accepted

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

DD=D*2+1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import math

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

r=2*d+1

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

S = N // (2*D+1)
T = N % (2*D+1)

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

Submission status: Accepted

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

Submission status: Accepted

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

_d = d * 2 + 1

result = int(n / _d)
if not n % _d == 0:
    result += 1
print(result)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
import math

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

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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 20 20:53:20 2019

@author: ctiuser
"""

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

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

print(ans)

Submission status: Accepted

Solution code:


def read_input():
    n, d = map(int, input().split())
    return n, d


def submit():
    n, d = read_input()

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

    return


if __name__ == '__main__':
    submit()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import math

n, d = map(int, input().split())
c= 0
reach = d*2 +1
c = (n/reach)

print(math.ceil(c))

Submission status: Accepted

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

Submission status: Accepted

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

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

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


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

else:
    print(a + 1)

Submission status: Accepted

Solution code:

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



a = 2*D + 1
ans = 0
if N%a==0:
    ans = N//a

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

Submission status: Accepted

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

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

r = N // (2 * D + 1)
d = N % (2 * D + 1)

if d == 0:
    ans = r
else:
    ans = r + 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

width = 2 * d + 1

print(math.ceil(n / width))

Submission status: Accepted

Solution code:
p = input().split()
n, d = int(p[0]), int(p[1])
k = n/(1+2*d)
if k == (n-1)//(2*d):
    print(int(k))
else:
    print(int(k)+1)

Submission status: Accepted

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

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

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

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 sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, D] = [int(input_raw[0]), int(input_raw[1])]
    K = 2 * D + 1
    print N / K + (1 if N % K != 0 else 0)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

div = 2 * d +1

print(n//div + int(n%div != 0))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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(ans)
else:
    print(ans+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())
print(int(math.ceil(n/(2*d+1))))

Submission status: Accepted

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

a = 2 * d + 1

if n % a == 0:
    ans = n / a
else:
    ans = n // a + 1

print(int(ans))

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())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

import math

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

Submission status: Accepted

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

Submission status: Accepted

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

if a % (1 + 2 * b) == 0:
    print(a // (1 + 2 * b))
else:
    print(a // (1 + 2 * b) + 1)

Submission status: Accepted

Solution code:
import math

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

range_num = 2 * D + 1

print(math.ceil(N / range_num))

Submission status: Accepted

Solution code:
#coding : utf-8

import os
import sys

N, D = map(lambda x: int(x), input().split(" "))

M = 2 * D + 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil

N, D = map(int, input().split())
R = D * 2 + 1

print(ceil(N / R))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

# N本の木, 自分の木から左右D本の木を監視できる, 全部で2D+1本の木を監視できる
N, D = map(int, input().split())

# 1人が監視できる本数
n = (2 * D) + 1

# 切り上げた数が答えになる
ans = math.ceil(N / n)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

h = 2*D+1

num = math.ceil(N/h)

print(num)

Submission status: Accepted

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

d = D*2 + 1

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

Submission status: Accepted

Solution code:
import numpy as np
a = input().split(" ")
N = int(a[0])
D = int(a[1])
if N%(2*D + 1) != 0:
    print(int(N/(2*D + 1)) + 1)
else:
    print(int(N/(2*D + 1)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

A = N // (2*D+1)
B = N % (2*D+1)

if B > 0:
    A +=1

print(A)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math

n,d = [ int(x) for x in sys.stdin.readline().split() ]
print( math.ceil( n / (2*d+1) ))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d=2*D+1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

N, D = [int(x) for x in stdin.readline().rstrip().split()]

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

print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
import math

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

ans=0
for i in range(20):
  n=n-(1+2*x)
  ans+=1
  if(n<=0):
    print(ans)
    exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

R = 2*D+1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

res = N // (2*D + 1)
d = N % (2*D + 1)

if d != 0:
    res += 1
    
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

n = 2 * D + 1
result = N // n
if N % n > 0:
    result += 1

print(result)

Submission status: Accepted

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

if n % k == 0:
    t = n // k
else:
    t = n // k + 1

print(t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

v = 2 * D + 1

import math
print( math.ceil(N / v) )

Submission status: Accepted

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

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 = [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(" ")))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# B

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

X = N / (1+2*D)
Y = N // (1+2*D)
if X==Y:
    print(Y)
else:
    print(Y+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from math import ceil


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


def main():
    print(solve())


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N,D=[int(_) for _ in input().split()]
#[s,s+2*D+1)
#[0,N)
ans=1
left=0
while True:
    right=left+2*D+1
    if right>=N:
        print(ans)
        exit()
    left=right
    ans+=1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

s=d+d+1

print(math.ceil(n / s))

Submission status: Accepted

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

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

print(a+b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

r = 2 * D + 1

ans = int(ceil(N / r))
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
import math
mod = 10**9 + 7
def I(): return int(input())
def II(): return map(int, input().split())
def L(): return list(map(int, input().split()))
def TWO(M):
  L=[0]*M
  R=[0]*M
  for i in range(M):
    L[i],R[i] = II()
  return L, R

N,D = II()
ans = 1
right = 2*D+1
while 1:
  if right >= N:
    break
  right += 2*D+1
  ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math

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

    monitor = D*2+1

    ans = math.ceil(N/monitor)
    print(ans)

if __name__=='__main__':
    main()

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

range = 2 * d + 1

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math


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


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

Submission status: Accepted

Solution code:
import math
import copy
from operator import mul
from functools import reduce
from collections import defaultdict
from collections import Counter
from collections import deque
# 直積 A={a, b, c}, B={d, e}:のとき，A×B={(a,d),(a,e),(b,d),(b,e),(c,d),(c,e)}: product(A, B)
from itertools import product
# 階乗 P!: permutations(seq), 順列 {}_len(seq) P_n: permutations(seq, n)
from itertools import permutations
# 組み合わせ {}_len(seq) C_n: combinations(seq, n)
from itertools import combinations
# 一次元累積和
from itertools import accumulate
from bisect import bisect_left, bisect_right

import re
# import numpy as np
# from scipy.misc import perm
# from scipy.misc import comb

def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

# 四方向: 右, 下, 左, 上
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
 
def i_inpl(): return int(input())
def l_inpl(): return list(map(int, input().split()))
def line_inpl(x): return [i_inpl() for _ in range(x)]

INF = int(1e18)
MOD = int(1e9)+7 # 10^9 + 7

########

N, D = l_inpl()

ans = 0
cnt = 0
while True:
    ans += 1 + 2*D
    cnt += 1
    if ans >= N:
        break
print(cnt)

# print(3*(r**2))

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

Submission status: Accepted

Solution code:
import sys
import math

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

if __name__ == "__main__":
    n, d = map(int, input().split())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
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())
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())

x, y = divmod(n, 2 * d + 1)

if y == 0:
  print(x)
  
else:
  print(x+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)