RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00129

Iks

Gold III 골드 III
난이도
1s
시간 제한
32MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 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

예제 1
입력
3
4 4 1
출력
2 1
예제 2
입력
3
8 24 9
출력
12 3
예제 3
입력
5
4 5 6 7 8
출력
2 2
문제 정보

riseoj 작성

출처 COCI 2009/2010 Contest 4

평가 및 의견

Iks

개요
출제자 난이도 Gold III 골드 III 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Iks

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8