Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03455 (python)

Fixed submission:
a, b=map(int,input().split())
print("Even" if a * b % 2 == 0 else "Odd")

Buggy submission (verdict: Runtime Error):
n = int(input())
_ = [list(map(int, input().split())) for _ in range(n)]
_.insert(0, [0, 0, 0])

dt = [_[i + 1][0] - _[i][0] for i in range(n)]
dx = [_[i + 1][1] - _[i][1] for i in range(n)]
dy = [_[i + 1][2] - _[i][2] for i in range(n)]

ans = "Yes"

for i in range(n):
    man_d = abs(dx[i]) + abs(dy[i])
    if not (dt[i] >= man_d and (dt [i]- man_d) % 2 == 0):
        ans = "No"

print(ans)
Problem p03457 (python)

Fixed submission:
n = int(input())
_ = [list(map(int, input().split())) for _ in range(n)]
_.insert(0, [0, 0, 0])

dt = [_[i + 1][0] - _[i][0] for i in range(n)]
dx = [_[i + 1][1] - _[i][1] for i in range(n)]
dy = [_[i + 1][2] - _[i][2] for i in range(n)]

for i in range(n):
    man_d = abs(dx[i]) + abs(dy[i])
    if dt[i] >= man_d and (dt [i]- man_d) % 2 == 0:
        ans = "Yes"
    else:
        ans = "No"
        break

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
_ = [list(map(int, input().split())) for _ in range(n)]

dt = [0] * n
dx = [0] * n
dy = [0] * n

for i in range(n):
    dt[i] = _[i + 1][0] - _[i][0]
    dx[i] = _[i + 1][1] - _[i][1]
    dy[i] = _[i + 1][2] - _[i][2]

ans = "Yes"

for i in range(n):
    man_d = abs(dx[i]) + abs(dy[i])
    if not (dt[i] >= man_d and (dt [i]- man_d) % 2 == 0):
        ans = "No"

print(ans)
Problem p04033 (python)

Fixed submission:
a,b = list(map(int,input().split()))
if( a > b ):
    a,b = b,a
if a > 0 and b > 0:
    print("Positive")
elif a <= 0 and b >= 0:
    print("Zero")
else:
    if (abs(a) - abs(b)) % 2 == 0:
        print("Negative")
    else:
        print("Positive")

Buggy submission (verdict: Runtime Error):
a,b = list(map(int,input().split()))
if( a > b ):
    a,b = b,a
if a > 0 and b > 0:
    print("Positive")
elif a <= 0 and b >= 0:
    print("Zero")
else:
    if (abs(a) - abs(b)) % 2 == 0:
        print("Negative")
    else:
        print("Pisitive")-1 1
Problem p03238 (python)

Fixed submission:
n = int(input().rstrip())
if n == 1:
    print("Hello World")
else:
    a = int(input().rstrip())
    b = int(input().rstrip())
    print(a+b)

Buggy submission (verdict: Runtime Error):
n = int(input().rstrip())
a = int(input().rstrip())
b = int(input().rstrip())

if n == 1:
    print("Hello World")
else:
    print(a+b)

Buggy submission (verdict: Runtime Error):
N = int(input())
points = [list(map(int, input().split())) for i in range(N)]


def main(N, points):
    points.sort(key=lambda x: x[2], reverse=True)
    for x in range(101):
        for y in range(101):
            # 初期化
            H = -1
            for point in points:
                h = abs(point[0] - x) + abs(point[1] - y) + point[2]
                if point[2] > 0:
                    if H == -1:
                        H = h
                    elif H != h:
                        H = -1
                        break
                else:
                    if H > h:
                        H = -1
                        break
            if H > 0:
                print(x, y, h)
                return


main(N, points)
Problem p03496 (python)

Fixed submission:
I = int(input())
L = list(map(int, input().split()))

print(2*I-1, flush=True)

m = 0
m_index = 0
for i, item in enumerate(L):
    if abs(item) > abs(m):
        m = item
        m_index = i

for i in range(I):
    print(m_index+1, i+1, flush=True)

if m >= 0:
    for i in range(0, I-1):
        print(i+1, i+2)
else:
    for i in range(I, 1, -1):
        print(i, i-1)

Buggy submission (verdict: Runtime Error):
I = int(input())
L = list(map(int, input().split()))

print(2*I-1, flush=True)

m = 0
for i, item in enumerate(L):
    if abs(item) > abs(m):
        m = item
        m_index = i

for i in range(L):
    print(m_index+1, i+1, flush=True)

