시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 (추가 시간 없음) | 1024 MB | 392 | 135 | 84 | 31.818% |
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:
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}$.
10 4 9 8 10 5 28 3 62 9 17
5 4
10 7 48 17 43 97 26 85 10 26 9
3 7
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2021 Preliminaries A번