All problems

A Log-Log Scatter Plot

hardPythonMatplotlibLog Scale

Meridian Insight is charting settlements for a transport client. The list runs from hamlets of a few hundred people to cities of several million, so on an ordinary scale every hamlet collapses onto the origin and the picture shows four cities and a smudge. Both axes are therefore stretched so that equal steps mean equal multiples rather than equal differences. The caption needs a typical size that behaves the same way.

Task: Print the geometric average of the across values. The geometric average is the single number that, multiplied by itself once for every settlement, gives the same total product as multiplying all the across values together. It is the average that respects ratios: on 1, 10 and 100 it lands on 10, halfway in multiplying terms rather than halfway in adding terms.

Input

The first line holds an integer n, the number of settlements. Each of the next n lines holds two numbers separated by a single space, and every number is strictly positive.

Output

One line with exactly 2 digits after the decimal point. A typical size of six prints as 6.00.

Example:

Input:
3
1 10
10 20
100 30

Output:
10.00

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…