if m >= 0:
    for i in range(0, I-1):
        print(i+1, i+2)
else:
    for i in range(I, 0):
        print(i, i-1)
Problem p03282 (python)

Fixed submission:
S = str(input())
K = int(input())

if len(S) == 1:
  print(S)
  exit()

if set(S[:K]) == set(['1']):
  print(1)
  exit()
else:
  for idx in range(K):
    if S[idx] != '1':
      print(S[idx])
      exit()

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())

if set(S[:K]) == '1':
  print(1)
else:
  idx = 0
  while True:
    if S[idx] != '1':
      print(S[idx])
      exit()
    idx+=1
Problem p03284 (python)

Fixed submission:
N, K = map(int, input().split())
if N%K == 0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input())
if N%K == 0:
  print(0)
else:
  print(1)
Problem p03415 (python)

Fixed submission:
C1 = input()
C2 = input()
C3 = input()
print(C1[0]+C2[1]+C3[2])

Buggy submission (verdict: Runtime Error):
C1 = input()
C2 = input()
C3 = input()
print(C[0]+C[1]+C[2])
Problem p03424 (python)

Fixed submission:
N = int(input())
S = [x for x in input().split()]
if 'Y' in S:
  print("Four")
else:
  print("Three")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [int(x) for x in input().split()]
if 'Y' in S:
  print("Four")
else:
  print("Three")
Problem p03501 (python)

Fixed submission:
N,A,B=map(int, input().split())
print(min(N*A, B))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int, input().split())
print(min(N*A, B)
Problem p03563 (python)

Fixed submission:
R = int(input())
G = int(input())
print(2*G-R)

Buggy submission (verdict: Runtime Error):
R = int(input())
G = int(intpu())
print(2*G-R)
Problem p03635 (python)

Fixed submission:
n,m=map(int, input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n,m=map(int, input())
print((n-1)*(m-1))
Problem p03815 (python)

Fixed submission:
x = int(input())
 
s = x//11
 
if 11*s == x:
  print(s*2)
elif x <= 11*s + 6:
  print(s*2+1)
else:
  print(s*2+2)

Buggy submission (verdict: Runtime Error):
x = int(input())

s = x//11

if 11*s == x:
  print(s*2)
elif x <= 11*s + 6:
  print(s*2+1)
else:
  print(S*2+2)
Problem p03827 (python)

Fixed submission:
N=int(input())
S=input()
x = 0
max_x = 0
for s_i in S:
  if s_i == "I":
    x += 1
  else:
    x -= 1
  max_x = max(max_x, x)
print(max_x)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
x = 0
max_x = 0
for s_i in S:
  if s_i = "I":
    x += 1
  else:
    x -= 1
  max_x = max(max_x, x)
print(max_x)
Problem p03997 (python)

Fixed submission:
a=int(input())
b=int(input())
h=int(input())
print(int((a+b)*h/2))

Buggy submission (verdict: Runtime Error):
S = dict()
S['a'] = list(input())[::-1]
S['b'] = list(input())[::-1]
S['c'] = list(input())[::-1]
p = 'a'
while S[p]:
  p = S[p].pop()  
print(p.upper())
Problem p03998 (python)

Fixed submission:
Sa=list(input())
Sb=list(input())
Sc=list(input())
S = [Sa, Sb, Sc]
Ans = ["A", "B", "C"]
idx = ['a', 'b', 'c']
p = 'a'

def take_turn(i):
  if len(S[i])==0:
    print(Ans[i])
    exit()
  else:
    p = S[i].pop(0)
    return p
    
while True:
  p = take_turn(idx.index(p))

Buggy submission (verdict: Runtime Error):
S = dict()
S['a'] = list(input())[::-1]
S['b'] = list(input())[::-1]
S['c'] = list(input())[::-1]
p = 'a'
while S[]:
  p = S[p].pop()  
print(player.upper())

Buggy submission (verdict: Runtime Error):
S = dict()
S['a'] = list(input())[::-1]
S['b'] = list(input())[::-1]
S['c'] = list(input())[::-1]
 p = 'a'
while S[]:
  p = S[p].pop()  
print(player.upper())
Problem p03262 (python)

Fixed submission:
import functools
import fractions
 
n,x = map(int,input().split())
cities = list(map(int,input().split()))
if n == 1:
    ans = abs(cities[0] - x)
    print(ans)
else:
    cities.append(x)
    cities.sort()
    dist = []
    for i in range(1,len(cities)):
        dist.append(cities[i] - cities[i-1])
    ans = functools.reduce(fractions.gcd, dist)
    print(ans)

Buggy submission (verdict: Runtime Error):
import functools
import fractions

n,x = map(int,input().split())
cities = list(map(int,input().split()))
if n == x:
    ans = cities[0] - x
    print(ans)
else:
    cities.sort()
    dist = []
    for i in range(1,len(cities)):
        dist.append(cities[i] - cities[i-1])
    ans = functools.reduce(fractions.gcd, dist)
    print(ans)
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())
s = list(map(int,S))

num = 1
one_cnt = 0
for i in s:
    if i != 1:
        num = i
        break
    else:
        one_cnt += 1
if (one_cnt >= K):
    print(1)
else:
    print(num)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())

