program lottery;
var
n,m,i,j,k:integer;
t:int64;
sz:array[0..30,0..30]of int64;
begin
fillchar(sz,sizeof(sz),0);
assign(input,'lottery.in');
assign(output,'lottery.out');
reset(input);
rewrite(output);
readln(n,m);
for i:=1 to n do
for j:=1 to m do
begin
if i=j then begin
sz[i,j]:=1;
for k:=2 to i do
sz[i,j]:=sz[i,j]*k;
end
else begin
if i>j then sz[i,j]:=0 else begin
sz[i,j]:=sz[i,j-1]*i+sz[i-1,j-1]*i;
end;
end;
end;
t:=n;
for i:=2 to m do
t:=t*n;
writeln(sz[n,m]/t:0:4);
close(input);
close(output);
end.