Problem H
Gwen's Gift
Gwen loves most numbers. In fact, she loves every number
that is not a multiple of
![\includegraphics[width=0.9\textwidth ]{gift-flowers.png}](/problems/gwensgift/file/statement/en/img-0001.png)
Gwen wants her paintings to be unique, so no two paintings
will have the same sequence of flowers. To keep track of this,
Gwen recorded each painting as a sequence of
What is the
Input
The input consists of a single line containing two integers
Output
Display the
Sample Input 1 | Sample Output 1 |
---|---|
4 3 |
2 1 2 |
Sample Input 2 | Sample Output 2 |
---|---|
2 1 |
1 |
Sample Input 3 | Sample Output 3 |
---|---|
5 22 |
4 3 4 2 |
Sample Input 4 | Sample Output 4 |
---|---|
5 16 |
3 3 3 3 |