s = list(set(map(int,S)))
s.sort

min = 0
if s[0] == 1:
    min = s[1]
else:
    min = s[0]
    
if (K == 1 and s[0] == 1):
    print(1)
else:
    print(min)
Problem p02952 (python)

Fixed submission:
N=int(input())
if N<10:
  A=N
elif N<100:
  A=9
elif N<1000:
  A=9+N-99
elif N<10000:
  A=9+900
elif N<100000:
  A=9+900+N-9999
else:
  A=9+900+90000  
print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N<10:
  A=N
elif N<100:
  A=9
elif N<1000:
  A=9+N-99
elif N<10000:
  A=9+900
elif N<100000:
  A=9+900+N-9999
else
  A=9+900+90000  
print(A)
Problem p03029 (python)

Fixed submission:

def main():
    A, P = [ int(x) for x in input().split() ]
    n = (A * 3 + P) / 2
    print(int(n))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    restaurants = []
    for i in range(N):
        si, pi = input().split()
        restaurants.append([i+1, si, int(pi)])
    cities = sorted(set([restaurant[1] for restaurant in restaurants]))

    for city in cities:
        same_cities = []
        for restaurant in restaurants:
            if restaurant[1] == city:
                same_cities.append(restaurant)
        sorted_restaurants = sorted(same_cities, key=lambda restaurant: restaurant[2], reverse=True)
        [print(restaurant[0]) for restaurant in sorted_restaurants]


if __name__ == '__main__':
    main()
Problem p02952 (python)

Fixed submission:
N = int(input())
if N < 10:
    print(N)
elif N < 100:
    print(9)
elif N < 1000:
    print(N - 90)
elif N < 10000:
    print(909)
elif N < 100000:
    print(N - 9090)
else:
     print(90909)

Buggy submission (verdict: Runtime Error):
if N < 10 ** 1:
    print(N)
elif N < 10 ** 2:
    print(9)
elif N < 10 ** 3:
    print(N - 90)
elif N < 10 ** 4:
    print(909)
elif N < 10 ** 5:
    print(N - 9090)
else:
     print(90909)

Buggy submission (verdict: Runtime Error):
if N < 10 ** 1:
    print(N)
elif N < 10 ** 2:
    print(9)
elif N < 10 ** 3:
    print(N - 90)
elif N < 10 ** 4:
    print(909)
elif N < 10 ** 5:
    print(N - 9090)
else:
     print(90909)
Problem p02957 (python)

Fixed submission:
A, B = map(int, input().split())
if ( A + B ) % 2 == 0:
    print(int(( A + B ) / 2))
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if C - (A - B) >= 0:
    print(C - (A - B))
else:
    print(0)
Problem p03035 (python)

Fixed submission:
a, b = map(int, input().split())
if a >= 13:
    print(b)
elif (a >= 6 and a <= 12):
    print(b//2)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a >= 13:
  print(B)
else if a >= 6 and a < 12:
  print(B/2)
else:
  print(0)
Problem p03292 (python)

Fixed submission:
a = list(map(int, input().split()))
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
a = map(int, input().split())
print(max(a)-min(a))
Problem p02952 (python)

Fixed submission:
n = int(input())
cnt = 0
for i in range(1, n + 1):
  if len(str(i)) % 2 == 1:
    cnt +=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1, n + 1)
	if len(str(i)) % 2 == 1:
    	ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1, n + 1)
	if len(str(i)) % 2 == 1:
    	ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range(1, N + 1)
	if len(str(i)) % 2 == 1:
    	ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N_s = input()
N = int(N_s)
ans = 0
for i in range(1, len(N_s)):
	if i % 2 == 1:
    	ans += 10**i - 10**(i - 1)
if len(N_s) % 2 == 1:
  	ans += 1 + N - 10**(len(N_s) - 1) 
