Twilight Sparkle was playing Ludo with her friends Rainbow Dash, Apple Jack and Flutter Shy. But she kept losing. Having returned to the castle, Twilight Sparkle became interested in the dice that were used in the game.

The dice has m faces: the first face of the dice contains a dot, the second one contains two dots, and so on, the m-th face contains m dots. Twilight Sparkle is sure that when the dice is tossed, each face appears with probability $\frac{1}{m}$. Also she knows that each toss is independent from others. Help her to calculate the expected maximum number of dots she could get after tossing the dice n times.


-----Input-----

A single line contains two integers m and n (1 ≤ m, n ≤ 10^5).


-----Output-----

Output a single real number corresponding to the expected maximum. The answer will be considered correct if its relative or absolute error doesn't exceed 10 ^{ - 4}.


-----Examples-----
Input
6 1

Output
3.500000000000

Input
6 3

Output
4.958333333333

Input
2 2

Output
1.750000000000



-----Note-----

Consider the third test example. If you've made two tosses:  You can get 1 in the first toss, and 2 in the second. Maximum equals to 2.  You can get 1 in the first toss, and 1 in the second. Maximum equals to 1.  You can get 2 in the first toss, and 1 in the second. Maximum equals to 2.  You can get 2 in the first toss, and 2 in the second. Maximum equals to 2. 

The probability of each outcome is 0.25, that is expectation equals to: $(2 + 1 + 2 + 2) \cdot 0.25 = \frac{7}{4}$

You can read about expectation using the following link: http://en.wikipedia.org/wiki/Expected_value

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Probability


Solutions:
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	(m, n) = map(int, input().split())
	ans = 0
	cur = 0
	for s in range(m):
		temp = ((s + 1) / m) ** n
		ans += (s + 1) * (temp - cur)
		cur = temp
	print(ans)
main()


vals = input()
v = vals.split()
n = int(v[0])
m = int(v[1])
res = 0
for i in range(1, n + 1):
	res = res + i * (pow(i / n, m) - pow((i - 1) / n, m))
print(res)


inp = list(map(int, input().split()))
(m, n) = inp
ans = m
for i in range(1, m):
	ans -= pow(i / m, n)
print(ans)


def main():
	(m, n) = read()
	print(m - sum(((i / m) ** n for i in range(1, m))))

def read(mode=2):
	inputs = input().strip()
	if mode == 0:
		return inputs
	if mode == 1:
		return inputs.split()
	if mode == 2:
		return map(int, inputs.split())

def read_str():
	return read(0)

def read_int():
	return read(2)[0]

def write(s='\n'):
	if isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='')
main()


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import collections as col

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	(M, N) = getInts()
	ans = 0
	for x in range(1, M + 1):
		tmp = pow(x / M, N) * (1 - pow((x - 1) / x, N)) / (1 - (x - 1) / x)
		ans += tmp
	return ans
print(solve())


def second_solution(m, n):
	res = sum([i * ((i / m) ** n - ((i - 1) / m) ** n) for i in range(1, m + 1)])
	print('%.12f' % res)

def main():
	(m, n) = map(int, input().split())
	second_solution(m, n)
main()


(m, n) = map(int, input().split())
t = [pow(1 - i / m, n) for i in range(m + 1)]
print(sum(((t[i] - t[i + 1]) * (m - i) for i in range(m))))


(m, n) = list(map(int, input().split(' ')))
sumx = 0
for i in range(1, m + 1):
	sumx += i * ((i / m) ** n - ((i - 1) / m) ** n)
print(sumx)


from math import pow
(m, n) = input().split()
(m, n) = (int(m), int(n))
res = 0
for i in range(1, m):
	res += (i / m) ** n
print(m - res)


(n, m) = [int(i) for i in input().split()]
num = 0
for i in range(n, 0, -1):
	num += ((i / n) ** m - ((i - 1) / n) ** m) * i
print(num)


