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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

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

#############
# Main Code #
#############
N,D = inputIL()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC001A

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
R = 0
for i in range(1,N+1):
  R += 2 * D + 1
  if N <= R:
    print(i)
    exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n, d = Is()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve():
    N, D = map(int, input().split())
    left = 1+2*D
    ans = 1
    while left < N:
        left = left + 1 + 2*D
        ans += 1
    print(ans)


solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N, D = (int(x) for x in input().split())
    ans = int((N + (2 * D)) / ((2 * D) + 1))
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Golden Apple

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

Submission status: Accepted

Solution code:
import sys, heapq, bisect, math, fractions
from collections import deque

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

i = 0
res = 0
while i < N:
    res += 1
    i += 2 * D + 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]

N, D = ri_()
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())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

r = b*2+1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

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

ans = 0
see = 0
while see < n:
    see += 2 * d + 1
    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:
def main():
    N, D = (int(i) for i in input().split())
    ans = 0--N//(2*D+1)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp = 2 * D + 1

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

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

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 sys
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

Submission status: Accepted

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

print((N - 1) // 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:

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

d = d * 2 + 1

print(math.ceil(n/d))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp = D*2 + 1

ans = N//tmp

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

def main():
    N, D = map(int, open(0).read().split())

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


main()

Submission status: Accepted

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

if __name__ == '__main__':
    main()

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

while n > 0:
    n = n - r
    cnt += 1

print(cnt)

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 = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

d = 1+ 2*D

print(math.ceil(N/d))

Submission status: Accepted

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


main()

Submission status: Accepted

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

ans = n//(2*d)


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

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

Submission status: Accepted

Solution code:
# B - Golden Apple

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

Submission status: Accepted

Solution code:
# B - Golden Apple

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

count=1
for i in range(1,21):
  if n>i*(2*k+1):
    count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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(math.ceil( n/( 2*d + 1 ) ))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

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(int(n/(2*d+1)))
else:
    print(int(n/(2*d+1))+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:
from math import ceil
n, d = [int(x) for x in input().split()]
ans = ceil(n / (2 * d + 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:
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())
print(-(-N//(2*D+1)))

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

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:
# ABC 134: B – Golden Apple
import math

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

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





# def main():

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

Submission status: Accepted

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

Submission status: Accepted

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

w = 2*D + 1

ans = (N + (w - 1)) // w

print(ans)

Submission status: Accepted

Solution code:
def main():
    N, D = map(int, input().split())
    cnt = 0
    while True:
        a, b = divmod(N, (2*D+1))
        cnt += a
        if 2*D + 1 > b:
            if b > 0:
                cnt += 1
            break
    print(cnt)
main()

Submission status: Accepted

Solution code:
def main():
    n, d = map(int, input().split())
    per = 2 * d + 1
    res = n // per
    if n % per != 0:
        print(res + 1 )
    else:
        print(res)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
def people(n):
  p=0
  while n>0:
    n-=(d*2+1)
    p+=1
  return p

def main():
  print(people(n))
  
if __name__=='__main__':
  n,d=map(int,input().split())
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a = n % (d*2+1)

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

Submission status: Accepted

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

ret = a // (b * 2 + 1)

if a % (b * 2 + 1) != 0:
    ret += 1

print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(N):
    cnt += D * 2 + 1
    if N <= cnt:
        print(i + 1)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(out)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
while N > 0:
    N -= breadth + 1
    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())
count = 0

for i in range(n):
    if n >= 2*d+1:
        count += 1
        n = n - (2*d+1)
#print(n)
if n != 0:
    count += 1
print(count)

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

Submission status: Accepted

Solution code:
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



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

Submission status: Accepted

Solution code:
import io
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

n = 2*D +1

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import math
import collections
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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