print(ans)

Buggy submission (verdict: Runtime Error):
N_s = input()
N = int(N_s)
ans = 0
for i in range(1, len(N_s)):
	if i % 2 == 1:
    	ans += 10**i - 10**(i - 1)
if len(N_s) % 2 == 1:
  	ans += 1 - 10**(len(N_s)-1) + N
print(ans)

Buggy submission (verdict: Runtime Error):
N_s = input()
N = int(N_s)
ans = 0
for i in range(1, len(N_s)):
	if i % 2 == 1:
    	ans += 10**i - 10**(i - 1)
if len(N_s) % 2 == 1:
  	ans += 1 - 10**(len(N_s)) + N
print(ans)

Buggy submission (verdict: Runtime Error):
N_s = input()
N = int(N_s)
ans = 0
for i in range(1, len(N_s)):
	if i % 2 == 1:
    	ans += (10**i - 10**(i - 1))
if len(N_s) % 2 == 1:
  	ans += (1 - 10**(len(N_s)) + N)
print(ans)

Buggy submission (verdict: Runtime Error):
N_s = input()
N = int(N_s)
ans = 0
for i in range(1, len(N_s))
	if i % 2 == 1:
    	ans += (10**i - 10**(i - 1))
if len(N_s) % 2 == 1:
  	ans += (1 - 10**(len(N_s)) + N)
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
n = int(N)
if N >= 100000:
  	print(90909)
else if N >= 10000:
  	print(909 + (N - 10000))
else if N >= 1000:
  	print(909)
else if N >= 100:
  	print(9 + (N - 100))
else if N >= 10:
  	print(9)
else:
  	print(N)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N >= 100000:
  	print(90909)
else if N >= 10000:
  	print(909 + (N - 10000))
else if N >= 1000:
  	print(909)
else if N >= 100:
  	print(9 + (N - 100))
else if N >= 10:
  	print(9)
else:
  	print(N)
Problem p03071 (python)

Fixed submission:
a,b = map(int,input().split())
c = 0
d = 0
e = 0
c += max(a,b)
d += c
d -= 1
e += min(a,b)
c += max(d,e)
print(c)

Buggy submission (verdict: Runtime Error):
AB = int(stdin.readline().rstrip().split())
x = max(AB)
y = max(x-1, min(AB))
print(x + y)
Problem p02952 (python)

Fixed submission:
N = int(input())

ans = 0

for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
ans = 0

for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
ans = 0

for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
if N < 10:
    print(N)
elif 10 <= N < 100:
    print(9)
elif 100 <= N < 1000:
    print(N - 90)
elif 1000 <= N < 10000:
    print(909)
elif 10000 <= N < 100000:
    print(N-9090)
else:
    print(90909)

Buggy submission (verdict: Runtime Error):
if N < 10:
    print(N)
elif N >= 10 and N < 100:
    print(9)
elif N >= 100 and N < 1000:
    print(N - 90)
elif N >= 1000 and N < 10000:
    print(909)
elif N >= 10000 and N < 100000:
    print(N-9090)
else:
    print(90909)

Buggy submission (verdict: Runtime Error):
if N < 10:
    print(N)
elif N >= 10 and N < 100:
    print(9)
elif N >= 100 and N < 1000:
    print(N - 90)
elif N >= 1000 and N < 10000:
    print(909)
elif N >= 10000 and N < 100000:
    print(N-9090)
else:
    print(90909)
Problem p02953 (python)

Fixed submission:
n=int(input())
list1=list(reversed(input().split()))#まだintになってないことに注意 さらに後ろから考えるために逆順になっていることに注意
list2=list(map(int,list1))
#print(list2)#int,逆順の配列完成
if len(list2)==1:
    print("Yes")
else:
    for i in range(len(list2)):
        #print(i)
        d=list2[i]-list2[i+1]
        if d==-1:
            list2[i+1]-=1
        if d<-1:
            print("No")
            break
        if i==len(list2)-2:
            print("Yes")
            break
#print(list2)

Buggy submission (verdict: Runtime Error):
n=int(input())
list1=list(reversed(input().split()))#まだintになってないことに注意 さらに後ろから考えるために逆順になっていることに注意
list2=list(map(int,list1))
#print(list2)#int,逆順の配列完成
for i in range(len(list2)):
    print(i)
    d=list2[i]-list2[i+1]
    if d==-1:
        list2[i+1]-=1
    if d<-1:
        print("No")
        break
    if i==len(list2)-2:
        print("Yes")
        break
