var
a, n, i : integer;
sPlus, sMinus, x : double;
begin
writeln('Input a');
readln(a);
writeln('Input N');
readln(n);
sPlus := 0;
sMinus := 0;
for i := 1 to n do begin
x :=exp(i*ln(abs(a)));
if (a < 0) and (i mod 2 <> 0) then x := -x;
if x > 0 then
sPlus := sPlus + x
else
sMinus := sMinus + x
end;
writeln((sPlus*2):2:2);
writeln((sMinus*3):2:2);
end.
var
a, n, i : integer;
sPlus, sMinus, x : double;
begin
writeln('Input a');
readln(a);
writeln('Input N');
readln(n);
sPlus := 0;
sMinus := 0;
for i := 1 to n do begin
x :=exp(i*ln(abs(a)));
if (a < 0) and (i mod 2 <> 0) then x := -x;
if x > 0 then
sPlus := sPlus + x
else
sMinus := sMinus + x
end;
writeln((sPlus*2):2:2);
writeln((sMinus*3):2:2);
end.