Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
x, y, a, b, c = [int(i) for i in input().split()]
pa = [int(i) for i in input().split()]
pb = [int(i) for i in input().split()]
pc = [int(i) for i in input().split()]

pa = sorted(pa, reverse=True)
pa = pa[:x]
pb = sorted(pb, reverse=True)
pb = pb[:y]
pc = sorted(pc, reverse=True)

l = pa + pb
l = sorted(l, reverse=True)

for i in range(len(pc)):
  for j in range(len(l)):
    if pc[i] > l[j]:
      l[j] = pc[i]
    if j == len(l)-1:
      break
      
print(sum(l))
  

Fixed submission:
x, y, a, b, c = [int(i) for i in input().split()]
pa = [int(i) for i in input().split()]
pb = [int(i) for i in input().split()]
pc = [int(i) for i in input().split()]

pa = sorted(pa, reverse=True)
pa = pa[:x]
pb = sorted(pb, reverse=True)
pb = pb[:y]
pc = sorted(pc, reverse=True)

l = pa + pb + pc
l = sorted(l, reverse=True)
l = l[:int(x+y)]
print(sum(l))
Buggy python submission (verdict: Runtime Error):
s = input()
s = list(s)

a = 0
if s[-2] == 'h' and s[-1] == 'i':
  a += 1
  
if len(s) == 2:
  if s[0] == 'h' and s[1] == 'i':
    a += 1
elif len(s) > 2:
  for i in range(len(s)-2):
    if s[i] == 'h':
      if s[i+1] == 'i' and s[i+2] != 'i':
        a += 1
        break
    
if a >= 1:
  print('Yes')
else:
  print('No')

Fixed submission:
s = input()
hi = [s[i:i+2] for i in range(0, len(s), 2)]

a = 0
for i in range(len(hi)):
  if hi[i] != 'hi':
    a += 1
    break
    
if a == 1:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
s = input()
s = list(s)

if len(s) < 2:
  a = 0
elif len(s) == 2:
  if s[0] == 'h' and s[1] == 'i':
    a = 1
  else:
    a = 0
else:
  for i in range(len(s)-2):
    if s[i] == 'h':
      if s[i+1] == 'i' and s[i+2] != 'i':
        a += 1
    
if a >= 1:
  print('Yes')
else:
  print('No')


Fixed submission:
s = input()
hi = [s[i:i+2] for i in range(0, len(s), 2)]

a = 0
for i in range(len(hi)):
  if hi[i] != 'hi':
    a += 1
    break
    
if a == 1:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]

sum = 0
for i in range(n-k+1):
  s = np.sum(p[i:i+k])
  if s > sum:
    l =p[i:i+k]
    sum = s

sum = 0
for i in range(k):
  sum += (l[i]/2)+0.5
  
print(sum)

Fixed submission:
n, k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]

for i in range(n):
  p[i] = (p[i] + 1)/2
  
a = sum(p[:k])
s = a

for i in range(n-k):
  a = a - p[i] + p[i+k]
  if s < a:
    s = a
  
print(s)
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
if a[0] >= a[1]:
    b = a[0]
    c = a[1]
else:
    b = a[1]
    c = a[0]

if a[2]%b == 0:
    s = int(a[2]/b)
else:
    s = int(a[2]/b)+1

print(s)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())
        
if h >= w:
  if n%h == 0:
    s = int(n/h)
  else:
    s = int(n/h)+1
    
else:
  if n%w == 0:
    s = int(n/w)
  else:
    s = int(n/w)+1

print(s)

Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
if a[0] >= a[1]:
    b = a[0]
    c = a[1]
else:
    b = a[1]
    c = a[0]

s = int(a[2]/b)+1

print(s)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())
        
if h >= w:
  if n%h == 0:
    s = int(n/h)
  else:
    s = int(n/h)+1
    
else:
  if n%w == 0:
    s = int(n/w)
  else:
    s = int(n/w)+1

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = [int(i) for i in input().split()]

