ZhenlongDai/ACPR huggingface dataset:
Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
lis = [s]

while len(lis) == len(set(lis)):
  if s % 2 == 0:
    lis.append(s / 2)
  else:
    lis.append(3 * s + 1)
    
print(len(lis))

Failing test case input:
246

Expected output:
49


Actual output:
3


Fixed submission (verdict: Accepted):
s = int(input())
lis = [s]
 
while len(lis) == len(set(lis)):
  if lis[-1] % 2 == 0:
    lis.append(lis[-1] / 2)
  else:
    lis.append(3 * lis[-1] + 1)
    
print(len(lis))

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
a = [s]
ans = -1
for i in range(1000000):
    if ans != -1:
        if a[-1] % 2 == 0:
            a.append(a[-1]/2)
        else:
            a.append(3*a[-1]+1)    

        for j in range(len(a)-1):
            if a[-1] == a[j]:
                ans = len(a)
                break
    else:
        print(ans)
        break

Failing test case input:
601

Expected output:
58


Actual output:
-1


Fixed submission (verdict: Accepted):
s = int(input())
a = [s]
ans = -1
for i in range(1000000):
    if ans == -1:
        if a[-1] % 2 == 0:
            a.append(a[-1]/2)
        else:
            a.append(3*a[-1]+1)    

        for j in range(len(a)-1):
            if a[-1] == a[j]:
                ans = len(a)
                break
    else:
        print(ans)
        break

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=int(input())
v_to_i = {}
cnt = 1
while 1:
    s = s 
    cnt += 1
    if s in v_to_i:
        break
    v_to_i[s] = cnt

print(cnt)


Failing test case input:
235

Expected output:
129


Actual output:
3


Fixed submission (verdict: Accepted):
s=int(input())
v_to_i = {}
cnt = 1
while not s in v_to_i:
    v_to_i[s] = cnt
    s = (s 
    cnt += 1



print(cnt)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def f(num):
  if num % 2 == 0:
    return int(num / 2)
  else:
    return num * 3 + 1

s = int(input())
a = [s]
ans = 0
for i in range(1, 1000000):
  ai = f(a[i - 1])
  if a.count(ai) == 1:
    ans = a.index(ai)
    break
  a.append(ai)
print(ans)

Failing test case input:
643

Expected output:
27


Actual output:
23


Fixed submission (verdict: Accepted):
def f(num):
  if num % 2 == 0:
    return int(num / 2)
  else:
    return num * 3 + 1

s = int(input())
a = [s]
ans = 0
for i in range(1, 1000000):
  ai = f(a[i - 1])
  if a.count(ai) == 1:
    ans = i + 1
    break
  a.append(ai)
print(ans)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
ans = 1
for i in range(10**6):
    ans += 1
    if s%2==0:
        s = s/2
    else:
        s = 3*s+1
        
    if s == 1:
        break
if s==1 or s==2:
    print(ans)
else:
    print(ans+1)

Failing test case input:
121

Expected output:
97


Actual output:
96


Fixed submission (verdict: Accepted):
s = int(input())
ans = 1
l = []
for i in range(10**6):
    ans += 1
    l.append(s)
    
    if s%2==0:
        s = s/2
    else:
        s = 3*s+1
    
    if s in l:
        break
        
print(ans)
Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())

a = []
i = 1
while s not in a:
    a.append(s)
    if s%2 == 1:
        s=3*s+1
    else:
        s=s/2
    i+=1
    if i >= 10:
        break

print(i)

Failing test case input:
178

Expected output:
33


Actual output:
10


Fixed submission (verdict: Accepted):
s = int(input())

a = []
i = 1
while s not in a:
    a.append(s)
    if s%2 == 1:
        s=3*s+1
    else:
        s=s/2
    i+=1

print(i)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
a_list = [s]
INF = 10 ** 5
for i in range(INF):
    value = a_list[-1]
    if value % 2 == 0:
        next_value = value / 2
        if next_value in a_list:
            print(a_list)
            print(i + 2)
            break
        else:
            a_list.append(int(next_value))
    else:
        next_value = (3 * value) + 1
        if next_value in a_list:
            print(a_list)
            print(i + 2)
            break
        else:
            a_list.append(int(next_value))

Failing test case input:
146

Expected output:
118


Actual output:
[146, 73, 220, 110, 55, 166, 83, 250, 125, 376, 188, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1]
118


