This problem is authored by one of our late friends, Sifat, who unexpectedly left us last year. He was a brilliant programmer, an astute philosopher and an amazing human being. Had he been with us, he would have been delighted to see this year’s brilliant IUPC coming to life and would wish you good luck for the contest. We sincerely hope you enjoy his problem.
You are given an array of size . You can select a number ( may or may not be an element of ) and remove every multiple of from the array. You need to find the minimum size of the array after performing this operation exactly twice.
The first line contains an integer, .
The second line contains space-separated integers .
On the first line, output a single integer, the minimum size of array after performing this operation exactly twice.
On the second line, output two integers and , the chosen values of for the two operations.
Input | Output |
---|---|
4 4 8 25 21 | 1 4 21 |
You can chose 4 and remove 4 8 to get the new array 25 21. Then you can chose 25 to get the new array 21 . So the answer is 1. There exists other choices that can give the same result too. For example 2 3 is a valid solution as well. |
Input | Output |
---|---|
3 2 4 6 | 0 2 1605113 |
If you choose 2 first, all elements are removed after the first move. Then you can choose any integer for the second move. As such 2 for any is a valid output. |