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 sys
input = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
import math

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

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

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

result=math.ceil(n / tmp)
print(result)

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

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


if __name__ == '__main__':

    n, d = map(int, sys.stdin.readline().strip().split(" "))
    print solve(n, d)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n: int, d: int):
  c = 0
  while n > 0:
    n -= 2 * d + 1
    c += 1
  print(c)

if __name__ == '__main__':
  n, d = [int(k) for k in input().split()]
  solve(n, d)

Submission status: Accepted

Solution code:
n,d=map(int,input().split())
l=d+1
r=n-d
if l==r:
    print(1)
else:
    ans=1
    k=l
    while k<r:
        k+=2*d+1
        ans+=1
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, n+1):
    if count == 0:
        if i - d == 1:
            count += 1
    else:
        count2 += 1
        if count2 == d*2+1:
            count += 1
            count2 = 0

if count2 >= d+1:
  count += 1
if n <= d:
  count += 1

print(count)

Submission status: Accepted

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

r = 0
f = 0
k = a

while f == 0:
    k = k - (b * 2 + 1)
    r += 1
    if k < 1:
        f = 1

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,D = map(int,input().split())
#X_list = [int(input()) for i in range(N)]
#X2_list = [list(map(int,input().split())) for i in range(N)]
tmp = D + D + 1
condition = tmp
cnt = 1
while N > condition:
    condition +=tmp
    #print(condition)
    cnt+=1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    nums = input().split()
    n = int(nums[0])
    d = int(nums[1])
    itr = 0
    kanshi = 0
    while kanshi < n:
        kanshi += d + d + 1
        itr += 1
    print(itr)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
a = list(map(int,input().split()));
N = a[0];
D = a[1];
if(int(N % (2*D+1))== 0):
    ans= int(N/(2*D+1));
else:
    ans = int(N / (2*D+1))+1;
print(ans);

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

else:
    print(a + 1)

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = (int(j) for j in input().split())

C=0
X=D*2+1
C=N//X
if N%X != 0:
	C+=1

print(C)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

def people(t):
    t = t + 2*D
    return t
if N<D:
    print(1)

else:
    t = 1
    c = 0
    while t <= N:
        #print(t)
        t = people(t+1)
        c+=1
    print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = map(int,raw_input().split())
for i in range(10):
        A =N[0]-(N[1]*2+1)*i
        if A <= 0:
                print(i)
                exit()
        else:
                pass

Submission status: Accepted

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