Fixed submission (verdict: Accepted):
s = int(input())
a_list = [s]
INF = 10 ** 5
for i in range(INF):
    value = a_list[-1]
    if value % 2 == 0:
        next_value = value / 2
        if next_value in a_list:
            print(i + 2)
            break
        else:
            a_list.append(int(next_value))
    else:
        next_value = (3 * value) + 1
        if next_value in a_list:
            print(i + 2)
            break
        else:
            a_list.append(int(next_value))

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
def f(n):
  if n%2 == 0:
    return n/2
  else:
    return 3*n+1
a = []
a.append(s)
for i in range(1,1000001):
  if f(a[i-1]) in a:
    print(i)
    break
  else:
    a.append(f(a[i-1]))
  

Failing test case input:
206

Expected output:
90


Actual output:
89


Fixed submission (verdict: Accepted):
s = int(input())
def f(n):
  if n%2 == 0:
    return n/2
  else:
    return 3*n+1
a = []
a.append(s)
for i in range(1,1000001):
  if f(a[i-1]) in a:
    print(i+1)
    break
  else:
    a.append(f(a[i-1]))
Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
cou = 1
tmp = 0
flag = 0
List = []
while(flag == 0):
  if(cou == 1):
    if(s % 2 == 0):
      tmp = s / 2
      List.append(tmp)
    else:
      tmp = 3 * s + 1
      List.append(tmp)
    cou += 1
  else:
    if(List.count(tmp) == 2):
      print(str(cou))
      break
    if(tmp % 2 == 0):
      tmp = tmp / 2
      List.append(tmp)
    else:
      tmp = 3 * tmp + 1
      List.append(tmp)
    cou += 1
    cou += 1

Failing test case input:
156

Expected output:
38


Actual output:
74


Fixed submission (verdict: Accepted):
s = int(input())
cou = 1
tmp = 0
flag = 0
List = [s]
while(flag == 0):
  if(cou == 1):
    if(s % 2 == 0):
      tmp = s / 2
      List.append(tmp)
    else:
      tmp = 3 * s + 1
      List.append(tmp)
    cou += 1
  else:
    if(List.count(tmp) == 2):
      print(str(cou))
      break
    if(tmp % 2 == 0):
      tmp = tmp / 2
      List.append(tmp)
    else:
      tmp = 3 * tmp + 1
      List.append(tmp)
    cou += 1

Problem: p03146
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=int(input())
a=[]
na=[]
a.append(s)
for i in range(1,10**6):
    if a[i-1]%2==0:
        a.append(a[i-1]/2)
    else:
        a.append(a[i-1]*3+1)
    na=set(a)
    if len(na)!=i+1:
        print(a[i])
        exit()

Failing test case input:
108

Expected output:
115


Actual output:
4.0


Fixed submission (verdict: Accepted):
s=int(input())
a=[]
na=[]
a.append(s)
for i in range(1,10**6):
    if a[i-1]%2==0:
        a.append(a[i-1]/2)
    else:
        a.append(a[i-1]*3+1)
    na=set(a)
    if len(na)!=i+1:
        print(i+1)
        exit()

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
a = [s]

counter = 2
while True:
    if a[-1] % 2 == 0:
        temp = int(a[-1] / 2)
    else:
        temp = int(3 * a[-1] + 1)
        
    print(temp)
    
    if temp in a:
        break
        
    counter += 1
    a.append(temp)
    
print(counter)

Failing test case input:
292

Expected output:
119


Actual output:
146
73
220
110
55
166
83
250
125
376
188
94
47
142
71
214
107
322
161
484
242
121
364
182
91
274
137
412
206
103
310
155
466
233
700
350
175
526
263
790
395
1186
593
1780
890
445
1336
668
334
167
502
251
754
377
1132
566
283
850
425
1276
638
319
958
479
1438
719
2158
1079
3238
1619
4858
2429
7288
3644
1822
911
2734
1367
4102
2051
6154
3077
9232
4616
2308
1154
577
1732
866
433
1300
650
325
976
488
244
122
61
184
92
46
23
70
35
106
53
160
80
40
20
10
5
16
8
4
2
1
4
119


Fixed submission (verdict: Accepted):
s = int(input())
a = [s]

counter = 2
while True:
    if a[-1] % 2 == 0:
        temp = int(a[-1] / 2)
    else:
        temp = int(3 * a[-1] + 1)
    
    if temp in a:
        break
        
    counter += 1
    a.append(temp)
    
print(counter)
Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
s_ = s
x = []
counter = 0


for _ in range(1000000):
  if s%2 ==0:
    s = s/2
    x.append(s)
  else:
      s = 3*s+1
      x.append(s)


