Problem:


Score : 200 points

Problem Statement

There are N apple trees in a row. People say that one of them will bear golden apples.

We want to deploy some number of inspectors so that each of these trees will be inspected.

Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 through N to the trees. An inspector deployed under the i-th tree (1 \leq i \leq N) will inspect the trees with numbers between i-D and i+D (inclusive).

Find the minimum number of inspectors that we need to deploy to achieve the objective.

Constraints

All values in input are integers.

1 \leq N \leq 20

1 \leq D \leq 20

Input

Input is given from Standard Input in the following format:

N D

Output

Print the minimum number of inspectors that we need to deploy to achieve the objective.

Sample Input 1

6 2

Sample Output 1

2

We can achieve the objective by, for example, placing an inspector under Tree 3 and Tree 4.

Sample Input 2

14 3

Sample Output 2

2

Sample Input 3

20 4

Sample Output 3

3



Sample input:
6 2


Sample output:
2

Submission status: Wrong Answer

Solution code:
import sys
import copy

def check1(N, D, alist):
  if N - D <= 1:
    alist[0] += 1
    print(alist[0])
    sys.exit()

  diff = (N - 2 * D) - (1 + 2 * D ) 
  if diff <= 1:
    alist[0] += 2
    print(alist[0])
    sys.exit()

def check2(N, D, alist):
  woods = []
  for i in range(N):
    i += 1
    woods.append(i)

  woods_copy = copy.copy(woods)

  for i in woods_copy:
    if i >= (N - 2 * D):
      woods.remove(i)
    elif i <= (1 + 2 * D):
      woods.remove(i)
  alist[0] += 2
  alist[1] = len(woods)
  return alist

n, d = map(int, input().split())
alist = [0, n]

while 1:
  check1(alist[1], d, alist)
  alist = check2(alist[1], d, alist)
  if alist[1] == 0:
    print(alist[0])
    sys.exit()

Submission status: Wrong Answer

Solution code:
import decimal
N, D = map(int, input().split())
print(decimal.Decimal(N/(D*2)+0.1).quantize(decimal.Decimal('0')))

Submission status: Wrong Answer

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

man=d*2+1

cnt=1
while True:
    if n>man:
        cnt+=1
        man=2*man

    else:
        break
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
c = round(a/2/b)
print(c)

Submission status: Wrong Answer

Solution code:

S=input()

tmp=S.split()
N=int(tmp[0])
D=int(tmp[1])

result=float(N/(2*D))

if result-int(result)<0.5:
    result=int(result)
else:
    result=int(result)+1

print(result)

Submission status: Wrong Answer

Solution code:

S=input()

tmp=S.split()
N=int(tmp[0])
D=int(tmp[1])

result=float(N/(2*D))

if result-int(result)<0.5:
    result=int(result)
else:
    result=int(result+1)

print(result)

Submission status: Wrong Answer

Solution code:
n, d = [ int(_) for _ in input().split() ]
temp  = n // (2*d)
print( temp + 1 )

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

start, end = 1, n
count = 0
if d >= n:
  count += 1
else:
  while start < end:
    start = start + (d*2) + 1
    end = end - (d*2) - 1
    count += 2
  if (start - end) > 0:
    count -= 1
  else:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
from sys import stdin


def round1(a):
    return (a * 2 + 1) // 2


N, D = stdin.readline().rstrip().split(' ')
print(int(round1(int(N) / (int(D) * 2))))

Submission status: Wrong Answer

Solution code:

S=input()

tmp=S.split()
N=int(tmp[0])
D=int(tmp[1])

count=0

head=0
tail=N-1

head_step=D
tail_step=D
for i in range(N):
    if head>=tail:
        break
    
    if head<=i+head_step and i+head_step<=tail:
        head=i+head_step
        if head+D>=tail and head_step!=D:
            break
        count+=1
        head_step+=D
    
    if tail>=N-1-i-tail_step and N-1-i-tail_step>=head:
        tail=N-1-i-tail_step
        if tail-D<=head and tail_step!=D:
            break
        count+=1
        tail_step+=D
    

