Harryxun/stf_run huggingface dataset:
import math
n,m=map(int,input().split())

if abs(n-m)>=2:
    ans=0
else:
    nn=math.factorial(n)
    mm=math.factorial(m)
    ans = nn*mm
print(ans%(10**9+7) if nn !=mm else (ans*2)%(10**9+7))

### FIXED CODE ###

import math
n,m=map(int,input().split())

if abs(n-m)>=2:
    ans=0
else:
    nn=math.factorial(n)
    mm=math.factorial(m)
    ans = nn*mm
print(0 if ans==0 else ans%(10**9+7) if nn !=mm else (ans*2)%(10**9+7))
N , X = map(int,input().split())
L = list(input())
cnt = 1
b = 0
lst = list()
for i in range(N + 1):
    if int(len(L) / 2) + 1 > i   :
        lst.append(int(L[i*2]))
    else :
        break
for j in range (N + 1):
    print(b)
    b += lst[j]
    cnt += 1
    if b+lst[j+1] > X :
        break
    if cnt == N:
        break
print(cnt)


### FIXED CODE ###

N , X = map(int,input().split())
L=list(map(int,input().split()))
b = 0
cnt = 1
for i in range(N):
    b += L[i]
    if b <= X   :
        cnt+=1
    else:
        break
print(cnt)
a = input()
b = input()
c = input()
A, B, C = len(a), len(b), len(c)
ab, bc, ac = [1] * 12000, [1] * 12000, [1] * 120000

for i in range(A):
    if a[i] == '?':
        continue
    for j in range(B):
        if b[j] == '?':
            continue
        if a[i] != b[j]:
            ab[i-j+6000]= 0
for i in range(B):
    if b[i] == '?':
        continue
    for j in range(C):
        if c[j] == '?':
            continue
        if b[i] != c[j]:
            bc[i-j 6000]= 0
for i in range(A):
    if a[i] == '?':
        continue
    for j in range(C):
        if c[j] == '?':
            continue
        if a[i] != c[j]:
            ac[i-j+6000]= 0
ans = 6000

for i in range(-4000, 4000):
    for j in range(-4000, 4000):
        if ab[i+6000] and bc[j-i+6000] and ac[j+6000]:
            L = min(0, min(i, j))
            R = max(A, max(B+i, C+j))
            ans = min(ans, R-L)
print(ans)    

### FIXED CODE ###

a = input()
b = input()
c = input()
A, B, C = len(a), len(b), len(c)
ab, bc, ac = [1] * 16000, [1] * 16000, [1] * 16000

for i in range(A):
    if a[i] == '?':
        continue
    for j in range(B):
        if b[j] != '?' and a[i] != b[j]:
            ab[i-j+8000]= 0
for i in range(B):
    if b[i] == '?':
        continue
    for j in range(C):
        if c[j] != '?' and b[i] != c[j]:
            bc[i-j+8000]= 0
for i in range(A):
    if a[i] == '?':
        continue
    for j in range(C):
        if c[j] != '?' and a[i] != c[j]:
            ac[i-j+8000]= 0
ans = 6000

for i in range(-4000, 4000):
    for j in range(-4000, 4000):
        if ab[i+8000] and bc[j-i+8000] and ac[j+8000]:
            L = min(0, min(i, j))
            R = max(A, max(B+i, C+j))
            ans = min(ans, R-L)
print(ans)
x, y = map(int, input().split())
 
cnt = 0
for i in range(1, 13):
    for j in range(1, 13):
        if x == i and y >== j:
            cnt += 1
print(cnt)

### FIXED CODE ###

x, y = map(int, input().split())

if x <= y:
  print(x)
else:
  print(x-1)
a,b=map(int,input().split())
print(max(a-b))

### FIXED CODE ###

a,b=map(int,input().split())
print("0" if a-b<0 else a-b)
d,t,s = int(input().split())
if d/s <= t: 
    print("Yes")
else:
    print("No") 

### FIXED CODE ###

d,t,s = input().split()
if int(d)/int(s) <= int(t): 
    print("Yes")