if s_ == 4 or s_ == 2 or s_ == 1:
  print(4)
else:
  print(x.index(4)+3)


Failing test case input:
447

Expected output:
99


Actual output:
97


Fixed submission (verdict: Accepted):
s = int(input())
s_ = s
x = [s]
counter = 0


for _ in range(1000000):
  if s%2 ==0:
    s = s/2
    x.append(s)
  else:
      s = 3*s+1
      x.append(s)


if s_ == 4 or s_ == 2 or s_ == 1:
  print(4)
else:
  print(x.index(4)+4)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
x = set()
cnt = 1

while True:
    
    cnt += 1
    
    if n%2 == 0:
        n 
        
    else:
        n = n * 3 + 1

    if n in x:
        print(cnt)
        exit()
    else:
        x.add(n)

Failing test case input:
297

Expected output:
75


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
x = set()
cnt = 1
x.add(n)

while True:
    
    cnt += 1
    
    if n%2 == 0:
        n /=2
        
    else:
        n = n * 3 + 1

    if n in x:
        print(cnt)
        break
    else:
        x.add(n)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=int(input())
list=[s]
num=2
while num<=1000000:
  if num%2==0:
    list.append(list[num-2]/2)
    if list[num-2]/2 in list:
      break
    num+=1
  else:
    list.append(3*list[num-2]+1)
    if 3*list[num-2]+1 in list:
      break
    num+=1
print(num)

Failing test case input:
588

Expected output:
120


Actual output:
2


Fixed submission (verdict: Accepted):
s=int(input())
list=[s]
num=2
while num<=1000000:
  if list[num-2]%2==0:
    list.append(list[num-2]/2)
  else:
    list.append(list[num-2]*3+1)
  if list[num-1] in list[:num-1]:
    break
  num+=1
print(num)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
array = [s]
 
m = 2
while m < 100000:
  if (s % 2 == 0):
    s = s / 2
  else:
    s = 3 * s + 1
  
  if s in array:
    print(m)
    break
  else:
    array.append(m)
    m += 1

Failing test case input:
143

Expected output:
105


Actual output:
85


Fixed submission (verdict: Accepted):
s = int(input())
array = [s]
 
m = 2
while m < 100000:
  if (s % 2 == 0):
    s = s / 2
  else:
    s = 3 * s + 1
  
  if s in array:
    print(m)
    break
  else:
    array.append(s)
    m += 1
Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
colatz=[1,2,4]
colatz.append(int(input()))
if colatz[3]==1 or 2 or 4:
    print(4)
else:
    b=3
    while colatz[b]!=4:
        if colatz[b]%2==0:
            colatz.append(colatz[b]/2)
        else: colatz.append(3*colatz[b]+1)
        b=b+1
    print(b+1)

Failing test case input:
295

Expected output:
57


Actual output:
4


Fixed submission (verdict: Accepted):
colatz=[1,2,4]
colatz.append(int(input()))
if colatz[3]==1 or colatz[3]==2 or colatz[3]==4:
    print(4)
else:
    b=3
    while colatz[b]!=4:
        if colatz[b]%2==0:
            colatz.append(colatz[b]/2)
        else: colatz.append(3*colatz[b]+1)
        b=b+1
    print(b+1)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def next_num(n):
  if n%2:
    return n/2
  else:
    return 3*n+1

s = int(input())

n = s
for i in range(1000000):
  if n == 4:
    print(i+4)
    break
  n = next_num(n)


Failing test case input:
292

Expected output:
119


Actual output:

Fixed submission (verdict: Accepted):
def next_num(n):
  if n%2:
    return 3*n+1
  else:
    return n/2

s = int(input())

n = s
for i in range(1000000):
  if n in [1,2,4]:
    print(i+4)
    break
  n = next_num(n)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=[int(input())]
i=0
while True:
  i+=1
  if a[-1]%2==1:
    if a[-1]*3+1 in a:
      break
    a.append(a[-1]*3+1)
  else:
    if a[-1]/2 in a:
      break
    a.append(a[-1]/2)
print(i)

Failing test case input:
103

Expected output:
89


Actual output:
88


Fixed submission (verdict: Accepted):
a=[int(input())]
i=1
while True:
  i+=1
  if a[-1]%2==1:
    if a[-1]*3+1 in a:
      break
    a.append(a[-1]*3+1)
  else:
    if a[-1]/2 in a:
      break
    a.append(a[-1]/2)
