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

num, mod = divmod(n, 2 * d + 1)
if mod == 0:
    print(num)
else:
    print(num + 1)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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:
import sys
import math
a=sys.stdin.readline()
res=[i for i in a.split()]
r1,r2=float(res[0]),float(res[1])
v1,v2=r1.is_integer(),r2.is_integer()
if v1==v2==True:
    N,D=int(r1),int(r2)
    if 1<=(N and D)<=20:
        w=2*D+1
        print(int(math.ceil(N/w)))

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:
s1,s2=input().split()
N=int(s1)
D=int(s2)
n=N
ans=0
while n>0:
  n=n-(2*D+1)
  ans=ans+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a=sys.stdin.readline()
res=[i for i in a.split()]
r1,r2=float(res[0]),float(res[1])
v1,v2=r1.is_integer(),r2.is_integer()
if v1==v2==True:
    N,D=int(r1),int(r2)
    if 1<=(N and D)<=20:
        w=2*D+1
        print(int((N+w-1)//w))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

D=1+D+D

if N%D==0:
    print(int(N/D))

else:
    print(int(N/D)+1)

Submission status: Accepted

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

kansi = d * 2 + 1

ans = n // kansi

if n % kansi != 0:
    ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    solve()

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)

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

import math

tmp = d*2+1

ans = math.ceil(n/tmp)

print(ans)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
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())
    # 2d + 1が1人の範囲
    # nを (2*d + 1)で割り切れたらそのまま、割り切れなかったら整数部分 + 1
    ans = n / (2*d + 1)
    if ans.is_integer():
        print(int(ans))
    else:
        print(int(ans) + 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, input().split())
ans = n // (2 * d + 1)
if n % (2 * d + 1) != 0:
    ans += 1
print(ans)

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

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

print(ans)

Submission status: Accepted

Solution code:
#B
import math

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

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

Submission status: Accepted

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

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

d = d * 2 + 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=[int(x) for x in input().split()]
z=b*2+1
c=a/z
if c%1==0:
    print(a//z)
else:
    print(a//z+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())
k = n%(2*d + 1)
if k == 0:
  print(n//(2*d+1))
else:
  print(n//(2*d+1) + 1)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n, d = LI()
    cur = 0
    cnt = 0
    while cur < n:
        cur += (2 * d + 1)
        cnt += 1
    print(cnt)


main()

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

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, D = map(int, input().split())
    if N < (D * 2 + 1):
        ans = 1
    else:
        q, r = divmod(N, D * 2 + 1)
        ans = q + 1 if r > 0 else q
    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import math

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

T = D*2 + 1

print(math.ceil(N / T))

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math


def actual(n, d):
    return math.ceil(n / (2 * d + 1))


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

print(actual(n, d))

Submission status: Accepted

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

Submission status: Accepted

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

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

n,d=inp()
k=0
ans=0
while k<n:
    k=k+d*2+1
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

a = 1 + d + d

print(((n - 1) // a) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

nou = d*2+1

for i in range(1,21):
    if nou * i >= n:
        print(i)
        break

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, d = map(int, input().split())
    ans = 0
    while ans * (2 * d + 1) < n:
        ans += 1
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
import sys


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

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

main()

Submission status: Accepted

Solution code:
from math import ceil


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


if __name__ == '__main__':
    main()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


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


if __name__ == "__main__":
    # N = int(input())
    # Vs = list(map(int, input().split(" ")))
    N, D = tuple(map(int, input().split()))
    print(solve(N, D))

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:
# https://atcoder.jp/contests/abc134/tasks/abc134_b

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

count = 0
ans = 1
for i in range(N):
    count += 1

    if count == D*2 + 2:
        ans += 1
        count = 1

print(ans)


#  123 4 567 890 1 234 5
#  ### # ### ### # ### #

Submission status: Accepted

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy

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

    if ans.is_integer():
        print(int(ans))
    else:
        print(int(ans) + 1)


if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N: int, D: int):
    print(-(-N // (2 * D + 1)))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    solve(N, D)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n): return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
n,d=n1()

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

Submission status: Accepted

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

can_see = 2*D + 1

ans = int(N / can_see)

if N%can_see != 0:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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:
import math
n, d = map(int, input().split())

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

print(ans)

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

Submission status: Accepted

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

d = d*2 + 1

ans = n//d

if n%d == 0:
    print(ans)
else:
    print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


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

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

a,b = map(int, input().split())

print(math.ceil(a/((b * 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:
# -*- coding: <encoding name> -*-

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

Submission status: Accepted

Solution code:
import math
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 sys
input = sys.stdin.readline
N,D = (int(x) for x in input().split())
see_possible =2*D +1
ans =math.ceil(N / see_possible)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil

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

# check
c = 2 * D + 1

print(ceil(N / c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, k = map(int, input().split()) 
if n % (2*k+1) == 0:
    print(n//(2*k+1))
else:
    print(n//(2*k+1)+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def golden_apple(n, d):

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

    return ans

def main():
    n, d = map(int, input().split())
    print(golden_apple(n, d))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
ans = 0
i = D+1

while True:
    ans += 1
    if D+i >= N:
        break
    i += 2*D + 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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//(2*d+1)+1 if n%(2*d+1)!=0 else 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())
ans = 0
while True:
  ans +=1
  n -= 2*d+1
  if n <= 0:
    print(ans)
    break

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

Submission status: Accepted

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n,d=map(int,stdin.readline().split())
print(math.ceil(n/(d+d+1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
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)+1)
else:
    print(n//(2*d+1))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

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


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

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import sys
# sys.setrecursionlimit(10**5)
# from collections import defaultdict

geta = lambda fn: list(map(fn, input().split()))
gete = lambda fn: fn(input())

n, d = geta(int)
print((n + 2 * d) // (2 * d + 1))

Submission status: Accepted

Solution code:
from math import factorial as fact
import math
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
from collections import deque


#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

def combinations(n,r):
	return list(itertools.combinations(range(n),r))



def all_sets(num_list):
	subsets=[]
	for i in range(2,len(num_list) + 1):
		for c in combinations(num_list, i):
			subsets.append(c) 
	return subsets

#公約数の列挙
def ch(x1):
	cf=[]
	for i in range(2,math.sqrt(x1)+1):
		if x1 % i==0:
			cf.append(i)
	return cf

def CountOneRoots(x,y):
	#x:縦，y:横
	return fact(x+y)/fact(x)/fact(y)

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
	
def count_str(m):
	tmp={}
	for i in range(10):
		if i in tmp:
			tmp[i]=1
		else:
			tmp[i]+=1
	return tmp

def is_prime(n):
	if n==1: return True

	for i in range(2,int(math.sqrt(n))+1):
		if n%i==0:
			return False
	return True


n,d=input2()

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect


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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
m = input()
m = m.split(' ')
n = int(m[0])
d = int(m[1])
s = 0
q = 0
while s < n:
    s += (d * 2 + 1)
    q += 1

print(q)