else:
    print("No")
n,q=map(int,input().split())
s=input()
p=[input().split() for i in range(q)]
def judge_l(x):
    for(k,v)in p:
        if k==s[x]:
            if v=="L":
                x-=1
            else:
                x+=1
        if x<0:
            return True
        elif x>n-1:
            return False
    return False

def judge_r(x):
    for(k,v)in p:
        if k==s[x]:
            if v=="L":
                x-=1
            else:
                x+=1
        if x<0:
            return False
        elif x>n-1:
            return True
    return False

ok=0
ng=n+1

while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if judge_l(mid):
        ok=mid
    else:
        ng=mid
l=ok+1

ok=n
ng=-1

while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if judge_r(mid):
        ok=mid
    else:
        ng=mid
r=n-ok
#print(l,r)
print(max(n-l-r,0))

### FIXED CODE ###

n,q=map(int,input().split())
s=[0]+list(input())+[0]
a=[input().split()for i in range(q)][::-1]
l,r=0,n+1
for(m,h)in a:
    if m==s[l+1]and h=="L":
        l+=1
    elif m==s[l]and h=="R":
        l-=1
    if m==s[r-1]and h=="R":
        r-=1
    elif m==s[r]and h=="L":
        r+=1
print(max(0,r-l-1))
from collections import deque
def check():
    S = input()
    x, y = map(int, input().split())
    fs = list(map(len,S.split('T')))
    if len(fs)<3:
        if x != fs[0]:
            return False
        if len(fs)==1:
            if y == 0:
                return True
            else:
                return False
        if y != fs[1] and y != -fs[1]:
            return False
        return True
    xs = fs[2::2]
    ys = fs[1::2]
    xs.sort(reverse = True)
    N = len(xs)
    M = len(ys)
    cum = [0]*(N+1)
    for i in range(N-1,-1,-1):
        cum[i] = cum[i+1]+xs[i]
    pos = deque([fs[0]-x])
    for i in range(N):
        l = len(pos)
        if l == 0:
            return False
        for _ in range(l):
            d = pos.popleft()
            if abs(d+xs[i])<=cum[i+1] and d+xs[i] not in pos:
                pos.append(d+xs[i])
            if abs(d-xs[i])<=cum[i+1] and d-xs[i] not in pos:
                pos.append(d-xs[i])
    if 0 not in pos:
        return False
    ys.sort(reverse = True)
    cum = [ys[-1]]*(M+1)
    for i in range(M-1,-1,-1):
        cum[i] = cum[i+1]+ys[i]
    pos = deque([0])
    for i in range(M):
        l = len(pos)
        if l == 0:
            return False
        for _ in range(l):
            d = pos.popleft()
            if abs(d+ys[i]-y)<=cum[i+1] and d+xs[i] not in pos:
                pos.append(d+ys[i])
            if abs(d-ys[i]-y)<=cum[i+1] and d-xs[i] not in pos:
                pos.append(d-ys[i])
    if y not in pos:
        return False
    return True
if check():
    print('Yes')
else:
    print('No')


### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10**8)

def dp(dp_l,i,N,xs,cum,now):
    if i == N:
        if now == 0:
            return True
        return False
    if abs(now) > cum[i]:
        return False
    if dp_l[i][abs(now)] != -1:
        return dp_l[i][abs(now)]
    dp_l[i][abs(now)] = dp(dp_l,i+1,N,xs,cum,now+xs[i]) or dp(dp_l,i+1,N,xs,cum,now-xs[i])
    return dp_l[i][abs(now)]