print(i)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
i = int(input())
seen = set()
seen.add(i)
temp = i
for x in range(2,1000000):
    if(temp%2 == 0):
        temp = temp/2
    else:
        temp = 3*temp+1
    if(temp in seen):
        print("out:{}".format(x))
        break
    else:
        seen.add(temp)


Failing test case input:
295

Expected output:
57


Actual output:
out:57


Fixed submission (verdict: Accepted):
i = int(input())
seen = set()
seen.add(i)
temp = i
for x in range(2,1000000):
    if(temp%2 == 0):
        temp = temp/2
    else:
        temp = 3*temp+1
    if(temp in seen):
        print(x)
        break
    else:
        seen.add(temp)
Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = int(input())
a = [s]

counter = 2
while True:
    if a[-1] % 2 == 0:
        temp = int(3 * a[-1] + 1)
    else:
        temp = int(a[-1] / 2)
        
    print(temp)
    
    if temp in a:
        break
        
    counter += 1
    a.append(temp)
    
print(counter)

Failing test case input:
297

Expected output:
75


Actual output:
148
445
222
667
333
166
499
249
124
373
186
559
279
139
69
34
103
51
25
12
37
18
55
27
13
6
19
9
4
13
31


Fixed submission (verdict: Accepted):
s = int(input())
a = [s]

counter = 2
while True:
    if a[-1] % 2 == 0:
        temp = int(a[-1] / 2)
    else:
        temp = int(3 * a[-1] + 1)
    
    if temp in a:
        break
        
    counter += 1
    a.append(temp)
    
print(counter)

Problem: p03146
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
colatz=[1,2,4]
colatz.append(int(input()))
b=3
while colatz[b]!=colatz[b-3]:
    if colatz[b]%2==0:
        colatz.append(colatz[b]/2)
    else: colatz.append(3*colatz[b]+1)
    b=b+1
print(b)

Failing test case input:
211

Expected output:
41


Actual output:
43


Fixed submission (verdict: Accepted):
colatz=[1,2,4]
colatz.append(int(input()))
if colatz[3]==1 or colatz[3]==2 or colatz[3]==4:
    print(4)
else:
    b=3
    while colatz[b]!=4:
        if colatz[b]%2==0:
            colatz.append(colatz[b]/2)
        else: colatz.append(3*colatz[b]+1)
        b=b+1
    print(b+1)
Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n , d = map ( int,input().split())
s = d * 2 + 1
ans = max(1,round(n / s + 0.5))
print(ans)

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
import math
n , d = map ( int,input().split())
s = d * 2 + 1
ans = max(1,math.ceil(n / s ))
print(ans)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x, y = map(int, input().split())
print(int(x/(y*2+1)+1))


Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
import math

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, D = map(int,input().split())
ans = 0
count = 0
while(count>=N):
    count += 2*D + 1
    ans += 1
print(ans)

Failing test case input:
20 14

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N, D = map(int,input().split())
ans = 0
count = 0
while(count < N):
    count += 2*D + 1
    ans += 1
print(ans)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, D = map(int, input().split())
result = 1
rang = D*2+1
while rang < N:
    result += 1
    rang *= 2 

print(result)

Failing test case input:
57 0

Expected output:
57


Actual output:
7


Fixed submission (verdict: Accepted):
N, D = map(int, input().split())
result = 1
rang = D*2+1

while rang < N:
    result += 1
    rang += D*2+1 

print(result)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, D = map(int, input().split())
d = []
i = 1
while len(d) <= N:
    d += [i]*(D*2+1)
    i += 1
print(len(set(d)))

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
N, D = map(int, input().split())
d = []
i = 1
while len(d) <= N:
    d += [i]*(D*2+1)
    i += 1
print(len(set(d[:N])))

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

    
if __name__=='__main__':
    main()


Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):


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

    
if __name__=='__main__':
    main()

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

count = 0
ans = 1
for i in range(N):
    count += 1

    if count == D*2 + 2:
        ans += 1
        count = 0

print(ans)




Failing test case input:
57 0

Expected output:
57


Actual output:
29


Fixed submission (verdict: Accepted):


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

count = 0
ans = 1
for i in range(N):
    count += 1

    if count == D*2 + 2:
        ans += 1
        count = 1

print(ans)
Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d = (int(i) for i in input().split())

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

print(ans)

Failing test case input:
20 14

Expected output:
1


Actual output:
21


Fixed submission (verdict: Accepted):
n,d = (int(i) for i in input().split())

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

print(ans)

