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:
def main():

    """ convenient functions
    # for i, a in enumerate(iterable)
    # q, mod = divmod(a, b)
    # divmod(x, y) returns the tuple (x//y, x%y)
    # Higher-order function: reduce(operator.mul, xyz_count, 1)
    # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f
    """

    """convenient decorator
    # @functools.lru_cache():
    # to facilitate use of recursive function
        # ex:
        # from functools import lru_cache
        # import sys
        # sys.setrecursionlimit(10**9)
        # @lru_cache(maxsize=None)
        # def fib(n):
        #     if n < 2:
        #         return n
        #     return fib(n-1) + fib(n-2)
        # print(fib(1000))
    """
    
    # import numpy as np
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html
    # accumulate() returns iterator! to get list: list(accumulate())
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  # prime factor
        b, e = 2, 0  # base, exponent
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        # TODO: How should I do when n - r is negative?
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html
    from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html
    import operator
    from operator import itemgetter
    # ex1: List.sort(key=itemgetter(1))
    # ex2: sorted(tuples, key=itemgetter(1,2))
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    # first create factorial_list
    # fac_list = mod_factorial_list(n)
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!
    def modinv(a, p = MOD):
        # evaluate reciprocal using Fermat's little theorem:
        # a**(p-1) is identical to 1 (mod p) when a and p is coprime
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        # fac_list = modfactorial_list(100)
        # print(modcomb(100, 5, modfactorial_list(100)))
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    """ initialize variables and set inputs
    # initialize variables
        # to initialize list, use [0] * n
        # to initialize two dimentional array, use [[0] * N for _ in range(N)]
    # set inputs
        # open(0).read() is a convenient method:
        # ex) n, m, *x = map(int, open(0).read().split())
        #     min(x[::2]) - max(x[1::2])
        # ex2) *x, = map(int, open(0).read().split())
        #     don't forget to add comma after *x if only one variable is used
    # preprocessing
        # transpose = [x for x in zip(*data)]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
        # flat = [flatten for inner in data for flatten in inner]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]
    # calculate and output
        # output pattern
        # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6
    """

    # functions used
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    # single int: int(r())
    # single string: r()
    # single float: float(r())
    # line int: R()
    # line string: r().split()
    # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]
    # lines int: [R() for _ in range(n)]
    """

    if __name__ != '__main__':
        # for test
        sys.stdin = open('sample.txt')

    # ----------------------------------
    # main

    N, D = R()
    print(ceil(N/(2*D+1)))
    
    # end of main
    # ----------------------------------

    """memo: how to use defaultdict of list
    # initialize
    Dic = defaultdict(list)
    # append / extend
    Dic[x].append(y)
    # for
    for k, v in Dic.items():
    """

if __name__ == '__main__':
    main()

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 = 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())
tree = 2 * D + 1
ans = math.ceil(N / tree)
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:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

import math

n,d = na()
g = d*2+1

print(math.ceil(n/g))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
from math import ceil



if __name__ == "__main__":
    n,d = map(int,input().split())
    print(ceil(n/(2*d+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())

d = 2*D+1
ans = N//d

if(N%d != 0):
    ans+=1

print(ans)

Submission status: Accepted

Solution code:
import sys

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

r = 1+D+D

print(int((N+r-1)/r))

Submission status: Accepted

Solution code:
n, d = [int(i) for i 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())
print(-1*(-n//(2*d+1)))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

N, D = map(int, input().strip().split(' '))
nes = N // (2 * D + 1)
if N % (2 * D + 1) != 0:
    nes += 1
print(nes)

Submission status: Accepted

Solution code:
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
    #n=int(input())
    n,d= map(int, sys.stdin.readline().split(' '))
    dis = 2*d+1
    val = n//dis
    if val*dis <n:
        val+=1
    print(val)
    #a=list(map(int,sys.stdin.readline().split(' ')))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

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

s = 1 + d*2

if n%s != 0:
    ans = n//s + 1
else:
    ans = n//s

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

N, D = getlist()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N: int, D: int):
    p, r = divmod(N, D * 2 + 1)
    res = p
    if r > 0:
        res += 1
    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,m=map(int,input().split())
if(n%(m*2+1)==0):
    print(n//(m*2+1))
else:
    print(n//(m*2+1)+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:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


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


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


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


def main():
    N, D = read_int_n()
    print(slv(N, D))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, d = map(int, list(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 numpy as np

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

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

Submission status: Accepted

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

pos = d*2 +1
res = n // pos
if n % pos != 0:
    res += 1
print(res)

Submission status: Accepted

Solution code:
def solve(N, D):
    if N % (D * 2 + 1) == 0:
        return N // (D * 2 + 1)
    else:
        return N // (D * 2 + 1) + 1

def main():
    A, B = [int(x) for x in input().split()]
    print(solve(A, B))


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil,floor

from sys import exit

from copy import deepcopy
import numpy as np

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


    print(ans)

main()

Submission status: Accepted

Solution code:
from math import ceil

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import *
import sys
inp = raw_input

def err(s):
    sys.stderr.write('{}\n'.format(s))

def ni():
    return int(inp())

def nl():
    return [int(_) for _ in inp().split()]

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

div, mod = divmod(N, 2*D+1)

if mod != 0:
    div += 1

print(div)

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

n, k = getList()
hitori = k * 2 + 1
print((n - 1)// hitori + 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())
print((n-1) // (2*d+1) + 1)

Submission status: Accepted

Solution code:
from math import ceil

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,D = (int(x) for x in input().split())
d21 = 2*D+1
ans = N//d21
if N%d21 != 0:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n = I()
    print(3*n**2)
    return

#B
def B():
    n,d = LI()
    f = [1]*(n+2*d+2)
    ans = 0
    for i in range(n):
        if f[i]:
            for j in range(i,i+2*d+1):
                f[j] = 0
            ans += 1
    print(ans)
    return

#C
def C():
    n = I()

    return

#D
def D():
    n = I()

    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    B()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.readline
inf = 10 ** 18
P = 10 ** 9 + 7

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

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

print(i)

Submission status: Accepted

Solution code:
n, d = (int(i) for i in 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())
capa = 2 * d + 1
if n % capa == 0:
    print(n // capa)
else:
    print(n // capa + 1)

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 = input().split()
n = int(n)
d = int(d)

print(math.ceil(n / (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:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc134/tasks/abc134_b

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

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

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, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, D = MAP()

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 input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    N, D = MAP()
    if N%(2* D + 1)>0:
        print(N//(2* D + 1)+1)
    else:
        print(N//(2* D+ 1))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

temp = d * 2 + 1

print(  math.ceil(n/temp))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n = int(input())
# a, b
# s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd
import math


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

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

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

Submission status: Accepted

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