Problem C
Paintings

Catherine recently got into painting minimalist art. For her
next painting she wants to create an image with
Input
The first line of input contains an integer
The first line of each test case contains one integer
Output
For every test case output two lines. On the first line display the total number of paintings Catherine can make that are not hideous (without consideration for her color preferences), and on the second line output Catherine’s favorite painting as a space-separated list of colors corresponding to the strips in the painting from left to right.
Note: You are guaranteed that there is always at
least one arrangement of colors Catherine finds non-hideous,
and that the maximum number of paintings Catherine can make is
less than
Sample Input 1 | Sample Output 1 |
---|---|
3 3 green red blue 1 red blue 4 purple pink red black 2 purple pink red black 8 black white red blue yellow green orange purple 6 black white blue green orange black red blue green yellow white purple |
2 red green blue 8 purple red pink black 7208 black red white blue yellow orange green purple |