def check():
    S = input()
    x, y = map(int, input().split())
    fs = list(map(len,S.split('T')))
    if len(fs)<3:
        if x != fs[0]:
            return False
        if len(fs)==1:
            if y == 0:
                return True
            else:
                return False
        if y != fs[1] and y != -fs[1]:
            return False
        return True
    xs = fs[2::2]
    ys = fs[1::2]
    xs.sort(reverse = True)
    N = len(xs)
    M = len(ys)
    cum = [0]*(N+1)
    for i in range(N-1,-1,-1):
        cum[i] = cum[i+1]+xs[i]
    dp_l = [[-1]*(cum[0]+1) for _ in range(N)]
    if not dp(dp_l,0,N,xs,cum,fs[0]-x):
        return False
    ys.sort(reverse = True)
    cum = [ys[-1]]*(M+1)
    for i in range(M-1,-1,-1):
        cum[i] = cum[i+1]+ys[i]
    dp_l = [[-1]*(cum[0]+1) for _ in range(M)]
    if not dp(dp_l,0,M,ys,cum,-y):
        return False
    return True
if check():
    print('Yes')
else:
    print('No')
def main():
  h,*s=open(0)
  h,w,k=map(int,h.split())
  s=[list(map(int,t[:w]))for t in s]
  m=9e9
  for i in range(1<<h-1):
    t,v,l=[],0,1
    for j in range(h):
      if i>>j&1:
        t+=j+1,
        l+=1
    t+=h,
    c=[0]*l
    for i in range(w):
      b=f=g=0
      u=[]
      for j,x in enumerate(t):
        d,b=sum(s[j][i]for j in range(b,x)),x
        u+=d,
        if d>k:
          g=1
          break
        c[j]+=d
        f|=c[j]>k
      else:
        if f:
          c=u
          v+=1
      if g:break
    else:
      if v+l-1<m:m=v+l-1
  print(m)
main()

### FIXED CODE ###

s=input();n=len(s)//2;print('YNeos'[s!=s[::-1]or s[:n]!=s[n-1::-1]::2])
N, M = [int(n) for n in input().split()]
    X = sorted([int(n) for n in input().split()])
    if N>=M:
        print(0)
    else:
        dx = []
        for j in range(M-1):
            dx.append(X[j+1]-X[j])
        ans = sorted(dx, reverse=True)
        print(sum(ans[N-1:]))

### FIXED CODE ###

N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >= M:
    print(0)
    exit()
X.sort()
leng = []
for i in range(1, M):
    leng.append(X[i] - X[i-1])
ans = sorted(leng, reverse = True)
print(sum(ans[N - 1:]))
input()
print(len(set([input().split()]))

### FIXED CODE ###

input()
n = len(set(input().split()))
print("Three" if n == 3 else "Four")
import sys
n = input()
a = map(int, raw_input().split())
for i in range(n):
  sys.stdout.write('%d ') % a[n-1]

### FIXED CODE ###

import sys
n = input()
a = map(int, raw_input().split())
for i in range(n):
  sys.stdout.write('%d' % a[n-i-1])
  if i != n-1:
    sys.stdout.write(' ')
sys.stdout.write('\n')
# check
if N < 357:
    print(0)
else:
    cnt = 1
    for n in range(358, N + 1):
        if set(str(n)) == set(['7', '5', '3']):
            cnt += 1
    print(cnt)

### FIXED CODE ###

from itertools import product

# input
N = int(input())

# check
if N < 357:
    print(0)
else:
    max_dig = len(str(N))
    dig = 3
    sgs_nuns = []
    sgs = {"7", "5", "3"}
    str_join = "".join
    for n in range(3, max_dig + 1):
        sgs_nuns += [
            str_join(n)
            for n in product(["7", "5", "3"], repeat=n)
            if set(str_join(n)) == sgs and int(str_join(n)) <= N
        ]

    cnt = len(sgs_nuns)
    print(cnt)
def main():
  ans = [-1, -1, -1]
  N, Y = map(int, input().split())
  for a in range(N+1):
    for b in range(N+1):
      for c in range(N+1):
        if 1000*a + 5000*b + 10000*c == Y and a + b + c = N:
          ans = [a, b, c]
  print(*ans)
if __name__ == "__main__":
  main()
      


### FIXED CODE ###

def main():
  ans = [-1, -1, -1]
  N, Y = map(int, input().split())
  for i in range(N+1):
    for j in range(N+1-i):
      if 1000*i + 5000*j + 10000*(N-i-j) == Y:
        ans = [N-i-j, j, i]
  print(*ans)
if __name__ == "__main__":
  main()
r = int(input())
print("{:.6f}".format(π*(r*r)),"{:.6f}".format(2*π*r))


### FIXED CODE ###

import math
r = float(input())
print((r**2)*math.pi,r*2*math.pi)
MOD = 10**9 + 7

def prod(a):
    res = 1
    for x in a:
        res = (res * x) % MOD
    return res

def solve(n, k, a):
    if k == 1:
        return max(a)
    elif k == n:
        return prod(a)
    elif max(a) < 0:
        a = sorted(a, reverse=True)
        return prod(a[:k])
    else:
        a = sorted(a, key=lambda x: -abs(x))
        num_negative = len(list(filter(lambda x: x < 0, a[:k])))
        if num_negative % 2 == 0:
            return prod(a[:k])
        else:
            i1, j1 = None, None
            for i in range(k):
                if a[i] < 0:
                    i1 = i
            for j in range(k,n):
                if a[j] >= 0:
                    j1 = j
                    break
            i2, j2 = None, None
            for i in range(k):
                if a[i] >= 0:
                    i2 = i
            for j in range(k, n):
                if a[j] < 0:
                    j2 = j
                    break
            if (i1 is None) or (j1 is None):
                return prod(a[:i2] + a[i2+1:k] + [a[j2]])
            elif (i2 is None) or (j2 is None):
                return prod(a[:i1] + a[i1+1:k] + [a[j1]])
            elif abs(a[j1] * a[i2]) > abs(a[i1] * b[j2]):
                return prod(a[:i1] + a[i1+1:k] + [a[j1]])
            else:
                return prod(a[:i2] + a[i2+1:k] + [a[j2]])

n, k = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, k, a))

