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

23364번 - Almost Always 다국어인터랙티브

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB68122713930.283%

문제

Today, your probability theory class covered probabilistic events that occur with high probability. As you are now explaining to your friend, this means that as some parameter $n$ goes to infinity, the probability of this event goes to 1ドル$.

An example of an event that occurs with high probability is the following: given a list of $n$ independent uniform random integers between 1ドル$ and 2ドル\cdot 10^9,ドル there are two elements such that one divides the other.

Your friend does not believe this, as he can easily come up with many examples where no number divides any other number: Just take any subset of $\{10^9+1, 10^{9}+2, \dots, 2\cdot 10^9\}$ and none of these will divide any other!

To convince your friend, you will show him that you can find two elements that divide each other for exactly 100ドル$ instances of the problem. You are confident this will succeed, since the probability of failure is in fact less than 10ドル^{-25}$ per instance when $n=5\cdot 10^5$.

입력

The input consists of:

  • One line with an integer $n,ドル the number of integers in the list.
  • One line containing $n$ independent random integers $a_1, \ldots, a_n,ドル drawn uniformly from $\{1, 2, \ldots, 2\cdot 10^9\}$.

Your submission will be run on exactly 100ドル$ test cases, all of which will have $n=5\cdot 10^5$. The samples are smaller and for illustration only.

Each of your submissions will be run on new random test cases.

출력

Output two distinct integers $i$ and $j,ドル indicating that $a_{i}$ divides $a_{j}$.

제한

예제 입력 1

10
4 9 8 10 5 28 3 62 9 17

예제 출력 1

5 4

예제 입력 2

10
7 48 17 43 97 26 85 10 26 9

예제 출력 2

3 7

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2021 Preliminaries A번

  • 문제를 만든 사람: Ragnar Groot Koerkamp

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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