for i in range(k):
  if a != 0:
    a -= 1
  elif b != 0:
    b -= 1
  else:
    break
    
print(a, b)

Fixed submission:
a, b, k = [int(i) for i in input().split()]

if k > a+b:
  a = 0
  b = 0
elif k > a:
  b = a+b-k
  a = 0
else:
  a = a-k
  
print(a, b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int, input().split()))

sum = 1
if d[0] == 0 and d.count(0)==1:
  for i in range(1, n):
    if int(d[i]) >2:
      sum *= int(d[i]) 
  print(sum)
else:
  print("0")
  

Fixed submission:
n = int(input())


if n%2 == 0:
  print(int(n/2-1))
else:
  print(int(n/2))
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l = [0 for _ in range(n)]

for _ in range(m):
  a, b = [int(x)-1 for x in input().split()]
  for i in range(b-a+1):
    l[a+i] += 1
  
print(l.count(m))

Fixed submission:
n, m = map(int, input().split())
l = []
r = []

for _ in range(m):
  a, b = map(int, input().split())
  l.append(a)
  r.append(b)
  
l_max = max(l)
r_min = min(r)

if l_max <= r_min:
  print(r_min - l_max + 1)
else:
  print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
a = sorted(a)

l = []
for i in range(m):
  b, c = map(int, input().split())
  x = [c]*b
  l += x
  
a = a+l
a = sorted(a)
a = a[-n:]
print(sum(a))

Fixed submission:
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
a = sorted(a)

l = []
for i in range(m):
  l.append(list(map(int, input().split())))
  
l = sorted(l, reverse=True, key=lambda x: x[1])

b = []
for _ in range(n):
  b.append(l[0][1])
  l[0][0] -= 1
  if l[0][0] == 0:
    l.pop(0)
  if l == []:
    break

for i in range(len(b)):
  if a[i] < b[i]:
    a[i] = b[i]
  else:
    break
    
print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
a = sorted(a)

for i in range(m):
  b, c = map(int, input().split())
  x = [c]*b
  a = a+x
  a = sorted(a, reverse=True)
  a = a[:n]
  
print(sum(a))

Fixed submission:
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
a = sorted(a)

l = []
for i in range(m):
  l.append(list(map(int, input().split())))
  
l = sorted(l, reverse=True, key=lambda x: x[1])

b = []
for _ in range(n):
  b.append(l[0][1])
  l[0][0] -= 1
  if l[0][0] == 0:
    l.pop(0)
  if l == []:
    break

for i in range(len(b)):
  if a[i] < b[i]:
    a[i] = b[i]
  else:
    break
    
print(sum(a))
Buggy python submission (verdict: Time Limit Exceeded):
k, s = [int(i) for i in input().split()]

ans = 0
for i in range(k+1):
  for j in range(k+1):
    for l in range(k+1):
      if i + j + l == s:
        ans += 1
        break
        
print(ans)

Fixed submission:
k, s = [int(i) for i in input().split()]

ans = 0
for i in range(k+1):
  for j in range(k+1):
    if k >= s-i-j and s-i-j>=0:
      ans += 1
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = [int(i) for i in input().split()]

ans = 0
for i in range(k+1):
  for j in range(k+1):
    for l in range(k+1):
      if i + j + l == s:
        ans += 1
        
print(ans)

Fixed submission:
k, s = [int(i) for i in input().split()]

ans = 0
for i in range(k+1):
  for j in range(k+1):
    if k >= s-i-j and s-i-j>=0:
      ans += 1
        
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input)

for i in range(n):
  sum += n
  
print(sum)

Fixed submission:
import numpy as np
n = int(input())

list = np.array(range(n+1))

print(sum(list))
Buggy python submission (verdict: Runtime Error):
if A==5 and B==5 and C==7:
  print('Yes')
elif A==5 and B==7 and C==5:
  print('Yes')
