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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=[]
for x in input().split(" "):
    a.append(int(x))
    
print(int(a[0]/(2*a[1]+1))+1)

Submission status: Wrong Answer

Solution code:
import math

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

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import io
import sys
from math import ceil


def IN_S():
  return input()


def IN_I():
  return int(input())


def IN_L_I():
  return list(map(int, input().split()))


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
20 4
'''


def MAIN():
  T_IN()
  A()


def A():
  n, d = IN_L_I()
  
  print(ceil( n / (d * 2 + 1)))
  
  return None
 

def B():
  return None


def C():
  return None


MAIN()

Submission status: Wrong Answer

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

for i in range(n):
    if i * (2 * d + 1) >= n:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,D=(int(x) for x in input().split())
a=D
count=0
while(a<=N):
    if(a+D>N):
        count+=1
        break
    else:
        a+=2*D
        count+=1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
l = input().split()
n = int(l[0])
d = int(l[1])
a = np.ceil(n / (2 * d +1))
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
from decimal import Decimal, ROUND_HALF_UP

readline = stdin.readline


def nl():
    """
    空白区切り行入力を`int iter`に変換
    """
    return map(int, readline().split())


def main():
    n, d = nl()
    res = Decimal(n / d / 2).quantize(0, rounding=ROUND_HALF_UP)
    print(res)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

import sys

tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))
n = hoge[0]
d = hoge[1]

d = d*2 +1

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

see = 2*D+1

if N%see==0:
    ans = N/see

else:
    ans = int(N/see) + 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, d = map(int, input().split())
print("{}".format(round(n/(2*d))))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(N):
    if N - (2*D + 1)*i <= 0:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, D = [int(nd) for nd in input().split()]
ans = N // (D*2 + 1) + 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = N//D + 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
import math
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


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

    print(int(math.ceil(n / (d * 2))))


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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


def main():
    print(solve())


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
C,D = list(map(lambda x: int(x),input().split()))
print(C//(D*2+1)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

main()

Submission status: Time Limit Exceeded

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC134 B

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3
import sys
input = lambda: sys.stdin.readline().strip()
n, d = [int(x) for x in input().split()]
l = 2 * d + 1
print((n + l - 1) // l)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

monitor, ans = 0, 0
while monitor < N:
  monitor += 2*D + 1
  ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

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

A = D * 2 + 1

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

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

Submission status: Accepted

Solution code:
import math
tree_num, range = map(int,input().split())

range_num = range * 2 + 1

print(math.ceil(tree_num / range_num))

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

Submission status: Accepted

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

Submission status: Accepted

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

d=d*2+1

import math

print(math.ceil(n/d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

eye = 2 * d +1

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
 
# 前から最適に配置せよ
# 一人目は, 1,...,D, D+1, D+2,...,2D+1 を監視
# 二人目は, 2D+2,..., 3D+2, ...,4D+2 を監視
# x人まで繰り返すと、1,...,x(2D+1)まで監視できる
 
# x(2D+1) > N を満たす最小のxは？
# x_min = ceil(N/(2D+1))
 
# ceil(B/A) = floor((A+B-1)/A)
print((N+2*D) // (2*D+1))

Submission status: Accepted

Solution code:
import math
N, D = map(int, input().split())
 
# 前から最適に配置せよ
# 一人目は, 1,...,D, D+1, D+2,...,2D+1 を監視
# 二人目は, 2D+2,..., 3D+2, ...,4D+2 を監視
# x人まで繰り返すと、1,...,x(2D+1)まで監視できる
 
# x(2D+1) > N を満たす最小のxは？
# x_min = ceil(N/(2D+1))
 
print(math.ceil(N/(2*D+1)))

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
 
# 前から最適に配置せよ
# 一人目は, 1,...,D, D+1, D+2,...,2D+1 を監視
# 二人目は, 2D+2,..., 3D+2, ...,4D+2 を監視
# x人まで繰り返すと、1,...,x(2D+1)まで監視できる
 
# x(2D+1) > N を満たす最小のxは？
# x_min = ceil(N/(2D+1))
 
print(-(-N//(2*D+1)))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

# 一人の監視員がカバーできる範囲
cover_area = (d*2+1)
ans = n // cover_area
if (n % cover_area) != 0:
    print(ans+1)
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
r=input().split()
N=int(r[0])
D=int(r[1])
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

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


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

    x = 2 * D + 1

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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

print(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:
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


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

print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
r = 2 * D + 1
print(N // r if N % r == 0 else N // r + 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:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque, defaultdict
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N, D = MI()
    print((N+2*D)//(1+2*D))

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque, defaultdict
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N, D = MI()
    ans = 0
    while N > 0:
        N -= 1 + 2 * D
        ans += 1
    print(ans)

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,d=[int(x) for x in 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())
area = D*2 + 1
ans = (N+area-1)//area
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())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
N,D = map(int,input().split())
ans = (N-1) // (2*D+1) + 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:
#1 2 3 4 5
n,d = map(int,input().split())
ans = n//(2 * d + 1)
if n%(2 * d + 1) == 0:
    print(ans)
else:
    print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from math import *
n,k=map(int,input().split())
print(ceil(n/(2*k+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:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n,d=nii()
num=d*2+1
print((n+num-1)//num)

Submission status: Accepted

Solution code:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n,d=nii()
print((n+d*2+1-1)//(d*2+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/(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:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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