Buggy python submission (verdict: Runtime Error):
import math

N, K = map(int, input().split())
#coin = [decimal.Decimal('0.5')**k for k in range(10**4)]
ans = 0

for i in range(1,N+1):
    tmp = math.log2(K/i)
    x = int(math.log2(K/i))
    if i >= K:
        ans += 1/N
    else:
        if tmp - x != 0:
            x += 1
        ans += 1/N * (0.5)**x

print(ans)


Fixed submission:
import math
N,K = map(int,input().split())
ans = 0
 
for i in range(1,N+1):
    if i >= K:
        ans += (1/N)
        continue
    X = int(math.log((K/i), 2))
    if (K/i) % 2**X == 0:
        pass
    else:
        X += 1
    ans += (1/N) * (1/2) ** X
print(ans)

Buggy python submission (verdict: Runtime Error):
import decimal
import math

N, K = map(int, input().split())
#coin = [decimal.Decimal('0.5')**k for k in range(10**4)]
ans = 0

for i in range(1,N+1):
    tmp = math.log2(K/i)
    x = int(math.log2(K/i))
    if i >= K:
        ans += 1/N
    else:
        if tmp - x != 0:
            x += 1
        ans += 1/N * (0.5)**x

print(ans)


Fixed submission:
import math
N,K = map(int,input().split())
ans = 0
 
for i in range(1,N+1):
    if i >= K:
        ans += (1/N)
        continue
    X = int(math.log((K/i), 2))
    if (K/i) % 2**X == 0:
        pass
    else:
        X += 1
    ans += (1/N) * (1/2) ** X
print(ans)

Buggy python submission (verdict: Runtime Error):
import decimal
import math

N, K = map(int, input().split())
coin = [decimal.Decimal('0.5')**k for k in range(10**4)]
ans = 0

for i in range(1,N+1):
    tmp = decimal.Decimal(str(math.log2(K/i)))
    x = int(math.log2(K/i))
    if i >= K:
        ans += decimal.Decimal(1/N)
    else:
        if tmp - x != 0:
            x += 1
        ans += decimal.Decimal(1/N) * coin[x]

print(ans)


Fixed submission:
import math
N,K = map(int,input().split())
ans = 0
 
for i in range(1,N+1):
    if i >= K:
        ans += (1/N)
        continue
    X = int(math.log((K/i), 2))
    if (K/i) % 2**X == 0:
        pass
    else:
        X += 1
    ans += (1/N) * (1/2) ** X
print(ans)

Buggy python submission (verdict: Runtime Error):
import decimal
import math

N, K = map(int, input().split())
coin = [decimal.Decimal('0.5')**k for k in range(10**3)]
ans = 0

for i in range(1,N+1):
    tmp = decimal.Decimal(str(math.log2(K/i)))
    x = int(math.log2(K/i))
    if i >= K:
        ans += decimal.Decimal(1/N)
    else:
        if tmp - x != 0:
            x += 1
        ans += decimal.Decimal(1/N) * coin[x]

print(ans)


Fixed submission:
import math
N,K = map(int,input().split())
ans = 0
 
for i in range(1,N+1):
    if i >= K:
        ans += (1/N)
        continue
    X = int(math.log((K/i), 2))
    if (K/i) % 2**X == 0:
        pass
    else:
        X += 1
    ans += (1/N) * (1/2) ** X
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import decimal
import math

N, K = map(int, input().split())
coin = [decimal.Decimal('0.5')**k for k in range(10**5)]
ans = 0

for i in range(1,N+1):
    tmp = decimal.Decimal(str(math.log2(K/i)))
    x = int(math.log2(K/i))
    if i >= K:
        ans += decimal.Decimal(1/N)
    else:
        if tmp - x != 0:
            x += 1
        ans += decimal.Decimal(1/N) * coin[x]

print(ans)


Fixed submission:
import math
N,K = map(int,input().split())
ans = 0
 
for i in range(1,N+1):
    if i >= K:
        ans += (1/N)
        continue
    X = int(math.log((K/i), 2))
    if (K/i) % 2**X == 0:
        pass
    else:
        X += 1
    ans += (1/N) * (1/2) ** X
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import decimal
import math

N, K = map(int, input().split())
coin = [decimal.Decimal('0.5')**k for k in range(10**5)]
ans = 0
for i in range(1,N+1):
    x = 0
    while(True):
        if i*(2**x) >= K:
            ans += decimal.Decimal(1/N) * coin[x]
            break
        else: x += 1
   

print(ans)


Fixed submission:
import math
N,K = map(int,input().split())
ans = 0
 
for i in range(1,N+1):
    if i >= K:
        ans += (1/N)
        continue
    X = int(math.log((K/i), 2))
    if (K/i) % 2**X == 0:
        pass
    else:
        X += 1
    ans += (1/N) * (1/2) ** X
print(ans)