elif A==7 and B==5 and C==5:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b,c=map(int,input().split())
s=a+b+c
if s == 17:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
X = N + M
sum_n = 0
sum_m = 0
ans = 0
flag = False
for i in reversed(range(1,X+1)):
    if(flag):
        break
    for j in range(i+1):
        n = j
        m = i - j
        if(n <= N and m <= M):
            sum_n = sum(A[0:n])
            sum_m = sum(B[0:m])
            if((sum_m + sum_n) <= K):
                ans=i
                flag =True
                break
            sum_m = 0
            sum_n = 0
print(ans)

Fixed submission:
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a,b = [0],[0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])

ans,j = 0,M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans,i+j)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
X = N + M
sum_n = 0
sum_m = 0
ans = 0
for i in range(1,X+1):
    for j in range(i+1):
        n = j
        m = i - j
        if(n <= N and m <= M):
            sum_n = sum(A[0:n])
            sum_m = sum(B[0:m])
            if((sum_m + sum_n) <= K):
                ans=i
                sum_m = 0
                sum_n = 0
                break
            sum_m = 0
            sum_n = 0
print(ans)

Fixed submission:
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a,b = [0],[0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])

ans,j = 0,M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans,i+j)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
X = N + M
sum_n = 0
sum_m = 0
ans = 0
for i in range(1,X+1):
    for j in range(i+1):
        n = j
        m = i - j
        if(n <= N and m <= M):
            for k in range(n):
                sum_n += A[k]
            for l in range(m):
                sum_m += B[l]
            if((sum_m + sum_n) <= K):
                ans=i
                sum_m = 0
                sum_n = 0
                break
            sum_m = 0
            sum_n = 0
print(ans)

Fixed submission:
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a,b = [0],[0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])

ans,j = 0,M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans,i+j)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
for i in range(1,N+1):
    for j in range(i,N+1,i):ans+=j
print(ans)

Fixed submission:
N = int(input())
ans = 0
for j in range(1,N+1):
    Y = N//j
    ans += Y*(Y+1)*j//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        if i % j == 0:
            ans+=i
print(ans)


Fixed submission:
N = int(input())
ans = 0
for j in range(1,N+1):
    Y = N//j
    ans += Y*(Y+1)*j//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
def dividor(K):
    X = [0]*K
    num = K
    for i in range(2,num+1):
        while(num%i == 0):
            X[i-1] +=1
            num = num // i
    ans = 1
    for i in range(1,K):
        ans = ans * (X[i] + 1)
    return ans
sum = 1
for i in range(2,N+1):
    sum += i * dividor(i)
print(sum)

Fixed submission:
N = int(input())
ans = 0
for j in range(1,N+1):
    Y = N//j
    ans += Y*(Y+1)*j//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

def dividor(K):
    X = [0]*K
    num = K
    for i in range(2,num+1):
        while(num%i == 0):
            X[i-1] +=1
            num = num // i
    ans = 1
    for i in range(1,K):
        ans = ans * (X[i] + 1)
    return ans
sum = 1
for i in range(2,N+1):
    sum += i * dividor(i)
print(sum)

Fixed submission:
N = int(input())
ans = 0
for j in range(1,N+1):
    Y = N//j
    ans += Y*(Y+1)*j//2
print(ans)
Buggy python submission (verdict: Runtime Error):
# C
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
    x[i],y[i] = map(int,input().split())
sum = 0
for i in range(N):
    for j in range(N):
        sum += math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)

ans = sum/N
print(ans)


Fixed submission:
# C
import math
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
    x[i],y[i] = map(int,input().split())
sum = 0
for i in range(N):
    for j in range(N):
        sum += math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)

ans = sum/N
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# D
N = int(input())
L = list(map(int,input().split()))
count = 0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if abs(L[i]-L[j]) < L[k] and L[k] < L[i] + L[j]:
                count += 1
print(count)

Fixed submission:
import bisect

N = int(input())
L = list(map(int,input().split()))
count = 0
L.sort() # 昇順
for i in range(N):
    for j in range(i+1,N):
        ind = bisect.bisect_left(L,L[i]+L[j])
        count += ind-j-1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N,M= map(int,input().split())
