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:
#

#

import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop
import math

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

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = 2 * d + 1

print(-(-n // x))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意

n,d = [int(i) for i in readline().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(R)

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

Submission status: Accepted

Solution code:
from math import ceil

N, D = [int(elem) for elem in input().split()]
num_trees_per_person = 2 * D + 1

print(ceil(N / num_trees_per_person))

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

print(r)

Submission status: Accepted

Solution code:

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


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

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

else:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil

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

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

Submission status: Accepted

Solution code:
import math

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

print(solve())

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]

n,d=MI()
l=2*d+1
ans=(n+l-1)//l
#for i in range(n):
print(ans)

Submission status: Accepted

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


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
import sys
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

import math

def main():
    N, D = i2nn()
    n = int(math.ceil(N / (2*D+1)))
    print(n)

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# from sys import exit, stderr
# from inspect import currentframe
# def debug(*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=stderr)
#     return
N, D = [int(n) for n in input().split()]
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# INF = 10000000002
# EPS = 1e-9
# exit()
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())

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

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

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

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

# r = int(sys.stdin.readline())
# print(r**2 *3)

N, D = list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

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

import os
import sys
from __builtin__ import xrange as range
from cStringIO import StringIO
from future_builtins import ascii, filter, hex, map, oct, zip
from io import IOBase

import __pypy__


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


# region fastio

BUFSIZE = 8192


class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

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


class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)

    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()


def print(*args, **kwargs):
    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()


sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n, d = li()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
# import bisect
# import math
import numpy as np
# from fractions import gcd
import itertools

"""Template"""


class IP:
    """
    入力を取得するクラス
    """
    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x//y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)

    def lcm(self, x, y):
        return (x * y) // self.gcd(x, y)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e = range, enumerate
    ip = IP()
    id = Idea()
    """この下から書いてね"""
    n, d = ip.IL()
    print(id.ceil(n, (2 * d + 1)))


main()

Submission status: Accepted

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

k = 2 * k + 1

c = n % k