num = 1
while True:
    if (2*d+1)*num >= n:
        print(num)
        break
    else:
        num +=1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N, D = [int(i) for i in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,d = map(int,input().split())
i = 1+d
cnt = 1
while n>0:
    check = i+d
    if(i>=n or check>=n):
        break
    i = check+1+d
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import math
n, d = [int(v) for v in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

t = d*2+1

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

Submission status: Accepted

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

Submission status: Accepted

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

temp = 2*D + 1

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

Submission status: Accepted

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

quotient, remainder = divmod(N, (2 * D + 1))

answer = quotient if (remainder == 0) else quotient + 1

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
args = input().split()
N = int(args[0])
D = int(args[1])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
data = [int(x) for x in input().split(" ")]
print(ceil(data[0]/(data[1]*2 +1)))

Submission status: Accepted

Solution code:
n, d = [int(i) for i in input().split()]

t = (2*d+1)

if n%t:
  print((n // t) + 1)

else:
  print(n//t)

Submission status: Accepted

Solution code:
[N,D] = [int(i) for i in input().split()]

ans = 0
num = 0

while num < N:
	num += 2*D+1
	ans += 1
		
print(ans)

Submission status: Accepted

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

q = N // (2 * D + 1)
p = N % (2 * D + 1)

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

Submission status: Accepted

Solution code:
import math
n, d = [int(x) for x in input().split()]

ans = n / (d*2 + 1)

print(math.ceil(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 math

N, D = input().split()

n = int(N)
d = int(D)

check = 2 * d + 1

print(math.ceil(n/check))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
from operator import itemgetter
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy
from collections import Counter, deque, defaultdict
import heapq
from functools import reduce
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template

def main():
    N, D = mi()
    print(ceil(N / (2 * D + 1)))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

n,d = [int(c) for c 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())
i = 0

while i * (2*d+1) < n:
    i += 1

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
count = 0
guard = 1
while guard <= N:
    guard += (D * 2) 
    if guard <= N:
        count += 1
        guard += 1
    else:
        if N - guard < D:
            count += 1
        print(count)
        exit()
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

d = 2 * D + 1
cnt = 1
while N > d :
  cnt += 1
  d = d + 2 * D + 1
  
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

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


if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

while(N > 0):
    N = N - (2*D+1)
    count  += 1

print(count)

Submission status: Accepted

Solution code:
import math

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

main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n, d = map(int, input().split())
print("{}".format(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
from math import ceil
readline = stdin.readline


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


def main():
    n, d = nl()
    res = ceil(n / (d * 2 + 1))
    print(res)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def resolve():
    n, d = map(int, input().split())
    
    # 切り上げ除算
    print('{}'.format(-(-n // (2 * d + 1))))
    
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n, d = tuple(map(int, sys.stdin.readline().strip().split()))
a = n // (2 * d + 1)
b = n % (2 * d + 1)
if b == 0:
  print(a)
else:
  print(a + 1)

Submission status: Accepted

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

h = 2 * d + 1

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

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=list(map(int,input().split()))
N=n[0]
D=n[1]

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

Submission status: Accepted

Solution code:
import math
p=input().rstrip().split(' ')
n=int(p[0])
d=int(p[1])
A=d*2+1;
print(math.ceil(n/A))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
a=[]
for x in input().split(" "):
    a.append(int(x))

if a[0]//(2*a[1]+1)==a[0]/(2*a[1]+1):
    print(a[0]//(2*a[1]+1))
else:
    print(a[0]//(2*a[1]+1)+1)

Submission status: Accepted

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

def main():
    # # 整数の入力
    # a = int(input())
    # # スペース区切りの整数の入力
    # b, c = map(int, input().split())
    # # 文字列の入力
    # s = input()
    # # 出力
    # print("{} {}".format(a+b+c, s))
    N, D = map(int, input().split())
    ret = int(N / (2*D+1)) if N % (2*D+1) == 0 else int(N / (2*D+1)) + 1
    print(ret)

    
if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def main():
  tree_cnt, view_distance = map(int, (input().split()))
  tmp = 1 + view_distance * 2
  result = math.ceil(tree_cnt / tmp)
  print(result)

    
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math


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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from math import ceil

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math



def main():
    N, D = list(map(int, input().split(" ")))
    right_cover = 0
    left_cover = N+1
    count = 0
    while(True):
        # push right
        right_cover = right_cover + 2*D + 1
        count = count + 1

        if right_cover >= N or right_cover >= left_cover - 1:
            break

        #push left
        left_cover = left_cover - (2*D + 1)
        count = count + 1

        if left_cover <= right_cover + 1:
            break
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(k)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

area = 2*D + 1
result, extra = N // area, N % area

if extra > 0:
    print(result + 1)
else:
    print(result)

Submission status: Accepted

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


def solv(n, d):
    ll = d * 2 + 1
    ans = (n + ll - 1) // ll
    return ans


if __name__ == '__main__':

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

    ans = solv(n, d)

    print(ans)

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())
ans = 0
tmp = 0
while tmp<n:
    tmp += d*2+1
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n,d=list(map(int,input().split(" ")))
t=n//(2*d+1)
s=bool(n % (2*d+1))
ans=t*(not s)+(t+1)*(s)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
while ans * D < N: ans += 1
print ans

Submission status: Accepted

Solution code:
import math

line = list(map(int, input().split(" ")))
N = line[0]
D = line[1]

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

print(bord)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
i = input().split()
N = int(i[0])
D = int(i[1])
idx = D+1
x = idx + D
if (N % x == 0):
    print (N//x)
else:
    print(N//x + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/07/20
# AtCoder Beginner Contest 134 - B

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

# Calc
wk = 2 * d + 1
ans = int(n / wk)

if n % wk > 0:
    ans = ans + 1

# Output
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

# print(N/(2*D+1))
# print(int(N/(2*D+1)))
if (N/(2*D+1)-int(N/(2*D+1)))>0:
    print(int(N/(2*D+1))+1)
else:
    print(int(N/(2*D+1)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
input_data = input().split()
N = int(input_data[0])
D = int(input_data[1])
tmp_answer = N / (2*D+1)

answer = math.ceil(tmp_answer)
print (answer)

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:
N, D = map(int, input().split())
ansB = True
iMinT = D + 1
iMaxT = iMinT + D
ansCnt = 1
while ansB:
    if N <= iMaxT:
        break

    iMinT = iMaxT + D + 1
    iMaxT = iMinT + D
    ansCnt += 1

print(ansCnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,d = map(int,input().split())
li = []
for i in range(n):
    li.append(i)
#最初のひとりの右端
i = 2 * d
c = 0
a = 0
while a < n:
    a += i + 1
    c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

ovserved_range = D*2 + 1

count = N//ovserved_range
if N%ovserved_range != 0:
  count += 1
  
print(count)

Submission status: Accepted

Solution code:
import math

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


see = D*2+1


print(math.ceil(N/see))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, D = tuple([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())
x = d*2+1
if n%x!=0:
  print((n//x)+1)
else:
  print(n//x)

Submission status: Accepted

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

range_data = 2 * d + 1
count = 0

while(n > 0):
    n = n - range_data
    count += 1

print(count)

Submission status: Accepted

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

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 numpy as np

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

a = D+D+1

print(math.ceil(N/a))

Submission status: Accepted

Solution code:
import sys

#+++++
		
def main():
	n, d = map(int, input().split())
	nn=n
	cc=0
	while nn > 0:
		cc+=1
		nn+=-1*(1+2*d)
	print(cc)
	
	
#+++++

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
	else:
		input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

e = D * 2 + 1
m = N % e

if m > 0:
    print((N // e) + 1)
else:
    print(N // e)

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
count = 0
num = 1
while num <= N:
    a = num+D
    A = a + D
    num = A+1
    count += 1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
from collections import defaultdict
from heapq import heappush, heappop
from math import ceil


def djkstra_adj_list(adj_list, src):
    dist = defaultdict(lambda: np.inf)
    dist[src] = 0

    prev = defaultdict(lambda: None)

    queue = []
    heappush(queue, (dist[src], src))

    while len(queue) > 0:
        dist_u, u = heappop(queue)
        vs = adj_list[u]
        for v, weight in vs:
            alt = dist_u + weight
            if alt < dist[v]:
                dist[v] = alt
                prev[v] = u
                heappush(queue, (alt, v))

    return dist, prev


def djkstra_adj_mat(adj_mat, src):
    dist = defaultdict(lambda: np.inf)
    dist[src] = 0

    prev = defaultdict(lambda: None)

    queue = []
    heappush(queue, (dist[src], src))

    while len(queue) > 0:
        dist_u, u = heappop(queue)
        vs = np.argwhere(adj_mat[u] > 0).flatten()
        for v in vs:
            weight = adj_mat[u, v]
            alt = dist_u + weight
            if alt < dist[v]:
                dist[v] = alt
                prev[v] = u
                heappush(queue, (alt, v))

    return dist, prev


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

Submission status: Accepted

Solution code:
import math

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

range_kansi = 1 + D*2 

print(str(math.ceil(N / range_kansi)))

Submission status: Accepted

Solution code:
import numpy as np


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

N = a[0]
D = a[1]


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

print(int(ans))

Submission status: Accepted

Solution code:
N,D = (int(i) for i in 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:
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 = [int(i) for i in input().split(" ")]
print((N-1) // (D*2+1) + 1)

Submission status: Accepted

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

tmp = 2*b+1

if a % tmp == 0:
	ans = a / tmp
	print(int(ans))
else:
	ans = a / tmp + 1
	print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

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

dd = d*2+1

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

Submission status: Accepted

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

for i in range(1, n):
  if n <= capacity * i:
    min = i
    break
print(min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
def acinput():
    return list(map(int,input().split(" ")))


N,D=acinput()

print(int(np.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:
# -*- coding: utf-8 -*-
import math

def GoldenApple(tree_num, watch_range):
    print(math.ceil(tree_num/(2*watch_range+1)))

if __name__ == "__main__":
    [N,D] = list(map(int,input().split(" ")));
    GoldenApple(N,D)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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())

NoOfman = 0
vision = 2*D+1

while(1):
    NoOfman += 1
    N -= vision
    if N<=0:
        break

print(NoOfman)