A = list(map(int,input().split()))
if len(A) > 1:
    ind = A.index(max(A))
    top = A.pop(ind)
    sec = max(A)
    for i in range(M):
        top = top/2
        if top < sec:
            A.append(top)
            top = A.pop(A.index(max(A)))
            sec = max(A)
    A.append(top)
    A =list(map(int,A))
    print(sum(A))
else:
    print(int(A[0]/(2**M)))
    # ind = A.index(max(A))
    # A[ind] = A[ind]/2
    # print(A)

Fixed submission:
from heapq import heappush,heappop,heapify
N,M= map(int,input().split())
A = list(map(int,input().split()))
a = [-x for x in A]
heapify(a)
for i in range(M):
    item = -1*heappop(a)
    item = item//2
    heappush(a,-1*item)
print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
N,M= map(int,input().split())
A = list(map(int,input().split()))

for i in range(M):
    ind = A.index(max(A))
    A[ind] = A[ind]/2
    # print(A)

A =list(map(int,A))
print(sum(A))

Fixed submission:
from heapq import heappush,heappop,heapify
N,M= map(int,input().split())
A = list(map(int,input().split()))
a = [-x for x in A]
heapify(a)
for i in range(M):
    item = -1*heappop(a)
    item = item//2
    heappush(a,-1*item)
print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
N,M= map(int,input().split())
A = list(map(int,input().split()))

for i in range(M):
    ind = A.index(max(A))
    A[ind] = A[ind]/2
    # print(A)

A =list(map(int,A))
print(sum(A))

Fixed submission:
from heapq import heappush,heappop,heapify
N,M= map(int,input().split())
A = list(map(int,input().split()))
a = [-x for x in A]
heapify(a)
for i in range(M):
    item = -1*heappop(a)
    item = item//2
    heappush(a,-1*item)
print(-sum(a))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
T = input()

length = len(S)

ans = 0
pre = -1

for t in T:
    x = S.find(t, pre+1, length)
    if x != -1:
        ans += x - pre
        pre = x
    else:
        x = S.find(t, 0, pre+1)
        if x != -1:
            ans += length + x - pre
            pre = x
        else:
            ans = -1
            break

print(ans)

Fixed submission:
S = input()
T = input()

length = len(S)

ans = 0
pre = -1

for t in T:
    x = S.find(t, pre+1, length)
    if x != -1:
        ans += x - pre
        pre = x
    else:
        x = S.find(t, 0, pre+1)
        if x != -1:
            ans += length + x - pre
            pre = x
        else:
            ans = -1
            break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
flag = True
i = 0 # s
j = 0 # t
loop = 0
while(flag):
    if s[i]==t[j]:
        j+=1
        if j==len(t):
            print(i+loop*len(s)+1)
            flag=False
    i+=1
    if i == len(s):
        if j > 0:
            loop+=1
            i = 0
        else:
            print(-1)
            flag=False

Fixed submission:
S = input()
T = input()

length = len(S)

ans = 0
pre = -1

for t in T:
    x = S.find(t, pre+1, length)
    if x != -1:
        ans += x - pre
        pre = x
    else:
        x = S.find(t, 0, pre+1)
        if x != -1:
            ans += length + x - pre
            pre = x
        else:
            ans = -1
            break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
flag = True
i = 0 # s
j = 0 # t
loop = 0
while(flag):
    if s[i]==t[j]:
        j+=1
        if j==len(t):
            print(i+loop*len(s)+1)
            flag=False
    i+=1
    if i == len(s):
        if j > 0:
            loop+=1
            i = 0
        else:
            print(-1)
            flag=False

Fixed submission:
S = input()
T = input()

length = len(S)

ans = 0
pre = -1

for t in T:
    x = S.find(t, pre+1, length)
    if x != -1:
        ans += x - pre
        pre = x
    else:
        x = S.find(t, 0, pre+1)
        if x != -1:
            ans += length + x - pre
            pre = x
        else:
            ans = -1
            break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# D