print(count)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math


def my_round(x, d=0):
    p = 10 ** d
    return float(math.floor((x * p) + math.copysign(0.5, x)))/p


N, D = stdin.readline().rstrip().split(' ')
print(int(my_round(int(N) / (int(D) * 2), 0)))

Submission status: Wrong Answer

Solution code:
N, D = map(int, input().split())
cnt = 0
i = 1
j = 1
while i <= N:
#     print(i)
    if i != 1 and i % D == j:
        cnt += 1
        j += 1
#         print(cnt)
        if ((i + D) < N) and ((i + 2*D) > N):
#             print(cnt)
            cnt += 1
            break
        else:
            i += 2*D
    i += 1
    
print(cnt)

Submission status: Wrong Answer

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

first = 1 + 2 * D
second = N - 2 * D - 1
if second - first <= 1:
    print(2)
else:
    print(2 + math.ceil((second - first) / (2 * D + 1)))

Submission status: Wrong Answer

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

if N <= 0 or D <= 0:
  ans = 0
    
print(ans)

Submission status: Wrong Answer

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

i=1
answer=0
while(True):
    i = i + 2*d + 1
    answer += 1
    if i>=n:
        break
        
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if N == 0 or D == 0:
  ans = 0
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

first = 1 + 2 * D
second = N - 2 * D
if second - first <= 1:
    print(2)
else:
    print(2 + math.ceil((second - first) / D))

Submission status: Wrong Answer

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

start, end = 1, n
count = 1
if d >= n:
  print(count)
else:
  while start <= end:
    start = start + (d*2) + 1
    end = end - (d*2) - 1
    count += 1
    if (end - start) > d:
      count += 1
print(count)

Submission status: Wrong Answer

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

max = (n - d) - d
count = 1

for i in range(1000):
  if max <= 1:
    break
  max = (max - (d*2)) 
  count += 1

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    N, D = map(int, input().split())
    miru = 2 * D + 1
    for i in range(1, N):
        if (N - miru * i <= 0):
            print(i)
            break
resolve()

Submission status: Wrong Answer

Solution code:
N ,D =map(int,input().split())
cnt = 0
i2 = 0
for i in range(N):
    if i - D ==1:
        i2 = i + 1
        break
for j in range(N):
    if i2  + D >= N:
        cnt+=1
        print(cnt)
        exit()
    else:
        i2 = i2 + D * 2 + 1
        cnt+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

i = 1
left = 1
res = 0
while i <= N:
    if i - D == left:
        print(i, left)
        left = i + D + 1
        res += 1
    i += 1

if left <= N: res += 1

print(res)

Submission status: Wrong Answer

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

max = (n - d) - d
min = (1 + d) + d

if  (n - d) <= (1 + d):
  count = 1
else:
  count = 2

for i in range(1000):
  if min + (n - max + 1) >= n:
    break
  min = (min + (d*2)) 
  count += 1

print(count)

Submission status: Wrong Answer

Solution code:
N, D = map(int, input().split())
cnt = 0
i = 1
j = 1
while i < N:
#     print(i)
    if i != 1 and (i-j) % D == 0:
        cnt += 1
        j += 1
#         print(cnt)
        if ((i + D) < N) and ((i + 2*D) > N):
#             print(cnt)
            cnt += 1
            break
        else:
            i += 2*D
    i += 1
    
print(cnt)

Submission status: Wrong Answer

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

start, end = 1, n
count = 1
while d < n and start <= end:
  start = start + (d*2) + 1
  end = end - (d*2) - 1
  count += 1
print(count)

Submission status: Wrong Answer

Solution code:
N ,D =map(int,input().split())
cnt = 0
i2 = 0
for i in range(N):
    if i - D ==1:
        i2 = i
        break
