Logo
(追記) (追記ここまで)

18964번 - Questionnaire 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB69635727152.827%

문제

In order to get better results in official ACM ICPC contests, the team leader came up with a questionnaire. He asked every participant whether they want to have more training.

Obviously, many people don't want more training, so the clever leader didn't write down their words such as "Yes" or "No". Instead, he let everyone choose a positive integer $a_i$ to represent their opinion. Amazingly, all the resulting numbers were distinct.

Now the leader wants to choose a pair of positive intergers $m$ (1ドル < m \le 10^9$) and $k$ (0ドル \le k < m$), and regard those people whose number is exactly $k$ modulo $m$ as "Yes", and all others as "No". If there are at least as many "Yes" answers as "No" answers, the leader can have a chance to offer more training.

Please help the team leader to find such pair of $m$ and $k$.

입력

The first line of the input contains an integer $n$: the number of ACM ICPC participants (3ドル \leq n \leq 10^5$).

The next line contains $n$ distinct integers $a_1,ドル $a_2,ドル $\ldots,ドル $a_n$: the numbers chosen by the participants (1ドル \leq a_i \leq 10^9$).

출력

Print a single line containing two integers $m$ and $k$. If there are several possible solutions, print any one of them.

제한

예제 입력 1

6
23 3 18 8 13 9

예제 출력 1

5 3

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2017 > Day 1: Songyang Chen Contest 1 I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /