Var
a, b: real;
begin
readln(a, b);
writeln('P = ', 2 * (a + b));
writeln('S = ', a * b);
end.
2)
var
a, b, c: real;
begin
readln(a, b, c);
writeln('cos(alpha) = ', (b * b + c * c - a * a) / (2 * b * c));
writeln('cos(beta) = ', (a * a + c * c - b * b) / (2 * a * c));
writeln('cos(gamma) = ', (a * a + b * b - c * c) / (2 * a * b));
end.