Company: Cimpress
Difficulty: medium
Maximum balls Problem Description Bob is a math teacher with a class of N students. The marks obtained by the students are given in the array marks . Bob wants to gift every student the same number of balls, and that number must be a factor of every student's marks. To be able to hand out as many balls as possible, Bob may change the marks of at most one student to any positive number he likes. He may also leave every mark alone. Find the largest number of balls Bob can give to each student. Complete the function max_balls , which takes these two parameters and returns an integer: N : the number of students in the class. marks : the marks of the N students. Input Format The first line contains the integer N . The second line contains N space-separated integers, the values of marks . Output Format Print a single integer: the maximum number of balls that can be given to every student. Constraints 2 <= N <= 1000 1 <= marks[i] <= 10^9 Examples Example 1 Input: 3 12 3 11 Output: