Millikan's Oil Drop Experiment

Time limit1sMemory limit128 MB

Summary
Given up to 100 measured charges each accurate within 1 percent, find the largest value e such that every measurement can be nudged into an integer multiple of e.
Level

Medium7 of 10

Topics
Math, Number theory, Brute force, Implementation
Solved
No attempts yet

Problem

Millikan's famous oil-drop experiment showed that electric charge is quantized: the charge on any object is always an integer multiple of a single elementary charge. The electron is the most common particle that carries exactly one elementary charge.

The experiment measures the charge on several oil droplets and shows that each charge is a multiple of some smaller charge. A physics-loving friend of yours wants to reproduce it. She has built the apparatus and taken the measurements; they are about as good as a high-school laboratory allows, so the maximum error on any measurement is ±1%\pm 1\%.

Given the measurements, find the largest elementary charge that is consistent with them. That is, each measurement, after adding or subtracting an error of at most 1%1\%, must be an integer multiple of the elementary charge.

Input

The first line contains an integer nn (1≤n≤100)(1 \le n \le 100), the number of oil droplets. The next line contains nn real numbers separated by spaces, the charge measured on each droplet.

Output

Print the largest elementary charge that is consistent with every measurement, rounded to 44 decimal places (rounding half up at the fifth decimal place).

Examples3

  1. Example 1

    Input
    3
    3.01 5.93 12.07
    
    Expected output
    2.9947
    
  2. Example 2

    Input
    1
    5.0
    
    Expected output
    5.0500
    
  3. Example 3

    Input
    3
    10 10 15
    
    Expected output
    5.0500