CCO '00 P5 - Millikan's Oil Droplet Experiment

View as PDF

Submit solution

Points: 7
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
Canadian Computing Competition: 2000 Stage 2, Day 2, Problem 2

Millikan's famous Oil Droplet Experiment showed that electrical charge is quantized; that is that the electrical charge on any object is the sum of a number of elementary electrical charges. The electron is the most common subatomic particle that carries a single elementary electrical charge.

Millikan's experiment involved measuring the charge on several oil droplets, and showing that each charge was a multiple of some smaller charge. Your friend, the physics enthusiast, has to reproduce Millikan's experiment. She has looked after constructing the apparatus and taking the measurements. Her measurements are pretty good for what can be achieved in a high school laboratory: the maximum error on any given measurement is \pm 1\%.

Given the measurements as input, your program must find the maximum possible value for the elementary charge consistent with the measurements. That is, each measurement, plus or minus an error of 1\% or less, must be a multiple of the elementary charge.

Input Specification

The input contains an integer n (1 \le n \le 100), the number of oil droplets. This is followed by n real numbers on a single line; these represent the charge measured on each droplet.

Output Specification

The output should be a single number, the maximum possible elementary charge, correct to 4 decimal places.

Sample Input

3.01 5.93 12.07

Sample Output



  • 7
    Jonathan_Uy  commented on June 12, 2020, 10:08 a.m. edited

    The maximum error is supposed to be +/- 1%, not simply +/- 1.

    Edit: Fixed, thanks!