Buggy python submission (verdict: Runtime Error):
import math
n, k = map(int, input().split())

t = []
d = k
while(True):
  d = d / 2
  t.append(d)
  if d <= 1:
    break
# print(t)

t2 = []
nn = 1+n if n < k else k
for i in range(1, nn):
  for j in range(len(t)):
    if i >= t[j]:
      t2.append(j+1)
      break
# print(t2)

t3 = [0.5]
for i in range(1, math.ceil(math.log2(k))):
  t3.append(t3[i-1]*0.5)
# print(t3)

r = 0
for t in t2:
  r += t3[t-1]
r /= n
if n >= k:
  r += (n-k+1) / n
print(r)

Fixed submission:
n, k = map(int, input().split())

r = 0
for i in range(1, 1+n):
  t = i
  p = 1.0
  while(True):
    if t >= k:
      r += p
      break
    t *= 2
    p *= 0.5
print(r/n)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

t = []
d = k
while(True):
  d = d / 2
  t.append(d)
  if d <= 1:
    break
# print(t)

t2 = []
nn = 1+n if n < k else k
for i in range(1, nn):
  for j in range(len(t)):
    if i >= t[j]:
      t2.append(j+1)
      break
# print(t2)

t3 = [0.5]
for i in range(1, len(t2)+2):
  t3.append(t3[i-1]*0.5)
# print(t3)

r = 0
for t in t2:
  r += t3[t-1]
r /= n
if n >= k:
  r += (n-k+1) / n
print(r)

Fixed submission:
n, k = map(int, input().split())

r = 0
for i in range(1, 1+n):
  t = i
  p = 1.0
  while(True):
    if t >= k:
      r += p
      break
    t *= 2
    p *= 0.5
print(r/n)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

t = []
d = k
while(True):
  d = d / 2
  t.append(d)
  if d <= 1:
    break
# print(t)

t2 = []
nn = 1+n if n < k else n-k
for i in range(1, nn):
  for j in range(len(t)):
    if i >= t[j]:
      t2.append(j+1)
      break
# print(t2)

t3 = [0.5]
for i in range(1, len(t2)+2):
  t3.append(t3[i-1]*0.5)
# print(t3)

r = 0
for t in t2:
  r += t3[t-1]
r /= n
if n >= k:
  r += k / n
print(r)

Fixed submission:
n, k = map(int, input().split())

r = 0
for i in range(1, 1+n):
  t = i
  p = 1.0
  while(True):
    if t >= k:
      r += p
      break
    t *= 2
    p *= 0.5
print(r/n)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

t = []
d = k
while(True):
  d = d / 2
  t.append(d)
  if d <= 1:
    break
# print(t)

t2 = []
for i in range(1, 1+n):
  for j in range(len(t)):
    if i >= t[j]:
      t2.append(j+1)
      break
# print(t2)

t3 = [0.5]
for i in range(1, len(t2)+2):
  t3.append(t3[i-1]*0.5)
# print(t3)

r = 0
for t in t2:
  r += t3[t-1]
print(r/n)


Fixed submission:
n, k = map(int, input().split())

r = 0
for i in range(1, 1+n):
  t = i
  p = 1.0
  while(True):
    if t >= k:
      r += p
      break
    t *= 2
    p *= 0.5
print(r/n)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

t = []
d = k
while(True):
  d = d / 2
  t.append(d)
  if d <= 1:
    break
# print(t)

t2 = []
for i in range(1, 1+n):
  for j in range(len(t)):
    if i >= t[j]:
      t2.append(j+1)
      break
# print(t2)

t3 = [0.5]
for i in range(1, len(t2)+1):
  t3.append(t3[i-1]*0.5)
# print(t3)

r = 0
for t in t2:
  r += t3[t-1]
print(r/n)


Fixed submission:
n, k = map(int, input().split())

r = 0
for i in range(1, 1+n):
  t = i
  p = 1.0
  while(True):
    if t >= k:
      r += p
      break
    t *= 2
    p *= 0.5
print(r/n)