You have roses of three different colors. In particular, you have roses of each color. Please print all the ways to plant all the roses in a line of pots, one rose per pot, in such a way that there is exactly one pair of adjacent roses of the same color. The roses of the same color are indistinguishable.
Input consists of several cases, each with . Assume .
For every case, print all the solutions in lexicographical order. Use numbers starting at one to identify each color. Print a line with 10 asterisks after every case.
Author: Salvador Roura
Generation: 2026-01-25T12:15:30.378Z
© Jutge.org, 2006–2026.
https://jutge.org