import math
(m, n) = map(int, input().split())
e = 0
for i in range(1, m + 1):
	e += i * (math.pow(i / m, n) - math.pow((i - 1) / m, n))
print(e)


(m, n) = map(int, input().split())
pvar = 0
ans = 0
for i in range(1, m + 1):
	var = (i / m) ** n
	ans += i * (var - pvar)
	pvar = var
print(ans)


(m, n) = [int(i) for i in input().split()]
ans = 0
for i in range(1, m + 1):
	tmp_a = pow(i / m, n)
	tmp_b = pow((i - 1) / m, n)
	ans += i * (tmp_a - tmp_b)
print(ans)


import math

def solve():
	(m, n) = input().strip().split()
	m = int(m)
	n = int(n)
	ans = 0.0
	for i in range(0, m + 1):
		ans += i * (pow(i / m, n) - pow((i - 1) / m, n))
	return ans
print(solve())


(m, n) = list(map(int, input().split()))
P = 1
ans = 0
while m > 0:
	p = P * (1 - ((m - 1) / m) ** n)
	ans += m * p
	m -= 1
	P -= p
print(ans)


from math import pow
(m, n) = map(int, input().split())
r = 0
for i in range(m):
	r += (i + 1) * (pow((i + 1) / m, n) - pow(i / m, n))
print(r)


import sys
import itertools
import math
import collections
from collections import Counter

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)
(m, n) = mi()
r = 0
for i in range(1, m):
	r += (i / m) ** n
print(m - r)


def main():
	(m, n) = map(int, input().split())
	s = 0
	for i in range(m + 1):
		s += i * ((i / m) ** n - ((i - 1) / m) ** n)
	print(s)
main()


import sys, os, io
import math, bisect, operator
(inf, mod) = (float('inf'), 10 ** 9 + 7)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
Neo = lambda : list(map(int, input().split()))
(m, n) = Neo()
e = 0
for i in range(1, m + 1):
	e += i * ((i / m) ** n - ((i - 1) / m) ** n)
print(e)


(m, n) = map(int, input().split())
bs = m
for i in range(1, m):
	bs -= (i / m) ** n
print(bs)


import sys, math
from collections import deque

def solve():
	return

