Problem:


Score : 200 points

Problem Statement

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

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

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

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

Constraints

All values in input are integers.

1 \leq N \leq 20

1 \leq D \leq 20

Input

Input is given from Standard Input in the following format:

N D

Output

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

Sample Input 1

6 2

Sample Output 1

2

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

Sample Input 2

14 3

Sample Output 2

2

Sample Input 3

20 4

Sample Output 3

3



Sample input:
6 2


Sample output:
2

Submission status: Accepted

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

quotient = n // (2 * d + 1)
surplus = n % (2 * d + 1)

if surplus == 0:
    print(quotient)
else:
    print(quotient + 1)

Submission status: Accepted

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

Submission status: Accepted

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

print(-1*((-1*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())
for i in range(20):
    if i*((d-1)*2+3)>=n:
        print(i)
        exit()

Submission status: Accepted

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

for i in range(20):
    if a*i >= n:
        print(i)

        break

Submission status: Accepted

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

'''
 ex) N = 10, D = 3
     ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
           u     u
'''
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
def q2():
    """ B - Golden Apple """
    N, D = (int(i) for i in input().split())
    d, m = divmod(N, D*2+1)
    if m > 0:
        d += 1
    print(d)


if __name__ == '__main__':
    q2()

Submission status: Accepted

Solution code:
import math

inputted = list(map(int, input().split()))
N = inputted[0]
D = inputted[1]

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

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:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)
  
def main():
  n,d = map(int,input().split())
  d = d*2 + 1
  print(kiri(n,d))
  
if __name__ == '__main__':
  main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

#print(N,' ',D)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,d=INTM()
    print(int((n+(d*2+0.9))//(d*2+1)))
if __name__ == '__main__':
    do()

Submission status: Accepted

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


def solve(N: int, D: int):
    from math import ceil
    return ceil(N / (2 * D + 1))


# Generated by 1.1.6 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
    print(solve(N, D))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n,d = iim()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
for i in range(20):
    if i * (2 * D + 1) >= N:
        print(i)
        exit()
    else:
        pass

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 28 17:32:21 2020

@author: Kanaru Sato
"""

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

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

d = d*2+1

print(math.ceil(n/d))

Submission status: Accepted

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

while N-2*D-1>0:
    cnt += 1
    N -= 2*D+1

print(cnt)

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
n,d = map(int,input().split())

ans = 0
minus = 2*d +1
while n > 0:
    ans += 1
    n -= minus

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

Submission status: Accepted

Solution code:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, D = lr()
# 2 * D + 1
answer = (N + 2 * D) // (2 * D + 1)
print(answer)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = map(int,raw_input().split())
print int(math.ceil(float(n)/float(((d*2.0)+1.0))))

Submission status: Accepted

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


def solve(N: int, D: int):
    return


# Generated by 1.1.6 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():
    N,D = [ int(s) for s in input().split() ]
    if N % (2*D+1) == 0:
        print(int(N / (2*D+1)))
    else:
        print(int(N / (2*D+1))+ 1)

    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import os, sys, re, math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

r = 2*D+1
ans = -N//r

print(-ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve():
    N, M = map(int, input().split())
    c = 0
    r = 0
    while r < N:
        r += M*2 + 1
        c += 1

    return c

print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Golden Apple
https://atcoder.jp/contests/abc134/tasks/abc134_b

"""
import sys


def solve(N, D):
    ans = 1
    covered = D + 1 + D
    while covered < N:
        ans += 1
        covered += (2*D + 1)
    return ans


def main(args):
    N, D = map(int, input().split())
    ans = solve(N, D)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
import sys
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, D = list(map(int, sys.stdin.readline().split()))
    look = 2 * D + 1
    print(math.ceil(N / look))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = [int(i) for i in input().strip().split()]
q, r = divmod(N, 2*D+1)
if r == 0:
  print(q)
else:
  print(q+1)

Submission status: Accepted

Solution code:
import math
import sys

m=10**9 + 7 
sys.setrecursionlimit(1000010)
(N,D) = list(map(int,input().split()))
d = D * 2 + 1
print ((N+d-1)//d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
number = input().split(" ")
N = int(number[0])
D = int(number[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,d=map(int,input().split())
e=d+d+1
ans=0
while n>0:
  n-=e
  ans+=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:
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 = n // (2*d + 1)
if n % (2*d + 1) != 0:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import math

'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
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:
a,b=map(int,input().split()) 
for i in range(21): 
	l=(b*2+1)*i 
	if l>=a: 
		print(i) 
		break

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
import math

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

Submission status: Accepted

Solution code:
n, d = map(int, input().split())
c = 0
while True:
  t = n-d
  n = t-d-1
  c += 1
  if n <= 0:
    break
print(c)

Submission status: Accepted

Solution code:

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

x = 0
cnt = 0
while x < n:
    cnt += 1
    x += d * 2 + 1

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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


i = 2 * d + 1

print(math.ceil(n/i))

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())
s = 1
while (2*D+1)*s < N:
    s = s+1
print (s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,D = map(int,input().split())
def ceil(n): # ceiling関数
    if n > int(n):
        return(int(n)+1)
    else:
        return(int(n))
print(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
#import bisect
#import numpy as np
#import itertools
#import copy
import sys

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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


def solve(N: int, D: int):
    return math.ceil(N/(1+D*2))


# Generated by 1.1.6 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
    print(solve(N, D))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

r = (2 * D + 1)

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

Submission status: Accepted

Solution code:

N,D = (int(x) for x in input().split())
ans = 0

while True:
    if N <= 0:
        print(ans)
        break
    else:
        ans += 1
        N -= (2*D + 1)

Submission status: Accepted

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

Submission status: Accepted

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

can = ((2*D)+1)

ans = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

unit = d *2 + 1

if(n < unit):
  print(1)
elif(n % unit == 0):
  print(int(n/unit))
else:
  print((n//unit)+1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

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

Submission status: Accepted

Solution code:
# ABC134 B - Golden Apple
N, D = map(int, input().split())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x=N/(2*D+1)
if x.is_integer()==True:
    print(int(x))
else:
    print(int(x)+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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

N, D = MAP()

te = 1 + D*2

print(ceil(N/te))

Submission status: Accepted

Solution code:
import sys

n, d = map(int, sys.stdin.readline().split())

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# https://atcoder.jp/contests/abc134/tasks/abc134_b

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

Submission status: Accepted

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

d=b*2+1

c=a/d

if c>int(c):
  print(int(c)+1)
else:
  print(int(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
n,d=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:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-

import math


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
d = []
i = 1
while len(d) <= N:
    d += [i]*(D*2+1)
    i += 1
print(len(set(d[:N])))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N, D = (int(nd) for nd in input().split())
watch_once = 2*D + 1
print(math.ceil(N/watch_once))

Submission status: Accepted

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

a = n % (1 + d * 2)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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