### FIXED CODE ###

MOD = 10**9 + 7

def prod(a):
    res = 1
    for x in a:
        res = (res * x) % MOD
    return res

def solve(n, k, a):
    if k == 1:
        return max(a)
    elif k == n:
        return prod(a)
    elif (max(a) < 0) and (k % 2 == 1):
        a = sorted(a, reverse=True)
        return prod(a[:k])
    else:
        a = sorted(a, key=lambda x: -abs(x))
        num_negative = len(list(filter(lambda x: x < 0, a[:k])))
        if num_negative % 2 == 0:
            return prod(a[:k])
        else:
            i1, j1 = None, None
            for i in range(k):
                if a[i] < 0:
                    i1 = i
            for j in range(k,n):
                if a[j] >= 0:
                    j1 = j
                    break
            i2, j2 = None, None
            for i in range(k):
                if a[i] >= 0:
                    i2 = i
            for j in range(k, n):
                if a[j] < 0:
                    j2 = j
                    break
            if ((i1 is None) or (j1 is None)) and ((i2 is None) or (j2 is None)):
                return prod(a[:k])
            elif (i1 is None) or (j1 is None):
                return prod(a[:i2] + a[i2+1:k] + [a[j2]])
            elif (i2 is None) or (j2 is None):
                return prod(a[:i1] + a[i1+1:k] + [a[j1]])
            elif abs(a[j1] * a[i2]) > abs(a[i1] * a[j2]):
                return prod(a[:i1] + a[i1+1:k] + [a[j1]])
            else:
                return prod(a[:i2] + a[i2+1:k] + [a[j2]])

n, k = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, k, a))
N, M = list(map(int, input().split()))
L = {}
D = [[0, i] for i in range(N+1)]

for i in range(N + M - 1):
  Data = list(map(int, input().split()))
  if Data[0] in L:
    L[Data[0]].append(Data[1])
  else:
    L[Data[0]] = [Data[1]]
  D[Data[1]][0] += 1

for i in range(1, N+1):
  if D[i][0] == 0:
    s = D[i][1]
    break

P = [[0, 0] for i in range(N + 1)]
S = []
t = L[s]
for i in t:
  S.append([s, i])
  P[i] = [1, s]