Problem: p02970
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,d=map(int,input().split())
for i in range(n):
    if (2*d+1)*i>=n:
        print(i)
        break

Failing test case input:
57 0

Expected output:
57


Actual output:

Fixed submission (verdict: Accepted):
n,d=map(int,input().split())
for i in range(n+1):
    if (2*d+1)*i>=n:
        print(i)
        break

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, D  = map(int, input().split())
print(int(N/(2*D+1)+0.9))

Failing test case input:
2 62

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N, D  = map(int, input().split())
print(-(- N

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D=map(int,input().split())
print((N+2*D)%(2*D+1))


Failing test case input:
57 0

Expected output:
57


Actual output:
0


Fixed submission (verdict: Accepted):
N,D=map(int,input().split())
print((N+2*D)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d = map(int,input().split())
ans = 1
while True:
    if ans*(2*d+1) > n:
        break
    else:
        ans += 1
print(ans)

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
n,d = map(int,input().split())
ans = 1
while True:
    if ans*(2*d+1) >= n:
        break
    else:
        ans += 1
print(ans)

Problem: p02970
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math
a,b=map(int,input().split())
print(math.ceil(a/(2*b-1)))

Failing test case input:
57 0

Expected output:
57


Actual output:
-57


Fixed submission (verdict: Accepted):
import math
a,b=map(int,input().split())
print(math.ceil(a/(2*b+1)))

Problem: p02970
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
N,D = map(int,input().split())
print(math.ceil(D/(N*2+1)))

Failing test case input:
57 0

Expected output:
57


Actual output:
0


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



import math

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

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


Failing test case input:
57 0

Expected output:
57


Actual output:

Fixed submission (verdict: Accepted):



import math

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

for i in range(1,10*n):
    if (1+2*d)*i >= n:
        print(i)
        break
Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n ,d = map(int, input().split())
count = 0
count2 = 0

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

if count2 > d:
  count += 1

print(count)

Failing test case input:
2 62

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n ,d = map(int, input().split())
count = 0
count2 = 0

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

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

print(count)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, d = [int(x) for x in input().split()]

r = (d * 2) + 1

for i in range(n):
    if r * i >= n:
        print(i)
        break

Failing test case input:
57 0

Expected output:
57


Actual output:

Fixed submission (verdict: Accepted):
n, d = [int(x) for x in input().split()]

r = (d * 2) + 1

if n % r != 0:
    print(n 
else:
    print(n

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N,D = map(int, input().split())
print(math.ceil(N/(2*(1+D))))

Failing test case input:
57 0

Expected output:
57


Actual output:
29


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

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

Failing test case input:
2 62

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):

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

q, mod = divmod(N, 2*D+1)
if mod >= 1:
  print(q+1)
else:
  print(q)

Problem: p02970
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, D = map(int, input().split())

import math
print(math.ceil(N / (D + 2)))


Failing test case input:
36 28

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N, D = map(int, input().split())

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, D = map(int, input().split())

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

if left <= N: res += 1

print(res)

Failing test case input:
57 0

Expected output:
57


Actual output:
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 20
21 21
22 22
23 23
24 24
25 25
26 26
27 27
28 28
29 29
30 30
31 31
32 32
33 33
34 34
35 35
36 36
37 37
38 38
39 39
40 40
41 41
42 42
43 43
44 44
45 45
46 46
47 47
48 48
49 49
50 50
51 51
52 52
53 53
54 54
55 55
56 56
57 57
57


Fixed submission (verdict: Accepted):
N, D = map(int, input().split())

i = 1
left = 1
res = 0
while i <= N:
    if i - D == left:
        left = i + D + 1
        res += 1
    i += 1

if left <= N: res += 1

print(res)
Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D = map(int,input().split())
s = 0
cnt = 0
while s > N:
  s += 1
  s += 2*D
  cnt += 1  
print(cnt)

Failing test case input:
36 28

Expected output:
1


Actual output:
0


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N,D=map(int,input().split())
tmp = D *2.0 + 1
print(tmp)
print(math.ceil(N / tmp))

Failing test case input:
20 14

Expected output:
1


Actual output:
29.0
1


Fixed submission (verdict: Accepted):
import math
N,D=map(int,input().split())
tmp = D *2.0 + 1
print(int(math.ceil(N / tmp)))

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
inp = "14 3"
n,d = [int(x) for x in inp.split(" ")]
ans = math.ceil(n/(2*d + 1))
print(ans)

Failing test case input:
57 0

Expected output:
57


Actual output:
2


Fixed submission (verdict: Accepted):
import math
inp = input()
n,d = [int(x) for x in inp.split(" ")]
ans = math.ceil(n/(2*d + 1))
print(ans)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, d = map(int, input().split())

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

Failing test case input:
20 14

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
import math
n, d = map(int, input().split())

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

Problem: p02970
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
[N,D]=[int(i) for i in input().split()]
a=2*D+1
b=N
print(b)


Failing test case input:
20 14

Expected output:
1


Actual output:
20


Fixed submission (verdict: Accepted):
[N,D]=[int(i) for i in input().split()]
a=(2*D)+1
b=(N

if N%a==0:b-=1
print(b)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d = map(int, input().split())

for i in range(n):
    if n <= (1+d*2)*i:
        print(i)
        exit()

Failing test case input:
57 0

Expected output:
57


Actual output:

Fixed submission (verdict: Accepted):
n,d = map(int, input().split())

for i in range(100):
    if n <= (1+d*2)*i:
        print(i)
        exit()

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, d = map(int, input().split())
ans = 0
tmp = 0
while tmp<=n:
    tmp += d*2+1
    ans += 1
print(ans)

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
n, d = map(int, input().split())
ans = 0
tmp = 0
while tmp<n:
    tmp += d*2+1
    ans += 1
print(ans)
Problem: p02970
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):




def solve():
    N, D = list(map(int, input().split()))
    cover = 2 * D + 1
    return N 


def main():
    print(solve())


if __name__ == "__main__":
    main()


Failing test case input:
20 14

Expected output:
1


Actual output:
20


Fixed submission (verdict: Accepted):


from math import ceil


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


def main():
    print(solve())


if __name__ == "__main__":
    main()

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main11():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    result = int(num[0] / (num[1] * 2 + 1))
    if (num[0] / (num[1] * 2 + 1)) != 0:
        result = result + 1
    print(result)

if __name__ == "__main__":
    main11()

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
def main11():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    result = int(num[0] / (num[1] * 2 + 1))
    if int(num[0] % (num[1] * 2 + 1)) != 0:
        result = result + 1
    print(result)

if __name__ == "__main__":
    main11()

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())

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

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

Failing test case input:
20 14

Expected output:
1


Actual output:

Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
 
q, mod = divmod(a, 2*b+1)
 
print(q) if mod == 0 else print(q+1)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D = map(int, input().split())
s = 1
cnt = 0
while s > N:
  s += 2*D
  cnt += 1
 
print(cnt)

Failing test case input:
20 28

Expected output:
1


Actual output:
0


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d=map(int,input().split())
x=2*d+1
if(n%x!=0):
    print(int(n/x))
else:
    print(int(n/x)+1)




Failing test case input:
2 62

Expected output:
1


Actual output:
0


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
N,D = map(int,input().split())
for i in range(N):
    if (2*D+1)*i >= N:
        print(i)
        exit()
    

Failing test case input:
57 0

Expected output:
57


Actual output:

Fixed submission (verdict: Accepted):
import sys
N,D = map(int,input().split())
for i in range(N+1):
    if (2*D+1)*i >= N:
        print(i)
        exit()

Problem: p02970
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math

n, d = 6, 2

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

Failing test case input:
20 14

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
import math

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

ans = math.ceil(n/(2*d+1))
print(ans)
Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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(ans)


Failing test case input:
57 0

Expected output:
57


Actual output:
57.0


Fixed submission (verdict: Accepted):
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))

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D = [int(i) for i in input().split()]

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




Failing test case input:
57 0

Expected output:
57


Actual output:

Fixed submission (verdict: Accepted):
def main() :
    N,D = [int(i) for i in input().split()]

    
    

    
    
    
    
    

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


main()

Problem: p02970
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n,d = map(int,input().split())
math.ceil(n/(2*d+1))

Failing test case input:
20 28

Expected output:
1


Actual output:

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D=map(int,input().split())
print(N)
print(D)
import math
print(N/(1+2*D))
math.ceil(N/(1+2*D))

Failing test case input:
2 62

Expected output:
1


Actual output:
2
62
0.016


Fixed submission (verdict: Accepted):
N,D=map(int,input().split())

import math

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n,d = map(int, input().split())
print(math.ceil((n/((d+1)*2)) + 1))


Failing test case input:
20 28

Expected output:
1


Actual output:
2


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d= map(int,input().split(" "))
if n%(1+2*d):
    print(n/(1+2*d))
else:
    print(int(n/(1+2*d))+1)

Failing test case input:
20 14

Expected output:
1


Actual output:
0.6896551724137931


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

Problem: p02970
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
input_list = list(map(int,input().split()))
n = input_list[0]
d = input_list[1]
import math
ans = math.ceil(n/(1+2*d))

Failing test case input:
20 14

Expected output:
1


Actual output:

Fixed submission (verdict: Accepted):
input_list = list(map(int,input().split()))
n = input_list[0]
d = input_list[1]
import math
ans = math.ceil(n/(1+2*d))
print(ans)
Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d=map(int,input().split())

d_look = 2 * d + 1

print(int(n/d_look)+1)

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
import math

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

d_look = 2 * d + 1

print(math.ceil(n/d_look))

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if int(a/(2*b+1)):
  print(int(a/(2*b+1))+1)
else:
  print(int(a/(2*b+1)))
  


Failing test case input:
20 14

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if int(a%(2*b+1))!=0:
  print(int(a/(2*b+1))+1)
else:
  print(int(a/(2*b+1)))

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D = map(int, input().split())
count = 0
i = 0
while i < N:
  i += 2*D+1
  count +=1
print(count+1)


Failing test case input:
20 14

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N,D = map(int, input().split())
count = 0
i = 0
while i < N:
  i += 2*D+1
  count +=1
print(count)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, d = list(map(int, input().split()))
print(n / (2 * d + 1))

Failing test case input:
20 28

Expected output:
1


Actual output:
0.3508771929824561


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, d = map(int, input().split())

d = 2 * d + 1
res = n 

print(res)


Failing test case input:
20 28

Expected output:
1


Actual output:
20


Fixed submission (verdict: Accepted):
import math

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

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, d = map(int, input().split())

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

Failing test case input:
57 0

Expected output:
57


Actual output:

Fixed submission (verdict: Accepted):
n, d = map(int, input().split())

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def main():

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

    if N < D:
        N=D

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



if __name__== "__main__":
    main() 


Failing test case input:
57 0

Expected output:
57


Actual output:
15


Fixed submission (verdict: Accepted):

def main():

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

    power = D*2+1

    if N <= power:
        print(1)
        exit()

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



if __name__== "__main__":
    main()
Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d = map(int,input().split())
sum1 = d*2+1
ans = n-sum1
cnt=1
i=0
while ans > 0:
    i+=1
    ans=ans-sum1*i
    cnt+=1
print(cnt)


Failing test case input:
57 0

Expected output:
57


Actual output:
12


Fixed submission (verdict: Accepted):
n,d = map(int,input().split())
sum1 = d*2+1
ans = n-sum1
cnt=1
while ans > 0:
    ans=ans-sum1
    cnt+=1
print(cnt)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math 
N,D=map(int, input().split())

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

Failing test case input:
20 28

Expected output:
1


Actual output:
280


Fixed submission (verdict: Accepted):
import math
N,D=map(int, input().split())

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d=map(int,input().split())
print(int(1+(n/((d*2)+1))))

Failing test case input:
57 0

Expected output:
57


Actual output:
58


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, d = map(int, input().split())

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

Failing test case input:
57 0

Expected output:
57


Actual output:

Fixed submission (verdict: Accepted):
n, d = map(int, input().split())

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

judge = 0
remain = A[0]

for i in range(A[0]):
	remain -= 2*A[1] + i + 1
	if remain <= 0:
		judge = i + 1 
		break
print(judge)

Failing test case input:
57 0

Expected output:
57


Actual output:
11


Fixed submission (verdict: Accepted):

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

judge = 0
remain = A[0]

for i in range(A[0]):
	remain -= 2*A[1] + 1
	if remain <= 0:
		judge = i + 1 
		break
print(judge)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N, D = input().split()

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

check = 2 * d + 1

print(math.ceil(d/check))


Failing test case input:
57 0

Expected output:
57


Actual output:
0


Fixed submission (verdict: Accepted):
import math

N, D = input().split()

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

check = 2 * d + 1

print(math.ceil(n/check))

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D = list(map(int,input().split()))

human = 1
kanshi = 2*D+1

while kanshi < N:
    kanshi = kanshi*2
    human +=1
    
print(human)

Failing test case input:
57 0

Expected output:
57


Actual output:
7


Fixed submission (verdict: Accepted):
N,D = list(map(int,input().split()))
human = 1
hani = 2*D+1
while hani < N:
    hani = hani + (2*D+1)
    human +=1
    
print(human)
Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n ,d = map(int, input().split())
count = 0
count2 = 0

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

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

print(count)

Failing test case input:
20 28

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n ,d = map(int, input().split())
count = 0
count2 = 0

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

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

print(count)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D=[int(x) for x in input().split()]

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

if ans-int_ans!=0:
    ans+=1

print(int(ans))

Failing test case input:
2 62

Expected output:
1


Actual output:
0.016
1


Fixed submission (verdict: Accepted):
N,D=[int(x) for x in input().split()]

ans=N/(2*D+1)
int_ans=int(ans)

if ans-int_ans!=0:
    ans+=1

print(int(ans))

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, D = map(int, input().split())

see = 2*D+1

if N%see==0:
    ans = N/see

else:
    ans = int(N/see) + 1

print(ans)

Failing test case input:
57 0

Expected output:
57


Actual output:
57.0


Fixed submission (verdict: Accepted):
N, D = map(int, input().split())

see = 2*D+1

if N%see==0:
    ans = N/see

else:
    ans = (N-(N%see))/see + 1

print(int(ans))

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def main():

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

    if N < D:
        N=D

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



if __name__== "__main__":
    main() 


Failing test case input:
36 28

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):