def poo(x, p):
	if p == 0:
		return 1
	a = poo(x, p // 2)
	if p % 2 == 0:
		return a * a
	else:
		return a * a * x
(m, n) = map(int, input().split())
ans = 0
for i in range(1, m + 1):
	ans += i * (poo(i / m, n) - poo((i - 1) / m, n))
print(ans)


def f(m, n):
	ans = 0
	for i in range(1, m + 1):
		ans += ((i / m) ** n - ((i - 1) / m) ** n) * i
	return ans
print(f(*map(int, input().split())))


import sys
(m, n) = list(map(int, input().strip().split()))
sum = m ** (-n)
for i in range(2, m + 1):
	sum += ((i / m) ** n - ((i - 1) / m) ** n) * i
print(sum)


def main():
	args = input().split()
	m = int(args[0])
	n = int(args[1])
	res = 0
	for i in range(1, m + 1):
		res += i * ((i / m) ** n - ((i - 1) / m) ** n)
	print(res)
main()


import sys, math, string, fractions, functools, collections
sys.setrecursionlimit(10 ** 7)
RI = lambda x=' ': list(map(int, input().rstrip().split(x)))
RS = lambda x=' ': input().rstrip().split(x)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
mod = int(1000000000.0 + 7)
eps = 1e-06
MAX = 1010
ans = 0
(m, n) = RI()
for i in range(1, m + 1):
	ans += i * (pow(i / m, n) - pow((i - 1) / m, n))
print('%.12f' % ans)


(m, n) = map(int, input().split())
print(m - sum(((i / m) ** n for i in range(m))))


(m, n) = map(int, input().split())
ret = m
for i in range(m):
	ret -= pow(i / m, n)
print(ret)


(m, n) = map(int, input().split())
powers = []
for j in range(m + 1):
	powers.append(pow(j / m, n))
print(sum((j * (powers[j] - powers[j - 1]) for j in range(1, m + 1))))


(n, m) = map(int, input().split(' '))
ans = n
for i in range(1, n):
	num = (n - i) / n
	res = pow(num, m)
	ans -= res
print(ans)


(m, n) = map(int, input().split())
ans = m - sum(map(lambda x: pow(x / m, n), range(m)))
print('%.8f' % ans)


def answer(m, n):
	count = 0.0
	for i in range(1, m + 1):
		count += round(i * ((i / m) ** n - ((i - 1) / m) ** n), 10)
	return count
(m, n) = map(int, input().split())
print(answer(m, n))


(n, m) = map(int, input().split())
i = n
s = 0
while i:
	s += i * (pow(i / n, m) - pow((i - 1) / n, m))
	i -= 1
print(s)


nums = [int(x) for x in input().split()]
m = nums[0]
n = nums[1]
sum = 0
for i in range(1, m + 1):
	sum += i * ((i / m) ** n - ((i - 1) / m) ** n)
print(sum)


(M, N) = map(int, input().split())
acc = 0.0
for i in range(1, M + 1):
	i = float(i)
	acc += i * ((i / M) ** N - ((i - 1) / M) ** N)
print(acc)


(m, n) = [int(x) for x in input().split()]
ans = m
tmp = 0.0
for i in range(0, m):
	tmp = tmp + (i / m) ** n
ans = ans - tmp
print(ans)


(m, n) = tuple(map(int, input().split()))
ans = 0
for x in range(1, m + 1):
	ans += x * ((x / m) ** n - ((x - 1) / m) ** n)
print('%0.9f' % ans)


(m, n) = map(int, input().split())
ans = (1 / m) ** n
for i in range(2, m + 1):
	ans += i * ((i / m) ** n - ((i - 1) / m) ** n)
print(round(ans, 6))


__author__ = 'Jacob Dlougach'

def __starting_point():
	(m, n) = map(int, input().split())
	result = 0
	for i in range(m):
		result += ((i + 1) / m) ** n
	print('{:.9}'.format(m + 1 - result))
__starting_point()


import sys
readline = sys.stdin.readline
(N, M) = map(int, readline().split())
ans = 0
for i in range(1, N + 1):
	ans += i * ((i / N) ** M - ((i - 1) / N) ** M)
print(ans)


(m, n) = [int(i) for i in input().split()]
r = m
for i in range(1, m):
	r -= (i / m) ** n
print(r)


iarr = list(map(int, input().split()))
m = iarr[0]
n = iarr[1]
ans = 0
powi = [0 for i in range(m + 1)]
deno = pow(m, n)
for i in range(1, m + 1):
	powi[i] = pow(i / m, n)
for i in range(1, m + 1):
	ans += (powi[i] - powi[i - 1]) * i
print(ans)


(m, n) = list(map(int, input().split()))
p = m ** n
result = 0
for i in range(1, m + 1):
	result += ((i / m) ** n - ((i - 1) / m) ** n) * i
print(result)


(n, k) = map(int, input().split())
s = 0.0
for i in range(1, n + 1):
	s += i * ((i / n) ** k - ((i - 1) / n) ** k)
print(s)


(m, n) = [int(k) for k in input().split()]
res = 0
for i in range(m):
	x = ((m - i) / m) ** n * (1 - ((m - i - 1) / (m - i)) ** n)
	res += x * (m - i)
print(res)


def math_od(n, k):
	result = 0
	for i in range(1, n + 1):
		result += i * ((i / float(n)) ** k - ((i - 1) / float(n)) ** k)
	return '{0:.12f}'.format(result)
(N, K) = [int(j) for j in input().split()]
print(math_od(N, K))


import math
import collections
import sys
input = sys.stdin.readline
(m, n) = map(int, input().split())
ans = 0
for i in range(1, m + 1):
	ans += i * ((i / m) ** n - ((i - 1) / m) ** n)
print(ans)


(m, n) = list(map(int, input().split()))
print('{:.9}'.format(m - sum(((i / m) ** n for i in range(m)))))


(m, n) = list(map(int, input().split()))
su = 0
prev = 0
for i in range(1, m + 1):
	temp = pow(i / m, n)
	su += i * (temp - prev)
	prev = temp
print('{:.6f}'.format(su))


def pw(a, b):
	if b == 0:
		return 1
	if b == 1:
		return a
	x = pw(a, b // 2)
	if b & 1:
		return x * x * a
	else:
		return x * x
(m, n) = map(int, input().split())
ans = 0
for i in range(1, m + 1):
	ans += (pw(i / m, n) - pw((i - 1) / m, n)) * i
print('%.5f' % ans)


(m, n) = str(input()).split()
(n, m) = (int(n), int(m))
sum = 0
for i in range(1, m + 1):
	sum += i * ((i / m) ** n - ((i - 1) / m) ** n)
print(sum)


def avg(m, n):
	result = 0
	for k in range(1, m + 1):
		result += k * ((k / m) ** n - ((k - 1) / m) ** n)
	return result
(m, n) = map(int, input().split())
print(avg(m, n))


(m, n) = [int(x) for x in input().split()]
print(sum((x * (pow(x / m, n) - pow((x - 1) / m, n)) for x in range(1, m + 1))))


def main():
	(m, n) = read_ints()
	total = 0.0
	for i in range(1, m + 1):
		total += i * ((i / m) ** n - ((i - 1) / m) ** n)
	print(total)
from collections import *
MOD = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b, a % b)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))
main()


