Problem E
Pebble Solitaire
I bet you have seen a pebble solitaire game. You know the
game where you are given a board with an arrangment of small
cavities, initially all but one occupied by a pebble each. The
aim of the game is to remove as many pebbles as possible from
the board. Pebbles disappear from the board as a result of a
move. A move is possible if there is a straight line of three
adjacent cavities, let us call them
In this problem, we look at a simple variant of this game, namely a board with twelve cavities located along a line. In the beginning of each game, some of the cavities are occupied by pebbles. Your mission is to find a sequence of moves such that as few pebbles as possible are left on the board.
![\includegraphics[width=0.8\textwidth ]{pebble}](/problems/pebblesolitaire/file/statement/en/img-0001.png)
Input
The input begins with a positive integer
Output
For each of the
Sample Input 1 | Sample Output 1 |
---|---|
5 ---oo------- -o--o-oo---- -o----ooo--- oooooooooooo oooooooooo-o |
1 2 3 12 1 |