import numpy as np
S = input()
N = len(S)
dp = [[0 for i in range(13)] for j in range(N+5)]
mod = 10**9+7

dp[N][0] = 1
# DP = np.array(dp)
# print(DP)
mul = 1
for i in reversed(range(N)):
    if(S[i]=='?'):
        c = -1
    else:
        c = int(S[i])

    for j in range(10):
        if(c != -1 and c != j):
            continue
        for k in range(13):
            dp[i][(j*mul+k)%13] += dp[i+1][k]
            dp[i][(j*mul+k)%13] %= mod
    mul *=10
    mul %=13
# DP = np.array(dp)
result = dp[0][5]
# print(DP)
print(result)


Fixed submission:
S = input()
N = len(S)
dp = [[0 for i in range(13)] for j in range(N+5)]
mod = 10**9+7

dp[N][0] = 1
# DP = np.array(dp)
# print(DP)
mul = 1
for i in reversed(range(N)):
    if(S[i]=='?'):
        c = -1
    else:
        c = int(S[i])

    for j in range(10):
        if(c != -1 and c != j):
            continue
        for k in range(13):
            dp[i][(j*mul+k)%13] += dp[i+1][k]
            dp[i][(j*mul+k)%13] %= mod
    mul *=10
    mul %=13

# DP = np.array(dp)
result = dp[0][5]
# print(DP)
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
# C
N = int(input())
A=[]
for i in range(N):
    A.append(int(input()))
for i in range(len(A)):
    temp = A[i]
    A[i] = 0
    print(max(A))
    A[i] = temp

Fixed submission:
# C
N = int(input())
A=[]
for i in range(N):
    A.append(int(input()))
max1 = max(A)#一番手
max_index = A.index(max1)#index
A.remove(max1)
max2 = max(A)

for i in range(N):
    if i==max_index:
        print(max2)
    else:
        print(max1)
Buggy python submission (verdict: Runtime Error):
import math
def func1(lst, value):
    return [i+1 for i, x in enumerate(lst) if x == value]
N = int(input())
a = list(map(int,input().split()))

b = [0] * N
half = math.ceil(N/2)
summ = 0
for i in reversed(range(N)):
    # print(i)
    if i >= half-1:
        b[i] = a[i]
    else:
    x = N//(i+1)
    # print("x",x)
        if x == 1:
            b[i] = a[i]
        else:
            for j in range(x):
                # print(j)
                summ += a[(i+1)*(j+1)-1]
            summ -= a[i]
            # print("sum=",summ)
            judge=summ%2
            # print("judge",judge)
            if (judge==0 and a[i]==0) or (judge==1 and a[i]==1):
                b[i] = 0
            else:
                b[i] = 1
            summ = 0
            judge = 0
# print(b)
print(sum(b))
if sum(b) != 0:
    ans = func1(b,1)
    # print(ans)
    if len(ans)>1:
        ans = map(str,ans)
        print(" ".join(ans))
    else:
        print(ans.pop())

Fixed submission:
import math
def func1(lst, value):
    return [i+1 for i, x in enumerate(lst) if x == value]
N = int(input())
a = list(map(int,input().split()))

b = [0] * N
# half = math.ceil(N/2)
summ = 0
for i in reversed(range(N)):
# print(i)
    x = N//(i+1)
# print("x",x)
    if x == 1:
        b[i] = a[i]
    else:
        for j in range(x):
            # print(j)
            summ += b[(i+1)*(j+1)-1]
        # summ -= a[i]
        # print("sum=",summ)
        judge=summ%2
        # print("judge",judge)
        if (judge==0 and a[i]==0) or (judge==1 and a[i]==1):
            b[i] = 0
        else:
            b[i] = 1
        summ = 0
        judge = 0
# print(b)
print(sum(b))
if sum(b) != 0:
    ans = func1(b,1)
    # print(ans)
    if len(ans)>1:
        ans = map(str,ans)
        print(" ".join(ans))
    else:
        print(str(ans.pop()))
