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=[int(x) for x in input().split()]
man=0
i=1
while True:
  man+=1
  ii=i+2*D
  if ii>=N:
    break
  else:
    i=ii+1

print(man)

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 sys
sys.setrecursionlimit(4100000)
a,b = [int(i) for i in input().split()]
b = b*2+1
temp = a/b
temp2 = a//b
if temp > temp2:
    print(int(temp)+1,)
else:
    print(temp2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-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 _pf(s): return print(s, flush=True)

N, D = LI()

x = 2*D + 1
res = N//x
if N % x > 0:
    res += 1
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = [int(i) for i in 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())

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

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

Submission status: Accepted

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


n, d = (int(x) for x in input().split())
print(div_ceil(n, 2 * d + 1))

Submission status: Accepted

Solution code:
import sys
import math


def input():
    return sys.stdin.readline()[:-1]


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

area = 2 * d + 1
mod = 1 if n % area != 0 else 0
print(int(n / area) + mod)

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:
import sys
sys.setrecursionlimit(4100000)

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


def resolve():
    N, D = [int(x) for x in sys.stdin.readline().split()]

    logger.debug('{} {}'.format(N, D))

    def ceil_int(a, devider):
        """
        floor は a // devider でいい。
        math.floor(a / divedier)　だとオーバーフローしちゃう。
        """

        if (a % devider > 0):
            a_ceil = a // devider + 1
        else:
            a_ceil = a // devider

        return a_ceil

    print(ceil_int(N, 2 * D + 1))


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """6 2"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """14 3"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """20 4"""
        output = """3"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """1 1"""
        output = """1"""
        self.assertIO(input, output)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
n, d = map(int, input().split())
D = 2*d +1
ans = 0
while n > 0:
    n -= D
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math


num_tree, watchable_diff = map(int, input().split(' '))

per_watcher = watchable_diff * 2 + 1

print(math.ceil(num_tree / per_watcher))
exit(0)

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

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

print(int(parson))

Submission status: Accepted

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


if __name__ == "__main__":
    [n, d] = li()
    print((n - 1) // (2 * d + 1) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
def input(): return sys.stdin.readline().strip()
def gcd(x, y): return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y): return (x * y) // gcd(x, y)
MOD = 10 **9 + 7

# N = int(input())
# S = input()
N, D = map(int, input().split())
# 横
# L = [int(x) for x in input().split()]
# 縦
# A = [int(input()) for _ in range(N)]
# 多次元
# L = [[int(x) for x in input().split()] for _ in range(N)]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


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

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

    print(a)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    
    n, d = map(int, input().split())
    d = 2 * d + 1
    print((n + d - 1) // d)
    
    return 0

main()

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys

sys.setrecursionlimit(100000)

MIN = -10 ** 9
MAX = 10 ** 9 + 7


def main():
    # N = int(input())
    N, D = [int(a) for a in input().split()]

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


        print(N// (2 * D + 1))
    else:
        print(N // (2 * D + 1)+1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())

n,d=intinput()
t=2*d+1
print(int(n//t)+1 if n%t!=0 else n//t)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
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

def main():
    input = sys.stdin.readline
    N, D = map(int, input().split())
    return (N + 2*D) // (2*D + 1)


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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 5 + 10)

import math



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

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

q = n // (2*d+1)
r = n % (2*d+1)

if r==0:
    print(q)
else:
    print(q+1)

Submission status: Accepted

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

import sys
import math
import bisect
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
mod = 10**9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

syo = n // (2 * d + 1)
amr = n % (2 * d + 1)

if amr == 0:
    print(syo)
else:
    print(syo + 1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,D = 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:
import math

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

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

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:
hoge = input().split()
N = int(hoge[0])
D = int(hoge[1])
count = 0
hoge = N
while(True):
  count +=1
  hoge = hoge - (1+D+D)
  if hoge <= 0:
    break
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

fin = sys.stdin.readline
N, D = [int(elem) for elem in fin().split()]

watch_num = 2 * D + 1
result = N / watch_num

print(math.ceil(result))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,D = list(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())
a = N//(2*D+1)
b = N%(2*D+1)
if b != 0:
  print(a+1)
else:
  print(a)

Submission status: Accepted

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

Submission status: Accepted

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

import math

if __name__ == '__main__':
    N, D = input().split()
    N = float(N)
    D = float(D)
    numPerUser = 2 * D + 1
    print(math.ceil(N / numPerUser))

Submission status: Accepted

Solution code:
import sys
import math

input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n,k = list(map(int,input().split(" ")))
"""n = int(input())
print(3*(n*n))
"""
import math as m
N,D = list(map(int,input().split(" ")))
print(m.ceil(N / (2*D+1)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1, N + 1):
	if i * (1 + D * 2) >= N:
		print(i)
		break

Submission status: Accepted

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

w = D*2+1
div = N // w
mod = N % w

if mod != 0:
    ans = div+1
else:
    ans = div
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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



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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC134b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math

readline = sys.stdin.readline

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

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs,math
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))

n,m = m()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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


print(ans)

Submission status: Accepted

Solution code:

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


base = 2*d + 1

ans = n//base + (1 if n%base >=1 else 0)

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# coding: utf-8

import sys
import math
#from pprint import pprint
#import numpy as np
def myinput_int():
    return list(map(int, input().split()))
def myinput_str():
    return list(input().split())

N,D = myinput_int()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, d = (int(_) for _ in input().split())
total = d+d+1
if n % total != 0:
    print(n//total + 1)
else:
    print(n//total)

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 = list(map(int, input().split()))
d = 2*d + 1

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

Submission status: Accepted

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

a=n%(2*d+1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
MOD = 10**9 + 7
sys.setrecursionlimit(10**7)
# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###

N, D = mi()
D = D * 2 + 1

print(ceil(N/D))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A
    
if __name__ == '__main__':
    N, D = InputToInt()

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

scope = d*2+1
print(n//scope) if n//scope==n/scope else print(n//scope+1)

Submission status: Accepted

Solution code:
#   In this template you are not required to write code in main

import sys
inf = float("inf")
#sys.setrecursionlimit(1000000)


# abc='abcdefghijklmnopqrstuvwxyz'
# abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
# mod,MOD=1000000007,998244353
# vow=['a','e','i','o','u']
# dx,dy=[-1,1,0,0],[0,0,1,-1]

#from cmath import sqrt
#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import ceil,floor,log,sqrt,factorial,pow,pi,gcd
from bisect import bisect_left,bisect_right
#import numpy as np


def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
import collections as c
ip = lambda : map(int, input().split())
# ##############
mod = 1e9+7
N,D = ip()
ans = (N+2*D)//(2*D+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:
N, D = map(int, input().split())
tmp = 1 + 2 * D
if N % tmp == 0:
        print(N // tmp)
else:
        print(N // tmp + 1)

Submission status: Accepted

Solution code:
import numpy as np

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 = 2*D + 1
if divmod(N, r)[1] == 0:
  print( divmod(N, r)[0] )
else:
  print( divmod(N, r)[0] + 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
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

N,D=LI()

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
while N >= 1:
    N -= 2 * D + 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= [ int(v) for v in input().split() ]
d = 2*d + 1 
ans = n // d
if n % d != 0:
    ans += 1
print(ans)

Submission status: Accepted

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

index = 0
count = 0
while True:
    index += D * 2 + 1
    count += 1
    if index >= N:
        break

print(count)

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


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

Submission status: Accepted

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

hitoribun = D + D + 1

ninzuu = N // hitoribun
if N % hitoribun != 0:
    ninzuu += 1

print(ninzuu)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
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 DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
# }}}

def local_input():# {{{
    from pcm.utils import set_stdin
    import sys
    from pathlib import Path
    parentdir = Path(os.path.dirname(__file__)).parent
    inputfile = parentdir.joinpath('test/sample-1.in')
    if len(sys.argv) == 1:
        set_stdin(inputfile)
# }}}

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

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

if __name__ == "__main__":# {{{
    try:
        local_input()
        def dump(*args):
            names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
            print(', '.join(names.get(id(arg),'???')+' => '+repr(arg) for arg in args), file=sys.stderr)
    except:
        def dump(*args):
            pass

    solve()

# vim: set foldmethod=marker:}}}

Submission status: Accepted

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

Submission status: Accepted

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

window = 2 * d + 1

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

Submission status: Accepted

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


def solve(N: int, D: int):
    res = 0
    while N > 0:
        res += 1
        N -= 1 + 2*D
    print(res)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    solve(N, D)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

p = 2*D+1

print(-(-N//p))

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
N, D = map(int, input().split()) # 横に2個
A = 2*D+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()))
print(N//(2*D+1)+1*(N%(2*D+1)!=0))

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

Submission status: Accepted

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