cnt = 0
print(P)
while True:
  j = S[cnt][1]
  if j not in L:
    cnt += 1
    continue
  t = L[j]
  for i in t:
    if P[i][0] != 0:
      if P[i][0] < P[j][0] + 1:
        #削除
        L[P[i][1]].remove(i)
        #更新
        P[i] = [P[j][0] + 1, j] 
        M -= 1
      else:
        # 削除
        L[P[j][1]].remove(j)
        M -= 1
  print(P)
  print(L)
  if M == 0:
    break
  cnt += 1


### FIXED CODE ###

def main():
  N, M = list(map(int, input().split()))
  inN = [0 for i in range(N)]
  outN = [[] for i in range(N)]
  
  for i in range(N + M - 1):
    Data = list(map(int, input().split()))
    inN[Data[1] - 1] += 1
    outN[Data[0] - 1].append(Data[1] - 1)
  
  D = []
  for i in range(N):
    if inN[i] == 0:
      D.append(i)
      
  L = []
  while D != []:
    t = D.pop()
    L.append(t)
    for i in outN[t]:
      inN[i] -= 1
      if inN[i] == 0:
        D.append(i)
   
  Ans = [0 for i in range(N)]
  for i in L:
    for j in outN[i]:
      Ans[j] = i + 1
      
  for i in Ans:
    print(i)
main()
N,M = list(map(int,input().split()))

ball_list = [1 for i in range(N)]
flag_list = [False for i in range(N)]
flag_list[0] = True

for i in range(M):
    x,y = list(map(int,input().split()))
    if flag_list[x-1]:
        flag_list[y-1]=True
        if ball_list[x-1]==1:
            flag_list[x-1]=False
    ball_list[x-1]-=1
    ball_list[y-1]+=1
count=0    
for i in range(M):
    if flag_list[i]:
        count+=1

print(count)

### FIXED CODE ###

N,M = list(map(int,input().split()))

ball_list = [1 for i in range(N)]
flag_list = [False for i in range(N)]
flag_list[0] = True

for i in range(M):
    x,y = list(map(int,input().split()))
    if flag_list[x-1]:
        flag_list[y-1]=True
        if ball_list[x-1]==1:
            flag_list[x-1]=False
    ball_list[x-1]-=1
    ball_list[y-1]+=1
count=0    
for i in range(N):
    if flag_list[i]:
        count+=1

print(count)
import sys
x = int(input())
i = 1
while True:
    if i*(i+1)//2 >= x:
        print(i)
        sys.exit() 
    i += 1


### FIXED CODE ###

a,b = input().split()
ans = 'H' if a == b else 'D'
print(ans)
import math

def lcm(x,y):
     return x * y // math.gcd(x,y)

a,b,c,d = map(int,input().split())

