## CCO '12 P5 - Sample Size

View as PDF

Points: 7
Time limit: 1.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: 2012 Stage 2, Day 2, Problem 2

Someone whose name I don't want to remember was reading an article in the newspaper that mentioned the results of a poll. Upon seeing that the percentages that appeared in the article were all , and , they thought that maybe the poll only included people, and was then not very good.

In this problem, your task is to come up with a program that would make a similar analysis. In particular, given the percentages that appear in a newspaper article, it is your task to determine the minimum number of people that must have been interviewed in order for those percentages to be possible, assuming that percentages are rounded to the closest integer, with rounded up (so, of people corresponds to , of people corresponds to , and of people corresponds to ).

#### Input Specification

The first line of the input file will contain an integer between and (inclusive). This represents the number of percentages that appear in the newspaper article you are analyzing. lines will follow, each of them containing an integer percentage , .

#### Output Specification

An integer , the minimum number of people that must be interviewed for all of the percentages in the input to correspond to a fraction of those people.

#### Sample Input 1

3
25
50
75

#### Sample Output 1

4

#### Sample Input 2

2
33
67

#### Sample Output 2

3