for j in range(N):
    if i2  + D >= N:
        cnt+=1
        print(cnt)
        exit()
    else:
        i2 = i2 + D * 2 + 2 
        cnt+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    N, D = map(int, input().split())
    miru = 2 * D + 1
    for i in range(N):
        if (N - miru * i <= 0):
            print(i)
            break
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

start, end = 1, n
count = 1
while d < n and start < end:
  start = start + (d*2) + 1
  end = end - (d*2) - 1
  count += 1
print(count)

Submission status: Wrong Answer

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

imin = d+1
imax = n-d
if d>2:
  print((imax-imin+1)//d)
else:
  print(imax-imin+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,d = input().split()
hon = 2 * int(d) + 1
a = int(n) / hon
for i in range(1,20):
  if a == i:
    answer = a
  else:
    answer = a + 1
print(int(answer))

Submission status: Wrong Answer

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

    
print(ans)

Submission status: Wrong Answer

Solution code:

S=input()

tmp=S.split()
N=int(tmp[0])
D=int(tmp[1])

List=[0]*N

count=0

for i in range(0+D,N-D,D+1):
    if i>=N-D:
        break
    count+=1

print(count)

Submission status: Wrong Answer

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

max = (n - d) - d
min = (1 + d) + d

if  (n - d) <= (1 + d):
  count = 1
else:
  count = 2

for i in range(1000):
  if min + (n - max + 1) >= n:
    break
  min += d
  count += 1

print(count)

Submission status: Wrong Answer

Solution code:
N ,D =map(int,input().split())
cnt = 0
i2 = 0
for i in range(N):
    if i - D ==1:
        i2 = i
        break
for j in range(N):
    if i2 + D >=N:
        cnt+=1
        print(cnt)
        exit()
    else:
        i2 = i2 + D *2 + 1
        cnt+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

S=input()

tmp=S.split()
N=int(tmp[0])
D=int(tmp[1])

List=[0]*N

count=0

for i in range(0+D,N-D,D+1):
    count+=1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, D = map(int, input().split())
ans = 1
i = 0
for j in range(N):
  if i+(1+(2*D)) <= N:
    ans += 1
    i = i+(1+(2*D))

    
print(ans)

Submission status: Wrong Answer

Solution code:
N, D = map(int, input().split())
ans = 1
i = 0
for j in range(D):
  if i+(1+(2*D)) <= N:
    ans += 1
    i = i+(1+(2*D))

    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

start, end = 1, n
count = 0

while (start <= end):
  start = start + (d*2) + 1
  end = end - (d*2) - 1
  count += 1
print(count + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, D = map(int, input().split())
cnt = 0
i = 1
j = 1
while i <= N:
#     print(i)
    if i != 1 and (i-j) % D == 0:
        cnt += 1
        j += 1
#         print(cnt)
        if ((i + D) < N) and ((i + 2*D) > N):
#             print(cnt)
            cnt += 1
            break
        else:
            i += 2*D
    i += 1
    
print(cnt)

Submission status: Wrong Answer

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

print(n)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int, input().split())
c=b+1
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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
cnt = 1
while N > tmp:
    tmp +=tmp
    cnt+=1

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,D = map(int,input().split())
#print(N,D)
A = [i for i in range(1,N+1)]
#print(A)

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n=0
while 1:
  a -= 2*b
  n += 1
  if a <= 0:
    break

print(n)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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:
  count += 1

print(count)

Submission status: Wrong Answer

Solution code:
import math

s = input().split(' ')
n = int(s[0])
d = int(s[1])

perP = 2 * d + 1
ans = n / perP
if(ans.is_integer() ):
    print('{:1.0f}'.format(ans))
else:
    print('{:1.0f}'.format(ans + 1))

Submission status: Wrong Answer

Solution code:
N,D = map(int,input().split())
#print(N,D)
A = [i for i in range(1,N+1)]
#print(A)

def people(t):
    p = t + D
    t = p + D
    return t
t = 1
c = 0
while t < N:
    #print(t)
    t = people(t+1)
    c+=1
print(c)

Submission status: Wrong Answer

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

t = d*2+1

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

Submission status: Wrong Answer

Solution code:
import math

N, D = input().split()

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

check = 2 * d + 1

print(math.ceil(d/check))

Submission status: Wrong Answer

Solution code:
N ,D =map(int,input().split())
cnt = 0
i2 = 0
for i in range(N):
    if i - D ==1:
        i2 = i
        break
for j in range(N):
    if i2 + D >=N:
        cnt += 1
        break
    else:
        i2 = i2 + D + i2
        cnt+= 1
print(cnt)

Submission status: Wrong Answer

Solution code:
N ,D =map(int,input().split())
cnt = 0
i2 = 0
for i in range(N):
    if i - D ==1:
        i2 = i
        break
for j in range(N):
    if i2 + D >=N:
        cnt += 1
        break
    else:
        print(i2)
        i2 = i2 + D + i2
        cnt+= 1
print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

N, D = map(int, input().split())
float_var = N/(D*2)

print(math.ceil(float_var))

Submission status: Wrong Answer

Solution code:
N,D = map(int,input().split())
count  = 0
start_position = 1
total = N
for i in range(1,N+1):
    if total <= 0:
        break
        
    if i -D >= 1:
        total = total-(i+D-(i-D)+1)
        count+=1
    else:
        continue
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int, input().split())
c=b-1
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Solution code:
n=list(map(int,input().split()))
N=n[0]
D=n[1]

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

Submission status: Wrong Answer

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

h = 2*d + 1

print(n%h+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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) + 1)
    print(ret)

    
