시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 256 MB46262165.625%

문제

Jim wants to make a lot of bows for her birthday party. She buys many rolls of ribbon in different colors. When she starts to make a bow, she finds out that the first and the last inch of every roll are dirty and cannot be used. To make bows, she has to cut the ribbon as long as possible. However, each piece of ribbon must have the same length.

입력

The input must be read from standard input. Each line starts with integer n, which is the number of rolls, 2 <= n <= 10. The next n numbers are the ribbon's length of each roll, k, where 5 <= k <= 500000. Each number is separated by a space.

출력

For each line shows two integers. The first number is the length of piece of ribbon after cut off. The last number is the total amount of bows that Jim can make. Each number is separated by a space. 

You must display the results in an exact form as shown in the sample output below. 

예제 입력 1

3 14 23 29
2 11 29
4 200 120 180 500

예제 출력 1

3 20
9 4
2 496