Millikan's Oil Drop Experiment
Time limit1sMemory limit128 MB
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 .
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 , must be an integer multiple of the elementary charge.

Input
The first line contains an integer , the number of oil droplets. The next line contains 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 decimal places (rounding half up at the fifth decimal place).