#print(list2)
Problem p02957 (python)

Fixed submission:
a,b=map(int,input().split())
if a%2==b%2:
  print (int((a+b)/2))
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2==b%2:
  return ((a+b)/2)
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=map(int,imput().split())
if a%2==b%2:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=map(int,imput().split())
if (a+b)%2==1:
  print("IMPOSSIBLE")
else:
  print((a+b)/2)
Problem p02969 (python)

Fixed submission:
r=int(input())
m=3*r*r
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
listA=(input().split())
list1=[0 for i in range(n)]
list2=[]
numOfBox=0
#考えるべきボールの数の合計
for i in range(n,0,-1):#n,n-1,...1って感じです
    #print(i)
    count=1
    s=0
    while i*count<=n:
        s+=list1[i*count-1]
        count+=1
    #print(s)
    if s%2!=int(listA[i-1]):
        list1[i-1]+=1
        numOfBox+=1
        list2.append(i)
#print(list1)
print(numOfBox)
for i in range(len(list2)):
    print(list2[i],end=" ")
Problem p02953 (python)

Fixed submission:
n = int(input())
h = [int(x) for x in input().split(" ")]
 
for i in range(1, n):
  if h[-i]-h[-i-1] >= 0:
    continue  
  elif h[-i]-h[-i-1] == -1:
    h[-i-1] = h[-i-1] - 1
    continue
  elif h[-i]-h[-i-1] < -1:
    ans = "No"
    break
else:
  ans = "Yes"
  
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(x) for x in input().split(" ")]

for i in range(1, n):
  if h(-i)-h(-i-1) >= 0:
    continue  
  if h(-i)-h(-i-1) == -1:
    h(-i-1) = h(i-1) - 1
    continue
  if h(i)-h(-i-1) < -1:
    ans = "No"
    break
else:
  ans = "Yes"

print(ans)
Problem p02953 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split(' ')))

is_trimmed = [False] * N
max_v = 0
max_ids = []
succeed = True
for i in range(N):
    diff = max_v - H[i]
    if diff > 1:
        print('No')
        succeed = False
        exit(0)
    elif diff == 1:
        for j in max_ids:
            if is_trimmed[j]:
                print('No')
                succeed = False
                exit(0)
            is_trimmed[j] = True
        max_ids.append(i)
        max_v -= 1
    elif diff == 0:
        max_ids.append(i)
    elif diff < 0:
        max_v = max(max_v, H[i])
        max_ids = [i]
    # print(max_v, max_ids, is_trimmed)

if succeed:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split(' ')))

is_trimmed = [False] * N
max_v = 0
max_ids = []
succeed = True
for i in range(N):
    if max_v > H[i]:
        if max_v - H[i] > 1:
            print('No')
            succeed = False
            break
        if max_v - H[i] == 1:
            for j in max_ids:
                if is_trimmed[j]:
                    print('No')
                    succeed = False
                    break
                is_trimmed[j] = True
    elif max_v == H[i]:
        max_ids.append(i)
    elif max_v < H[i]:
        max_v = max(max_v, H[i])
        max_ids = [i]
    print(max_v, max_ids, is_trimmed)

if succeed:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split(' ')))

is_trimmed = [False] * N
max_v = 0
max_ids = []
for i in range(N):
    if max_v > H[i]:
        if max_v - H[i] > 1:
            print('No')
            exit(0)
        if max_v - H[i] == 1:
            for j in max_ids:
                if is_trimmed[j]:
                    print('No')
                    exit(0)
                is_trimmed[j] = True
    elif max_v == H[i]:
        max_ids.append(i)
    elif max_v < H[i]:
        max_v = max(max_v, H[i])
        max_ids = [i]
    print(max_v, max_ids, is_trimmed)
print('Yes')
Problem p03043 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
import math


def solve(N: int, K: int):
    l = [(1 / 2) ** max(0, math.ceil(math.log2(K / i))) for i in range(1, N + 1)]
    print(sum(l) / len(l))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools
# (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import math


def solve(N: int, K: int):
    l = [(1 / 2) ** max(0, math.ceil(math.log2(K / i))) for i in range(1, N + 1)]
    print(sum(l) / len(l))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools
# (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import math


def solve(N: int, K: int):
    l = [(1 / 2) ** max(0, math.ceil(math.log2(K / i))) for i in range(1, N + 1)]
    print(sum(l) / len(l))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools
# (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)


if __name__ == '__main__':
    main()