| Чемпионат Беларуси 2024 |
|---|
| Закончено |
Laura has $$$n$$$ cards with positive integers written on them.
As today is November 16, 2024, she presents you with a special problem. Given a set of cards, determine if it is possible to choose some of them so that the number $$$16112024$$$ can be represented as the product of numbers written on the selected cards.
Of course, you cannot manipulate the numbers on the cards. For example, you cannot rotate a card with a $$$6$$$ to obtain a card with a $$$9$$$, tear cards into pieces, or write anything on them. However, if there exists a suitable set of cards, it is sufficient to find any such set.
The first line contains a single integer $$$n$$$ ($$$1 \le n \le 100\,000$$$): the number of cards.
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$2 \le a_i \le 10\,000$$$): the numbers written on the cards.
If there exists a set of cards whose product of numbers is equal to $$$16112024$$$, print the size of that set in the first line and the numbers themselves in the second line. You may print the numbers in any order.
Otherwise, print a single integer $$$0$$$ in the only line.
If there are multiple solutions, print any of them.
52 2 2 269 7487
5 2 2 2 269 7487
3998 244 353
0
A curious fact: the integers $$$2$$$, $$$269$$$, and $$$7487$$$ are prime. In other words, they have only two distinct positive integer divisors: $$$1$$$ and themselves.
| Название |
|---|