def main():

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

    power = D*2+1

    if N <= power:
        print(1)
        exit()

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



if __name__== "__main__":
    main()

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D =map(int,input().split())
ans=0
while True:
  ans+=1
  tmp=ans*2+1
  if tmp >= N:
    break
print(ans)

Failing test case input:
57 0

Expected output:
57


Actual output:
28


Fixed submission (verdict: Accepted):
N,D =map(int,input().split())
ans=0
while True:
  ans+=1
  tmp=(D*2+1)*ans
  if tmp >= N:
    break
print(ans)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, D = map(int, input().split())

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

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
from math import ceil

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

print(ceil(N / (D * 2 + 1)))
Problem: p02970
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math
n, d = map(int, input().split())
print(math.ceil(n/(d*2-1)))

Failing test case input:
57 0

Expected output:
57


Actual output:
-57


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
36 28

Expected output:
1


Actual output:
36
1


Fixed submission (verdict: Accepted):
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)

if n != 0:
    count += 1
print(count)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())

s = 0
c = 0
while (s <= a):
  s += 2*b + 1
  c += 1

print(c)

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())

s = 0
c = 0
while (s < a):
  s += 2*b + 1
  c += 1

print(c)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d = map(int, input().split())

hani = d*2 + 1

ans = int(n/hani)