(m, n) = map(int, input().split())
cp = [0] * (m + 1)
for i in range(1, m + 1):
	cp[i] = (i / m) ** n
p = [0] * (m + 1)
for i in range(1, m + 1):
	p[i] = cp[i] - cp[i - 1]
ans = 0
for i in range(1, m + 1):
	ans += i * p[i]
print(ans)


from math import pow
(m, n) = list(map(int, input().split()))
ans = 0.0
sumx = 1.0
for i in range(1, m + 1):
	ans += i * (pow(i / m, n) - pow((i - 1.0) / m, n))
print('%.15f' % ans)


(m, n) = list(map(int, input().split()))
f = lambda x: (x / m) ** n
print('{:.9}'.format(sum(((f(i + 1) - f(i)) * (i + 1) for i in range(m)))))


from math import *

def bpow(a, n):
	res = 1
	while n > 0:
		if n % 2 != 0:
			res *= a
		a *= a
		n >>= 1
	return res
(M, N) = map(int, input().split())
sm = 0
for i in range(1, M):
	sm += bpow(i / M, N)
print(M - sm)


(m, n) = [int(x) for x in input().split()]
ans = m
for i in range(1, m):
	ans -= (i / m) ** n
print('%0.10f' % ans)


import sys
(m, n) = map(int, sys.stdin.readline().split())
print(sum((i * (pow(i / m, n) - pow((i - 1) / m, n)) for i in range(1, m + 1))))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]

def YES():
	print('YES')

def NO():
	print('NO')

def Yes():
	print('Yes')

def No():
	print('No')
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		self.num_sets -= 1
		self.parent[a] = b
		self.size[b] += self.size[a]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def lcm(a, b):
	return abs(a // gcd(a, b) * b)

def solve():
	(m, n) = sep()
	print(m - sum(((i / m) ** n for i in range(m))))
solve()


import bisect
from itertools import accumulate, count
import os
import sys
import math
from decimal import *
from io import BytesIO, IOBase
from sys import maxsize
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def SieveOfEratosthenes(n):
	prime = []
	primes = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if primes[p] == True:
			prime.append(p)
			for i in range(p * p, n + 1, p):
				primes[i] = False
		p += 1
	return prime

def primefactors(n):
	fac = []
	while n % 2 == 0:
		fac.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 2):
		while n % i == 0:
			fac.append(i)
			n = n // i
	if n > 1:
		fac.append(n)
	return sorted(fac)

