Paycheck
Some company has certain amount of employees. The company has N different departments, and the salary within each of the departments is the same. You know the number of employees and their salaries in each of the departments. You have to find what is the average salary in the company.
InputFrom the first line of the standard input read an integer 0<N<1000, representing the number of departments in the company. From the second line read 2N integers in the following order a[1] p[1] a[2] p[2] ... a[N] p[N] where 1< a[i] <1000 represents the number of people in each department, and 0< p[i] <1000 represents the salary within that department.
OutputTo the standard output write one real number with two decimal point precision representing the average salary in the company.
Input:
Output:
2
3 4 5 6Output:
5.25Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.