countB = b - (b // c) - (b // d) + (b // lcm(c,d))
countA = a - 1 - ((a - 1) // c) - ((a - 1) // d) + ((a - 1) // lcm(c,d))

print(countB - countA)


### FIXED CODE ###

import fractions

def lcm(x,y):
     return x * y // fractions.gcd(x,y)

a,b,c,d = map(int,input().split())

countB = b - (b // c) - (b // d) + (b // lcm(c,d))
countA = a - 1 - ((a - 1) // c) - ((a - 1) // d) + ((a - 1) // lcm(c,d))

print(countB - countA)
n,x = map(int,input().split())
bound = list(map(int,input().split()))
cnt = 0
pos = 0
for i in range(n+1):
  cnt += 1
  pos += bound[i]
  if pos > x:
    break
print(cnt)

### FIXED CODE ###

n,x = map(int,input().split())
bound = list(map(int,input().split()))
cnt = 1
pos = 0
for i in range(n):
  pos += bound[i]
  if pos <= x:
    cnt += 1
  if pos > x:
    break
print(cnt)
n = int(input())
if n % 2 == 0:
      print(1/2)
elif n == 1:
      print(1)
else:
      print((int(n/2)+ １／n))

### FIXED CODE ###

n=int(input())
if n%2 == 0:
  print(1/2)
elif n==1:
  print(1)
else:
  print((int(n/2)+1)/n)
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

import numpy as np

def main():
    N = int(input())
    Ds = np.array([int(d) for d in input().split()])

    Ds.sort()
    if Ds[Ds==0].size != 1:
        print(0)
        return
    Ds = Ds[1:]

    l = 0
    r = 1
    c = []
    while len(Ds) > 0:
        l = l + 1
        cnt = Ds[Ds==l].size
        c.append((r, cnt))
        r = cnt
        Ds = Ds[cnt:]
        
    ans = 1
    divider = 998244353
    for i, j in c:
        r = (i**j)%divider
        ans = (ans*r)%divider
    
    print(ans)

# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("nikkei2019-2-qual","b",main)


### FIXED CODE ###

#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

import math

def func(i, j, d):
    if i <= 1:
        return 1
    e = j
    b = int(math.log2(d)/math.log2(i))
    ret = 1
    while e > b:
        ret = ret*(i**b%d)
        e = e - b
    else:
        if e > 0:
            ret = ret*(i**e%d)
    return ret


def main():
    N = int(input())
    Ds = [int(d) for d in input().split()]

    if Ds[0] != 0:
        print(0)
        return

    Ds.sort()
    if Ds[1] == 0:
        print(0)
        return

    i = 1
    l = 1
    r = 1
    ans = 1
    divider = 998244353

    while i < N:
        cnt = 0
        while i < N and Ds[i] == l:
            cnt = cnt + 1
            i = i + 1
        if cnt == 0:
            print(0)
            return

        ans = ans*func(r, cnt, divider)%divider
        r = cnt
        l = l + 1
    
    print(ans)

# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("nikkei2019-2-qual","b",main)
N = input().rstrip()
n = N[0]
k = N[1]

h = list(map(int,input().split()))
h.sort(reverse=True)

m = 0
hit = 0
if k >= n :
  m = n
else:
  for i in range(k,n):
    hit += h[i]
  
  m = k + hit
  
print(m)

### FIXED CODE ###

N = list(map(int,input().rstrip().split()))
n = N[0]
k = N[1]

h = list(map(int,input().split()))
h.sort(reverse=True)

m = 0
hit = 0
if k >= n :
  m = 0
else:
  for i in range(k,n):
    hit += h[i]
  
  m = hit
print(m)
N, M = map(int, input().split())

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

L = [list(map(int, input().split())) for _ in range(M)]

L.sort(reverse=True, key=lambda x:x[1])
A.sort()


ans = 0
i = 0
j = 0
k = 0
for i in range(N):
    if j < M:
        if A[i] < L[j][1]:
            ans += L[j][1]
            k += 1
            
        else:
            ans += A[i]
        
    else:
        ans += A[i]
        
    if k == L[j][0]:
        k = 0
        j += 1
        
print(ans)
    

### FIXED CODE ###

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

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

L = [list(map(int, input().split())) for _ in range(M)]

L.sort(reverse=True, key=lambda x:x[1])
A.sort()


ans = 0
i = 0
j = 0
k = 0
for i in range(N):
    if j < M:
        if A[i] < L[j][1]:
            ans += L[j][1]
            k += 1
            
        else:
            ans += A[i]
        
        
        if k == L[j][0]:
            k = 0
            j += 1
            
    else:
        ans += A[i]
        

        
print(ans)
S = input()
count = 0
list = []

for c in S:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    count+=1
  else:
    list.append(count)
    count = 0

if not list:
    print(0)
else
    print(max(list))
    

### FIXED CODE ###

S = input()
count = 0
list = []

for c in S:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    count+=1
  else:
    list.append(count)
    count = 0
list.append(count)

if len(list)==0:
    print('0')
else:
    print(max(list))
N = int(input)
print(N // 3)

### FIXED CODE ###

N = int(input())
print(N // 3)
d = {}
N = int(input())

for _ in range(N):
    s = str(input())
    if s in d.keys():
        d[s] += 1
    else:
        d[s] = 1

ans = []

for i in range(len(sd)):
    if sd[i][1] == max(d.values()):
        ans.append(sd[i][0])

ans = sorted(ans)
for _ in range(len(ans)):
    print(ans[_])

### FIXED CODE ###

N = int(input())
l = []

for _ in range(N):
    s = str(input())
    l.append(s)

import collections
c = collections.Counter(l)
c = c.most_common()

most_count = c[0][1]
c.sort()

for i in range(len(c)):
    if c[i][1] == most_count:
        print(c[i][0])
import math, decimal

memo = [1,2,4,8,16,32,64,128,256,512,1024,2048]
def twopow(f):
    if len(memo) < f:
        return memo[f]
    else:
        repeat = f - len(memo) + 1
        for _ in range(repeat):
            memo.append(memo[len(memo)-1]*2)
        return memo[f]

n, k = map(int,input().split())
per = 0
for i in range(1, n+1):
    x = math.ceil(math.sqrt(k/i)) if k > i else 0
    per += 1/twopow(x)

print(per/n)

### FIXED CODE ###

n, k = map(int,input().split())
per = 0
for i in range(1, n+1):
    # x = math.ceil(math.sqrt(k/i)) if k > i else 0
    x = 0
    t = i
    while t < k:
        t *= 2
        x += 1
    # per += float("{:.20g}".format(1/(2**x)))
    per += 2**-x

print(per/n)
A, B, C, X, Y = map(int, input().split())
if A + B < 2 * C:
    ans = A * X + B * Y
elif A + B > 2 * C:
    nokori = abs(X - Y)
    if X >= Y and A >= 2 * C:
        ans = C * 2 * X
    if Y >= X and B >= 2 * C:
        ans = C * 2 * Y
    if X > Y and A < 2 * C:
        ans = C * 2 * Y + nokori * A
    if Y > X and B < 2 * C:
        ans = C * 2 * X + nokori * B
print(ans)

### FIXED CODE ###

A, B, C, X, Y = map(int, input().split())
    

if X >= Y:
    ans = min(A*X + B*Y, 2*C*Y + A*(X-Y), 2*C*X)
else:
    ans = min(A*X + B*Y, 2*C*X + B*(Y-X), 2*C*Y)

print(ans)
a,b=map(input().split(" "))
c,d=map(input().split(" "))
print((a-c)*(b-d))

### FIXED CODE ###

a,b=map(int,input().split(" "))
c,d=map(int,input().split(" "))
print((a-c)*(b-d))
import math
try:
    a,b,c,d=map(int,input().split())

    def lcm(x,y):
        return (x*y)//math.gcd(x,y)

    def ans_cnt(i,y,z):
        return i - (i//y + i//z - i//lcm(y,z))

    print(ans_cnt(b,c,d)-ans_cnt(a-1,c,d))
except EOFError:
    break

### FIXED CODE ###

from fractions import gcd
a,b,c,d=map(int,input().split())

def lcm(x,y):
    return (x*y)//gcd(x,y)

def ans_cnt(i,y,z):
    return i - (i//y + i//z - i//lcm(y,z))

print(ans_cnt(b,c,d)-ans_cnt(a-1,c,d))
n, a, b = list(map(int, input().split()))
roop = n // (a +b)
extra = n - roop*(a+b)
result = a*roop
cycle = [1]*a +  [0]*b
if extra != 0:
  result += sum(cycle[:extra]) 
print(result)

### FIXED CODE ###

n, a, b = list(map(int, input().split()))
result = 0
if a + b != 0:
  roop = n // (a +b)
  extra = n - roop*(a+b)
  result = a*roop
  if extra >= a:
    result += a
  else:
    result += extra
print(result)
H, M = map(int, input().split())
src_image = [list(input().split() for i in range(H))]
for i in range(H):
    print(*src_image[i])
    print(*src_image[i])

### FIXED CODE ###

H, M = map(int, input().split())
src_image = [list(input().split()) for i in range(H)]
for i in range(H):
    print(*src_image[i])
    print(*src_image[i])