if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(nd[0]//(nd[1]*2+1)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math


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

max = D + 3

print(math.ceil((N / max)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

a, b = readmi()

count = 1
n = b + 1
while(n <= a):
    n += (b * 2) + 1
    count += 1
    if n + b >= a:
        break
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

n -= (d+1)  # 一人目の立つ場所
ans += 1
if n <= 0:
    print(ans)
    exit()
while True:
    if (n - d) == 0:
        break
    else:
        n -= (2*d + 1)
        ans += 1
        if n <= 0:
            break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
inp = "14 3"
n,d = [int(x) for x in inp.split(" ")]
ans = math.ceil(n/(2*d + 1))
print(ans)

Submission status: Wrong Answer

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

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

print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N, D = list(map(int, input().split()))
# 1人の監視員で何個の木を見れるか
tree = D*2 + 1

if N % tree > 0:
  print(N % tree + 1)
else:
  print(N // tree)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
b, c = map(int, input().split())
if b % (2*c + 1) == 0:
  ans = b % (2*c + 1)
else:
  ans = b % (2*c + 1) + 1
# 出力
print(ans)

Submission status: Wrong Answer

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

ans = 0

n -= (d+1)  # 一人目の立つ場所
ans += 1
while True:
    if (n - d) == 0:
        break
    else:
        n -= (2*d + 1)
        ans += 1
        if n <= 0:
            break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


preans = N/(2*D + 1)

print(preans)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ' 'dで区切ってprintする方法
# print(*a, sep=' ')

import math

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

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

Submission status: Wrong Answer

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

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


preans = N/(2*D + 1)

#print(preans)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(n // d + 1)

Submission status: Wrong Answer

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

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


preans = N/(2*D + 1)

print(preans)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = 0

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

print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

Solution code:
from math import ceil

n, d = map(int, input().split())
temp = 2 * d + 1

print(ceil(n // temp))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ret=round(N / (2*D+1) +0.5)
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
b, c = map(int, input().split())
ans = b // (2*c + 1) + 1
# 出力
print(ans)

Submission status: Wrong Answer

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