| UDESC Selection Contest 2024-1 |
|---|
| Finished |
Guizinho has just bought a new pair of glasses and can finally see the stars! Very excited about this, he started noting down patterns he observed in the night sky.
After years of observation, Guizinho recorded in his notebook $$$N$$$ numbers $$$a_1, a_2, ..., a_N$$$, representing that star $$$i$$$ appears in Earth's sky every $$$a_i$$$ years. Gui says that this number represents the period of a star.
The year 2024 is a very lucky year for him because, while observing the sky, he noticed that all $$$N$$$ stars whose periods he recorded are visible at the same time! Guizinho named the years in which all these stars appear in the sky simultaneously as "stellar years."
After admiring the sky long enough, he started thinking about the future of star observation: Knowing that the current year is a stellar year, which stars will be visible in Earth's sky after $$$X$$$ more years?
The first line of the input consists of two integers $$$N$$$ $$$(1 \le N \le 3 \cdot 10^5)$$$ and $$$X$$$ $$$(0 \le X \le 10^9)$$$, the number of stars Guizinho recorded in his notebook and how many years into the future he wants to consider, respectively.
The next line consists of $$$N$$$ integers, $$$a_1, a_2, ..., a_N$$$ $$$(1 \le a_i \le 10^9)$$$, the period of each star.
The first line of the output must contain an integer $$$K$$$ $$$(0 \le K \le N)$$$, the number of stars that will be visible in the sky after $$$X$$$ years.
The next line must contain $$$K$$$ integers $$$i_1, i_2, ..., i_K$$$, the stars that will be visible in the sky after $$$X$$$ years. The stars can be shown in any order.
1 42
1 1
5 33 4 1 9 81
2 1 3
3 211 1 3
1 2
4 04 3 92 7
4 1 2 3 4
| Name |
|---|


