#96Medium
Arithmetic and geometric mean
Time: 1 s · Memory: 256 MB
- Functions
Statement
Write a function Mean(x, y) that returns two values for positive and at once: the arithmetic mean and the geometric mean . Use it to find the means of the pairs , , for the numbers .
Input format
A single line with four integers , , , ().
Output format
Three lines: for each pair the arithmetic and the geometric mean, each with exactly 2 digits after the decimal point.
Examples
Input
4 9 16 25
Output
6.50 6.00 10.00 8.00 14.50 10.00
Input
1 1 2 3
Output
1.00 1.00 1.50 1.41 2.00 1.73
Note
The function returns two results: in Python and Go — return am, gm, in C++ — output parameters (double& am). reaches — multiply in long long or double, not in int.
In the first example: — 6.50 6.00, — 10.00 8.00, — 14.50 10.00.