if c == 0:
  print(n // k)
else:
  print(n // k + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

a = d*2+1


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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N, D = [int(i) for i in input().split()]
d = 1 + 2 * D

print(-(-N // d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


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


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

Submission status: Accepted

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

Submission status: Accepted

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

a = 2*D+1

print(N//a + (N % a != 0))

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(1,21):
  if (i - d) == 1:
    num = i + d
    ans = n / num 
    if ans = int(ans):
      print(ans)
    else:
      print(ans+1)

Submission status: Runtime Error

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

for i in range(1,21):
  if (i - d) == 1:
    num = i + d
    ans = n / num 
    if ans = int(ans):
      print(ans)
    else:
      print(ans+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import ceil

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

print(math.ceil(a//(2*b+1)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
/* ex4_1
  bonbonc */

#include<stdio.h>
int main(void){
	int tree, range;
	int assigned;//一人が割り当てられる木の本数の最大値

	scanf("%d %d",&tree,&range);
	assigned = 2*range+1; //自分のいる位置と左右にrange本

	if (tree%assigned==0){//木の本数がassignedで割り切れるとき
		printf("%d\n",tree/assigned);//木の本数をassignedで割った商を出力
	}else{
		printf("%d\n",tree/assigned +1);//木の本数をassignedで切り捨て除算し、1を加えて出力
	}

	
	return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: <encoding name> -*-

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
d = int(input())
s = 0
q = 0
while s < n:
    s += (d * 2 + 1)
    q += 1

print(q)

Submission status: Runtime Error

Solution code:
# ABC001A

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

inputted = list(map(int, input()))
N = inputted[0]
D = inputted[1]

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

print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
a, b = int(input())
if a%(1+b) !=0:
  print(a//(1+b)+1)
else:
  print(a//(1+b))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <cmath>
using namespace std;

int main() {
    
    int a , b; 
    cin >> a >> b;
    cout << int((a / (2* b + 1))+1)<< endl;
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split()) 
for i in range(21): 
	l=(b*2+1)*i 
		if l>=a: 
			print(i) 
			break

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split()) 
for i in range(21): 
	l=(b*2+1)*i 
		if l>=a: 
			print(i) 
			break

Submission status: Runtime Error

Solution code:
 a,b=map(int,input().split()) 
for i in range(21): 
	l=(b*2+1)*i 
		if l>=a: 
			print(i) 
			break

Submission status: Runtime Error

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

n = int(input())
print(int((n - 1) / 2) if n % 2 == 1 else int(n / 2) - 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

n,d = map(int,input().split())
ans = 0
dis = 2*d +1

if (n % d) == 0:
	ans = int(n / dis)
else:
	ans = int()(n // dis)+1)

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,d = map(int,input().split())
for i in range(n):
    if (d*2+1)*i >= n:
        a = i
        break
print(a)

Submission status: Runtime Error

Solution code:
list = input().split(" ")
n = int(list[0])
d = int(list[1])

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

Submission status: Runtime Error

Solution code:
list = input().split(" ")
n = int(list[0])
d = int(list[1])

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

Submission status: Runtime Error

Solution code:
list = input().split(" ")
n = int(list[0])
d = int(list[1])

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

Submission status: Runtime Error

Solution code:
nd=list(map(int,input().split()))
ans=nd[0]//(2*nd[1]+1)
if nd%(2*nd[1]+1)!=0:
  ans+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count=n//(2*d+1)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, D = [int (x) for x in input().split()]
X = N / (2 * D + 1)
if (X.is_integer()) print(X)
else print(X + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math

l=list(map(int,input().split()))
n=l[0]
d=l[1]
print(math.ceil(n/(2d+1)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

Solution code:
n,d = (int(x) for x in input().split())
t = 2d + 1
     
if n % t == 0:
	ans = n/t
else:
	ans = n/t
    ans = ans + 1

print(ans)

Submission status: Runtime Error

Solution code:
n,d = (int(x) for x in input().split())
t = 2d + 1

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
import math
def print_ans(N, D):
    """Test Case
    >>> print_ans(6, 2)
    2
    >>> print_ans(14, 3)
    2
    >>> print_ans(20, 4)
    3
    """
    print(math.ceil(N / (D * 2 + 1)))
    

if __name__ == '__main__':
    N, D = map(int,input().rstrip().sprit())
    print_ans(N, D)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

def solve(N, d):
    total = 0
    for i1 in range(len(d)):
        for i2 in range(i1+1, len(d)):
            total += d[i1] * d[i2]
    return total


if __name__ == '__main__':
    N = int(input())
    d = map(int, input().split())

    ans = solve(N, list(d))

    print(ans)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
for i in range(1,a):
  if a<=(b*2+1)*i :
    break
print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if N & (D*2 + 1 ) = 0:
    print(N/(D*2 + 1))
else :
    print(round(N//(D*2 + 1)+1))

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

print(N/(2D+1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,D = list(map(int,input().split()))
human = 1
hani = 2*D+1
while hani < N:
    hani = hani + (2*D+1)
    human +=1
    
print(human) = kanshi

Submission status: Runtime Error

Solution code:
N,D = list(map(int,input().split()))
human = 1
hani = 2*D+1
haniwhile hani < N:
    hani = hani + (2*D+1)
    human +=1
    
print(human) = kanshi

Submission status: Runtime Error

Solution code:
N,D = list(map(int,input().split()))
human = 1
kanshi = 2*D+1
haniwhile hani < N:
    hani = hani + kanshi
    human +=1
    
print(human) = kanshi

Submission status: Runtime Error

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

c=(-((-a)//(2*b+1)))
print(c)

Submission status: Runtime Error

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

print(-(a//(2*b+1)))

Submission status: Runtime Error

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())

print(-(-a)//(2b+1))