def factors(n):
	fac = set()
	fac.add(1)
	fac.add(n)
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			fac.add(i)
			fac.add(n // i)
	return list(fac)

def modInverse(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x
(m, n) = map(int, input().split())
ans = 0
for i in range(1, m + 1):
	ans += i * ((i / m) ** n - ((i - 1) / m) ** n)
print(ans)


def main():
	(m, n) = map(int, input().split())
	print(m - sum(((i / m) ** n for i in range(m))))

def __starting_point():
	main()
__starting_point()


(m, n) = map(int, input().split())
ans = 0
l1 = [0] * (m + 1)
if m > 1:
	l1[0] = (1 / m) ** n
	x = l1[0]
	for i in range(1, m + 1):
		if i == 1:
			ans += l1[0] * i
		else:
			l1[i - 1] = (i / m) ** n - x
			x += l1[i - 1]
			ans += l1[i - 1] * i
	print(ans)
else:
	print(1)


(m, n) = map(int, input().split())
sum = 0.0
for i in range(1, m + 1):
	sum += i * ((1.0 * i / m) ** n - ((i - 1.0) / m) ** n)
print('%.10lf' % sum)


(m, n) = map(int, input().split())
ans = m
for i in range(m):
	ans = ans - (i / m) ** n
print(ans)


import math

def solve():
	[m, n] = [int(x) for x in input().split()]
	ans = 0
	for i in range(m):
		ans += pow(i / m, n)
	ans = m - ans
	print(ans)

def __starting_point():
	solve()
__starting_point()


import math
(m, n) = map(int, input().split(' '))
a = 0
b = 0
o = 0
for i in range(m):
	a = ((i + 1) / m) ** n
	o = o + (a - b) * (i + 1)
	b = a
print(o)


(m, n) = map(int, input().split())
e = 0.0
for k in range(1, m + 1):
	e += k * ((k / m) ** n - ((k - 1) / m) ** n)
print(e)


from math import ceil, floor, sqrt, log

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def dec_pow(a, n):
	res = 1
	while n > 0:
		if n % 2 == 1:
			res *= a
		a *= a
		n //= 2
	return res

def is_prime(n):
	for i in range(2, floor(sqrt(n) + 1)):
		if n % i == 0:
			return False
	return True

def find_k(n):
	for k in range(0, ceil(n / 2) + 1):
		if is_prime(k + n):
			return k

def get_expect(n, m):
	e = 0
	for i in range(1, m + 1):
		e += i * (dec_pow(i / m, n) - dec_pow((i - 1) / m, n))
	return e

def get_graph(n):
	k = find_k(n)
	m = n + k
	print(m)
	for i in range(1, n):
		print(i, i + 1)
	print(n, 1)
	for i in range(1, k + 1):
		print(i, i + floor(n / 2))

def alice_wins(n, k):
	if n < k:
		if n % 3 != 0:
			return True
		return False
	if alice_wins(k - 1, k):
		if (n - (k + 1)) % 3 != 0:
			return True
	elif (n - (k + 2)) % 3 != 0:
		return True
	return False

def prime_factorization(x):
	answer = []
	i = 2
	while i * i <= x:
		if x % i == 0:
			answer.append(i)
			while x % i == 0:
				x //= i
		i += 1
	if x > 1:
		answer.append(x)
	return answer

def pf(X, N):
	answer = 1
	m = pow(10, 9) + 7
	x_primes = prime_factorization(X)
	for prime in x_primes:
		power = 0
		factor = prime
		while factor <= N:
			power += N // factor
			factor *= prime
		answer *= pow(prime, power, m)
		answer %= m
	return answer

def find_ops(n):
	c = floor(n / 3)
	n -= 3 * floor(n / 3)
	b = floor(n / 2)
	n -= 2 * floor(n / 2)
	return n + b + c

def count_operations(a, b):
	if a < b:
		val = int(log(b / a, 2))
		if pow(2, val) * a == b:
			return find_ops(val)
	else:
		val = int(log(a / b, 2))
		if pow(2, val) * b == a:
			return find_ops(val)
	return -1

def find_m(n, x):
	return 1 + max(0, (n - pow(2, x - 1) + 1) // pow(2, x))

def find_total_diff(n):
	n -= 1
	total = n // 2 + 1
	x = 1
	while pow(2, x) - 1 <= n:
		total += (x + 1) * find_m(n, x + 1)
		x += 1
	return total
t = 1
while t:
	t = t - 1
	(m, n) = map(int, input().split())
	print(get_expect(n, m))


(m, n) = map(int, input().split())
if m > 1:
	n2 = n + 1
	num3 = m ** n
	num4 = 10 ** 15
	num2 = max(2, int(m / num4 ** (1 / n2)) - 300)
	num = (num2 - 1) ** n
	i = num2
	ans = -1 / num3
	while i < m:
		ans -= (i / m) ** n
		i += 1
	print(ans + m - 8e-05)
else:
	print(1)


(m, n) = map(int, input().split())
s = sum((pow(float(i) / m, n) for i in range(1, m)))
print(m - s)


def ans(m, n):
	out = m
	for i in range(1, m):
		out -= (i / m) ** n
	return out
(m, n) = map(int, input().split())
print(ans(m, n))


(m, n) = map(int, input().split())
ans = 0
for i in range(1, m + 1):
	aa = (i / m) ** n
	bb = ((i - 1) / m) ** n
	ans += (aa - bb) * i
print(ans)


(m, n) = map(float, input().split())
answer = 0
for i in range(1, int(m) + 1):
	i = float(i)
	answer += i * ((i / m) ** n - ((i - 1) / m) ** n)
print(answer)


from sys import stdin, stdout
from collections import defaultdict, Counter
from bisect import bisect, bisect_left
import math

def f(k, n, m):
	return k * ((k ** n - (k - 1) ** n) / m ** n)
I = stdin.readline
(m, n) = map(int, I().split())
ans = 0
for i in range(1, m):
	ans -= (i / m) ** n
ans += m
print(ans)


import os
from sys import stdin, stdout

def solve(tc):
	(m, n) = map(int, stdin.readline().split())
	tot = 0
	for i in range(1, m + 1):
		tot += ((i / m) ** n - ((i - 1) / m) ** n) * i
	print(tot)
tcs = 1
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


from collections import Counter, defaultdict, deque
import heapq as hq
from itertools import count, islice
import math
import sys
input = sys.stdin.readline
(m, n) = [int(x) for x in input().split()]
s = 0
for i in range(1, m + 1):
	s += i * ((i / m) ** n - ((i - 1) / m) ** n)
print(s)


(m, n) = map(int, input().split())
a = m ** (-n)
for i in range(2, m + 1):
	a += ((i / m) ** n - ((i - 1) / m) ** n) * i
print(a)


def main():
	(m, n) = list(map(int, input().split()))
	ans = 0
	for i in range(1, m + 1):
		ans += i * (pow(i / m, n) - pow((i - 1) / m, n))
	print('%0.4f' % ans)
main()


(a, b) = map(int, input().split())
sum = 0
for i in range(1, a + 1):
	sum += i * ((i / a) ** b - ((i - 1) / a) ** b)
print(sum)


(m, n) = map(int, input().split())
ans = 0
for j in range(m, 0, -1):
	ans += j * (1 - ((j - 1) / j) ** n) * (j / m) ** n
print(ans)