import sys
import math
# 定义域为x>0, 先增大后减小, f的导数为0时为最大值
for line in sys.stdin:
a,b = map(int,line.strip().split())
x = 1 / (b*math.log(a))
f = math.log(x, a) - b * x
print(round(f, 10))

import sys
import math
# 定义域为x>0, 先增大后减小, f的导数为0时为最大值
for line in sys.stdin:
a,b = map(int,line.strip().split())
x = 1 / (b*math.log(a))
f = math.log(x, a) - b * x
print(round(f, 10))