Iks
의견: 0
Mirko's great grandmother Katica is an avid mathematician. She likes to torment Mirko with math games. This time she wrote down a sequence of numbers on a piece of paper and told Mirko he may do the following:
- Choose any two numbers in the sequence (let's call them \(A\) and \(B\)) and a prime number \(X\) such that \(A\) is divisible by \(X\). After that, Mirko replaces \(A\) with \(A / X\), and then replaces \(B\) with \(B \cdot X\).
Mirko may perform this operation as many times as he wants. His goal is to obtain the maximum possible score, because he gets candy from his great grandmother if he does so. The score for one sequence is the greatest common divisor of all the numbers in the sequence.
He is not very good at this, and he likes his candy, so he has asked you to help him. Write a program that will calculate the maximum possible score. Since you are such a nice guy, you should also print the smallest number of times Mirko must perform the operation to obtain the maximum possible score.
The first line of input contains one integer \(N\) (\(1 \le N \le 100\)), number of elements in the starting sequence.
The second line of input contains \(N\) positive integers smaller than or equal to \(1\,000\,000\), the sequence Katica gave to Mirko.
The one and only line of output should contain two integers. The first integer is the
maximal possible score Mirko can obtain. The second integer is the smallest number of
operations Mirko needs to perform to obtain it.
6
| 서브태스크 | 점수 | 설명 |
|---|---|---|
Test 1 | 10점 | None |
Test 2 | 10점 | None |
Test 3 | 10점 | None |
Test 4 | 10점 | None |
Test 5 | 10점 | None |
Test 6 | 10점 | None |
Test 7 | 10점 | None |
Test 8 | 10점 | None |
Test 9 | 10점 | None |
Test 10 | 10점 | None |
3
4 4 12 13
8 24 912 35
4 5 6 7 82 2평가 및 의견
Iks
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Iks