Module: (C++) Real numbers


Problem

9 /10


Average values

Problem

Averages between data can be calculated in a variety of ways. In mathematics, there are the following averages:
  1. arithmetic average of numbers a and b\(\dfrac{a+b}{2}\);
     
  2. geometric average of numbers a and b: \( \sqrt{a\cdot b}\);
     
  3. harmonic average of numbers a and b\(\dfrac{2ab}{a+b}\);
     
  4. root average square numbers a and b: \( \sqrt{\dfrac{a^2+b^2}{2}}\).


Input format
Given two real numbers a and (1 <= a, b <= 1000).

Output format
Output four numbers, each on separate line – arithmetic average,  geometric average, harmonic average and root average square. 
 
Example
N Input Outpur
1
12.5
36.2
24.35
21.27204738618265
18.58316221765914
27.08034342470568