TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

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

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import math

N, D = input().split()

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

check = 2 * d + 1

print(math.ceil(d/check))


import math

N, D = input().split()

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

check = 2 * d + 1

print(math.ceil(n/check))


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n,d = map(int, input().split())
ans = 0
if n % (2d+1) == 0:
  ans = n//(2d+1)
else:
  ans = n//(2d+1) + 1

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, d = map(int, input())
print(n//(2*d+1)+(1 if n%(2*d+1)!=0 else 0))

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n,d  = list(map(int,input().split()))
print(n//(d+d+1))

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


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

ans = 0
cnt = 0
while ans < n:
    ans += d*2+1
    cnt += 1

print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N, D = map(int, input().split())
 
result = -(-N // (2D+1))
 
print(result)

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

result = N // (2D+1) + 1

print(result)

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N,D=map(int,input().split())
print((N+2*D)%(2*D+1))


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


Verdicts: Wrong Answer

Accepted
Problem: 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.

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


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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

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)



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

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




Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import math
n,d = map(int,input().split())
print(math.ceil(n / (2d+1)) )

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



Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

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

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

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n, d = map(int, input().split())

c = 0

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

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

c = 0

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

import math

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, d = list(map(int, input().split()))
print(n / (2 * d + 1))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n,d = map(int, input().split())
print int((n+(d*2+1)-1)/(d*2+1))

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N,D=map(int,input().split())

z=2*D+1
while N>z:
  z=z+1

print(z)

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

n=1
while N>2*n+1:
  n=n+1

print(n)

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

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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
d=int(input())

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

n,d=list(map(int, input().split()))
 
d1=d*2+1
print(int((n+d1-1)/d1))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N,D=map(int,input().split())
res = 0
for i in range(D,N,2*D):
  res += 1
  if i+D < N and i + 2*D > N:
    res+=1
print(res)

N,D=map(int,input().split())
a = 0
block = 2*D+1
a = N /block
b = int(a)
if a-b > 0:
  a = a+1
print(int(a))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n,d=map(int,inout().split())
a=2*d+1
print((n//a)+1)

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



Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import math
n, d = map(int, input().split())
x = 2*n + 1
print(int(math.ceil(n/x))

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b = list(map(int,input().split()))
ans = -(a // (b*2 + 1))
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

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


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

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

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, d = int(input().split())

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#!/usr/bin/env python3

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


#!/usr/bin/env python3


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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)))

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))+1)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n,d=map(int,input().split())
w=2*d+1
a=n/d
if a%1==0:
  print(n//d)
else:
  print(n//d+1)


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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n,d = list(map(int, input().split()))
print((n / (2*d+1)) + 1)


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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
#!/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)


#!/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)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import math

N, D = map(float,input().split())
d = 2 * D + 1

n = math.ceil(N / D)
print(n)

import math

N, D = map(float,input().split())
d = 2 * D + 1

n = math.ceil(N / d)
print(n)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
D = int(input())

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

N = int(input())
D = int(input())

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

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)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#coding:utf-8
n, d = map(int, input().split())

flag = [0] * n
people = 0


for i in range(0,2*d):
    flag[i] = 1

if sum(flag) != n:
    people += 1

for i in range(n-2*d-1, n):
    flag[i] = 1

if sum(flag) != n:
    people += 1

#print(flag)

for i in range(2*d, n-2*d):
    if flag[i] == 0:
        people += 1
        #print(i)
        for j in range(i, i+d+1):
            if j > n-d:
                break 
            else:
                flag[j] = 1
        #print(flag)


#print(flag)
print(people)


#coding:utf-8
n, d = map(int, input().split())

flag = [0] * n
people = 1


for i in range(0,2*d):
    flag[i] = 1


for i in range(n-2*d-1, n):
    flag[i] = 1

if sum(flag) != n:
    people += 1

#print(flag)

for i in range(2*d, n-2*d):
    if flag[i] == 0:
        people += 1
        #print(i)
        for j in range(i, i+d+1):
            if j > n-d:
                break 
            else:
                flag[j] = 1
        #print(flag)


#print(flag)
print(people)


#coding:utf-8
n, d = map(int, input().split())

flag = [0] * n
people = 0

for i in range(0,d):
    flag[i] = 1

for i in range(n-d, n):
    flag[i] = 1

#print(flag)

for i in range(d, n):
    if flag[i] == 0:
        people += 1
        #print(i)
        for j in range(i, i+d+1):
            if j > n-d:
                break 
            else:
                flag[j] = 1
        #print(flag)


#print(flag)
print(people)


#coding:utf-8
n, d = map(int, input().split())



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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

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

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
N,D = map(int,input().split)
print(N/(D*2+1))

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input())
print(0--a//b)

a,b=map(int,input().split(' '))
print(-(-a//(1+2*b)))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, d = input().split()
n=int(n)
d=int(d)
sum=0
count=0
while 1:
  sum=sum+2*d+1
  count+=1
    break
print(count)

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)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import math
def q45(n, d):
    a = math.ceil(n/(2*d+1))
    return a

N = int(input())
D = int(input())
print(q45(N, D))

import math
def q45(n, d):
    a = math.ceil(n/(2*d+1))
    return a

N = int(input())
D = int(input())
print(q45(N, D))

import math
def q45(n, d):
    a = math.ceil(n/(2*d+1))
    return a

N, D= [int(i) for i in input().split()]
print(q45(N, D))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n,d = map(int,input().split())
c = d*2+1
if n%c ==0:
    print((int(n//c)))
else:
    print(int(n//d)+1)

a.b = map(int.input().split())
c = a/2/b
d = round(c)
print(d)

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


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

a.b = map(int.input().split())
c = (a/2/b)
d =count(c)
print(d)

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

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, d = mpa(int, input().split())
k = d * 2 + 1
if n % k == 0:
    print(n//k)
else:
    print(n//k + 1)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, d = map(int, input().split())
min = (n+((2*d+1)-n%(2*d+1)))/(2*d+1)
print(min)


n, d = map(int, input().split())
min = (n+n%(2*d))/2*d
print(min)



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


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


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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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.

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N , D = map(int, input().split())

d = 2*D + 1
num = int(N / d)

if (N % d == 0):
  num += 1
  
print(num)

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N, D = map(int, input().split())
print(math.ceil(N/(2*D+1)))


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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# coding: utf-8
# submission # - User: herp_sy


import math
import statistics

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

# coding: utf-8
# submission # - User: herp_sy


import math
import statistics

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np
n, d = list(map(int, input().split()))
print(np.ceil(n/d*2+1))

import numpy as np
n, d = list(map(int, input().split()))
print(int(np.ceil(n/(d*2+1))))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())
r=a//(2*b+1)
r+=1 if a%(2*b+1)>0
print(r)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
D = int(input())
if N % (2*D+1) == 0:
    print(N // (2*D+1))
else:
    print(N// (2*D+1) + 1)

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import math
N, D = map(int, input().split())
math.ceil(N/(D*2+1))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n, d = map(int, input())
print(-(-n // (1 + d * 2)))


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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b=map(int,input().split())
b=b*2+1
c=0
c=a/b
if c>b:
  print(c+1)
else:
  print(c)

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

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

a,b=map(int,input().split())
d=b*2+1

c=a/d
if c>b:
  print(int(c)+1)
else:
  print(int(c))

a,b=map(int,input().split())
d=b*2+1

c=a/d
if c>b:
  print(c+1)
else:
  print(c)

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

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

d=b*2+1

c=a/d

if c>int(c):
  print(int(c)+1)
else:
  print(int(c))


Verdicts: Wrong Answer

Wrong Answer

Time Limit Exceeded

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N, D = map(int, input().split())
X = D * 2 + 1
print(N//X)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
lst = int(input().split())
print((lst[0]+2*lst[1])//(2*lst[1]+1))

lst = list(map(int,input().split()))
print((lst[0]+2*lst[1])//(2*lst[1]+1))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n,d=map(int,input().split())
print(ceil(n/(2*d+1)))


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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, d = input().split(" ")
n = int(n)
d = int(d)
print(n / (2*d+1) + int(n % (2*d+1) != 0))

string = input()
n, d = string.split(" ")
n = int(n)
d = int(d)
print(n // (2*d+1) + int(n % (2*d+1) != 0))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
N,D = map(int, input().split())
print(math.ceil(N/(2*(1+D))))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a,b=input().split()
a=int(a)
b=int(b)
if a%(b*2+1)==0:
  print(a//(b*2+1))
else:
  print(a//(b*2))

a,b=input().split()
a=int(a)
b=int(b)
print(a//(b*2+1))

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
N, D=map(int, input().split())
print(math.ceil(N/(2*D+1))

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

Verdicts: Runtime Error

Accepted