Buggy python submission (verdict: Runtime Error):
flag = True
S = input()
for i in range(1,len(S)):
  if S[i] == S[i-1]:
    flag = False

if flag:
  print("Good"):
else:
  print("Bad")
      
      

Fixed submission:
flag = True
S = input()
for i in range(1,len(S)):
  if S[i] == S[i-1]:
    flag = False

if flag:
  print("Good")
else:
  print("Bad")
Buggy python submission (verdict: Runtime Error):
import math
N,K = map(int,input().split())
p=0
for i in range(N):
    #   print(i)
    if i+1 >= K:
        X =0
    else:
        X = math.ceil((math.log2(K/(i+1))))
        # X = round(math.log2(K-1/(i+1))+1)
        # print(math.log2(K-1/(i+1))+1)
        # print(math.log2(K/(i+1)))
        # print(round(math.log2(K/(i+1))))
        # print(X)
        # print(math.log2(K/(i+1)))
        # print(X)
    p +=(1/2)**X
p = p/N
print(p)

Fixed submission:
#C
import math
N,K = map(int,input().split())
p=0
for i in range(N):
    #   print(i)
    if i+1 >= K:
        X =0
    else:
        X = math.ceil((math.log2(K/(i+1))))
    p +=(1/2)**X
p = p/N
print(p)
Buggy python submission (verdict: Runtime Error):
N = 6
a = [input() for i in range(N)]
if (a[4] - a[0])>a[5]:
    print(":(")
else:
    print("Yay!")

Fixed submission:
N = 6
a = [int(input()) for i in range(N)]
if (a[4] - a[0])>a[5]:
    print(":(")
else:
    print("Yay!")
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = input()
r = 0
b = 0
for cap in s:
    if cap == 'R':
        r+=1
    elif cap == 'B':
        b+=1
if r>b:
    print('Yes')
else:
    print('No')

Fixed submission:
a,b,c = (int(x) for x in input().split())
if a == b and b == c:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = input()
r = 0
b = 0
for cap in s:
    if cap == 'R':
        r+=1
    elif cap == 'B':
        b+=1
if r>b:
    print('Yes')
else:
    print('No')

Fixed submission:
a,b,c = (int(x) for x in input().split())
if a == b and b == c:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math

K = int(input())
ans = 0

for i in range(K):
    for j in range(K):
        for k in range(K):
            ans += math.gcd(math.gcd(i+1, j+1), k+1)

print(ans)


Fixed submission:
from math import gcd

K = int(input())

ans = 0

for a in range(1, K+1):
    for b in range(1, K+1):
        g = gcd(a, b)
        for c in range(1, K+1):
            ans += gcd(g, c)

print(ans)

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

K = int(input())
ans = 0

def func(a, b, c):
    x = math.gcd(a, b)
    return math.gcd(x, c)

for i in range(K):
    for j in range(K):
        for k in range(K):
            ans += func(i+1, j+1, k+1)

print(ans)


Fixed submission:
from math import gcd

K = int(input())

ans = 0

for a in range(1, K+1):
    for b in range(1, K+1):
        g = gcd(a, b)
        for c in range(1, K+1):
            ans += gcd(g, c)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
H, W = map(int, input().split())

ans = 0
for i in range(H):
    for j in range(W):
        if (i+j) % 2 == 0:
            ans += 1

print(ans)



Fixed submission:
import math

H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
else:
    o = math.ceil(W/2)
    e = W//2

    if H % 2 == 0:
        print((o+e)*(H//2))
    else:
        print((o+e)*(H//2) + o)
Buggy python submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())
ans = -1
a1 = math.ceil(A*12.5)
a2 = (A+1)*12.5

a = [i for i in range(a1, int(a2)) if i < a2]

b1 = B*10
b2 = (B+1)*10

b = list(range(b1, b2))

for i in a:
    if i in b:
        ans = i
        break

print(ans)




Fixed submission:
s = input()

ans = 'Yes'

if (s[0] == s[1] == s[2]):
    ans = 'No'

print(ans)