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())
t = 2d + 1
     
if n % t == 0:
	ans = n/t
else:
	ans = n/t
    ans = ans + 1

print(ans)

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

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

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

print(ans)

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

ans = int(ans)
print(ans)

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


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

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

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):
l=list(map(int,input().rstrip().split()))
a=l[0]
b=l[1]
c=(2*b)+1
u=int(a/c)
if(a%c==0):
  print(u)
else():
  print(u+1)

l=list(map(int,input().rstrip().split()))
a=l[0]
b=l[1]
c=(2*b)+1
u=int(a/c)
if(a%c==0):
  print(u)
else:
  print(u+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())
a = d*2+1
ans = 0
while d*ans < n:
  ans += 1
print(ans)

n, d = map(int, input().split())
a = d*2+1
ans = 0
while a*ans < n:
  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
def func():
    num_apple, index = input('').rstrip().split(' ')
    return math.ceil(int(num_apple) / (2*int(index) + 2))

if __name__ == '__main__':
    print(func())

import math
def func():
    num_apple, index = input('').rstrip().split(' ')
    return math.ceil(int(num_apple) / (2*int(index) + 1))

if __name__ == '__main__':
    print(func())

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

S = input()

S = S.split()

N = int(S[0])
D = int(S[1])

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

import math

S = input()

S = S.split()

N = int(S[0])
D = int(S[1])

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())
a = 0
if n % d != 0:
  a = 1
print(n / d + a)

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

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

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

Verdicts: 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):
def main():
    N,D = map(int,input().split())
    if (N//(2*D+1))%1==0:
        print(N//(2*D+1))
    else:
        print(N//(2*D+1)+1)
    
if __name__=="__main__":
    main()

def main():
    import math

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

    
if __name__=="__main__":
    main()

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


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

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


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

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(int(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 = int(input())
d = int(input())
s = 0
q = 0
while s < n:
    s += (d * 2 + 1)
    q += 1

print(q)

m = input()
m = m.split(' ')
n = int(m[0])
d = int(m[1])
s = 0
q = 0
while s < n:
    s += (d * 2 + 1)
    q += 1

print(q)

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())
count = 0

for i in range(n):
    if n >= 2*d+1:
        count += 1
        n = n - (2*d+1)
print(n)
if n != 0:
    count += 1
print(count)


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):
import sys
input = sys.stdin.readline
import math
def print_ans(N, D):
    """Test Case
    >>> print_ans(6, 2)
    2
    >>> print_ans(14, 3)
    2
    >>> print_ans(20, 4)
    3
    """
    print(math.ceil(N / (D * 2 + 1)))
    

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


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

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


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 = int(input().split())
if a % b == 0:
  print(a//b)
else:
  print(a//b+1)

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


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


Verdicts: Runtime Error

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 = list(map(int, input().split()))
print(math.ceil(N/D))

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

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


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(-(-(n-d)/(d+1)))

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

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

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

print(-(-n//(2*d+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=int(input().split())

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

import math

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


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

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

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

print(ans)

import math
ns, ds = input().split()
n, d = int(ns), int(ds)

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

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

N,D = map(int(input().split()))
sum = 1
cnt = 0
while sum > N:
  sum += 2D
  cnt += 1

print(cnt)

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

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

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

N,D = map(int,input().split())
S = 0
cnt = 0
while S < N:
  S += 1+2*D
  cnt +=1
print(cnt)

Verdicts: Wrong Answer

Runtime Error

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

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

n,d= int(input())

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


import numpy as np

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

print(int(np.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())
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: 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/d))

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/(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())
print(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())
print(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().split())
if n%2*2==0:
    print(n//2*d)
else:
    print(n//2*d+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: 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):
try:
    temp = input().split()
    N=int(temp[0])
    print(N)
    D=int(temp[1])
    print(D)
    can_read=2*D+1
    cnt=0
    while(N>0):
        N=N-can_read
        cnt=cnt+1
    print(cnt)
except ValueError:
    print("input miss")

try:
    temp = input().split()
    N=int(temp[0])
    D=int(temp[1])
    can_read=2*D+1
    cnt=0
    while(N>=0):
        N=N-can_read
        cnt=cnt+1
    print(cnt-1)
except ValueError:
    print("input miss")

try:
    temp = input().split()
    N=int(temp[0])
    D=int(temp[1])
    can_read=2*D+1
    cnt=0
    while(N>=0):
        N=N-can_read
        cnt=cnt+1
    print(cnt-1)
except ValueError:
    print("input miss")

try:
    temp = input().split()
    N=int(temp[0])
    print(N)
    D=int(temp[1])
    print(D)
    can_read=2*D+1
    cnt=0
    while(N>0):
        N=N-can_read
        cnt=cnt+1
    print(cnt)
except ValueError:
    print("input miss")

temp = input().split()
N=int(temp[0])
print(N)
D=int(temp[1])
print(D)
can_read=2*D+1
cnt=0
while(N>0):
    N=N-can_read
    cnt=cnt+1
print(cnt)

temp = input().split()
N=int(temp[0])
D=int(temp[1])
can_read=2*D+1
cnt=0
while(N>0):
    N=N-can_read
    cnt=cnt+1
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

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

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

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


n,d = [int(i) for i in input().split()]
a = 2*d+1
print((d+d-1)//d)

n,d = [int(i) for i in input().split()]
a = 2*d+1
print((n+a-1)//a)


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

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

import math

l=list(map(int,input().split()))
n=l[0]
d=l[1]
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):
i1 = list(map(int, f.input().split()))

o1 = ((i1[0]) // (i1[1]*2 + 1))
o2 = ((i1[0]) % (i1[1]*2 + 1))
if o2 == 0:
    print(o1)
else:
    print(o1 + 1)

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

o1 = ((i1[0]) // (i1[1]*2 + 1))
o2 = ((i1[0]) % (i1[1]*2 + 1))
if o2 == 0:
    print(o1)
else:
    print(o1 + 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/(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):
a, b = map(int, input().split())

q, mod = divmod(a, 2*b+1)

print(a) if mod == 0 else a+1

a, b = map(int, input().split())
 
q, mod = divmod(a, 2*b+1)
 
print(q) if mod == 0 else print(q+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 = int(input())

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

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

print(-(-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())
print(round(N / (D * 2 + 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().split())
m=(N-1)//(2D+1)
n=m+1
print(n)

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

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

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

print(N)
print(D)

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

import math

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

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

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

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

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

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

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

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

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

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

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

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

while True:
    a = n- i*(2*d+1)
    if a<=0:
        print(i)
        break


n,d = map(int, input().split())
a = 0
ct=0

for i in range(n):
    a = n- i*(2*d+1)
    ct +=1
    if a<=0:
        break

print(ct)


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

while True:
    a = n- i*(2*d+1)
    if a<=0:
        print(i)
        break
    else:
        continue


n,d = map(int, input().split())
a = 0
ct=0

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


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


import math
N,D = map(int,input().split())
print(math.floor(N/(2D)))


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


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

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


Verdicts: Runtime Error

Runtime Error

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 = (int(i) for i in input().split())

d = d*2 +1
d = d*2
q = n//d
mod = n % d
ans = q
if mod != 0:
    ans += 1

print(ans)

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

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

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)

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

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

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


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


Verdicts: Wrong Answer

Accepted