Problem A
Star Arrangements

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This pattern has the property that adjacent rows differ by no more than one star. We represent this star arrangement compactly by the number of stars in the first two rows: 6,5.
A
A flag pattern is visually appealing if it satisfies the following conditions:
-
Every other row has the same number of stars.
-
Adjacent rows differ by no more than one star.
-
The first row cannot have fewer stars than the second row.
Your team sees beyond the short-term change to
Input
The input consists of a single line containing the integer
Output
On the first line, print
This list of compact representations should be printed in
increasing order of the number of stars in the first row; if
there are ties, print them in order of the number of stars in
the second row. The cases
The compact representations must be printed in the form “x,y”, with exactly one comma between x and y and no other characters.
Sample Input 1 | Sample Output 1 |
---|---|
3 |
3: 2,1 |
Sample Input 2 | Sample Output 2 |
---|---|
50 |
50: 2,1 2,2 3,2 5,4 5,5 6,5 10,10 13,12 17,16 25,25 |
Sample Input 3 | Sample Output 3 |
---|---|
51 |
51: 2,1 3,3 9,8 17,17 26,25 |