print(ans)

Failing test case input:
20 28

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n,d = map(int, input().split())

hani = d*2 + 1

ans = int(n/hani)

if(ans - (n/hani) < 0):
  ans += 1

print(ans)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D = map(int,input().split())
s = 1
cnt = 0
while s > N:
  s += 2*D+1
  cnt += 1
  
print(cnt)

Failing test case input:
36 28

Expected output:
1


Actual output:
0


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, D = map(int, input().split())

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

Failing test case input:
20 28

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
import math

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

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d = map(int,input().split())

if (2*d+1) > n:
  print(1)
else:
  print(int(n / (2*d+1))+1)

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
n,d = map(int,input().split())

if (2*d+1) > n:
  print(1)
else:
  print(-(-n
Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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())

Failing test case input:
57 0

Expected output:
57


Actual output:
29


Fixed submission (verdict: Accepted):
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())

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n,d = map(int, input().split())
print(math.ceil((n-1-d)/(1+2*d))+1)


Failing test case input:
20 14

Expected output:
1


Actual output:
2


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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d = (int(i) for i in input().split())

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

Failing test case input:
57 0

Expected output:
57


Actual output:
56


Fixed submission (verdict: Accepted):
n,d = (int(i) for i in input().split())

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

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d  = list(map(int,input().split()))

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

print(cnt)

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
n,d  = list(map(int,input().split()))

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

print(cnt)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d = map(int,input().split())

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

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

print(ans)

Failing test case input:
57 0

Expected output:
57


Actual output:
58


Fixed submission (verdict: Accepted):
n,d = map(int,input().split())

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

if n%(2*d+1) != 0:
    ans += 1

print(ans)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

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

print(answer)


Failing test case input:
57 0

Expected output:
57


Actual output:
29


Fixed submission (verdict: Accepted):
import math

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

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

print(answer)

Problem: p02970
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, d = map(int, input().split())

c = 0

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

Failing test case input:
57 0

Expected output:
57


Actual output:
56


Fixed submission (verdict: Accepted):
n, d = map(int, input().split())

c = 0

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