Problem B
Moving Pianos
A piano tuner indeed has a hard time earning his living. (Un)fortunately, most people want their pianos tuned only when they move to a new place, and thus also someone to help them move the piano. Therefore, quite a few piano -tuners combine their profession with lifting and transporting pianos. However, as you might guess, they are not all that keen on doing a lot of heavy-weight carrying in a day, and they certainly don’t want to work weekends! In the city of Hampstead, the small group of piano tuners have joined forces, and they help each other by taking turns in moving the pianos. No piano tuner transports more than one piano a day under any circumstance, and they always work in pairs.
As with most craftsmen, you seldom get to know precisely
when the job you request will be carried out. Instead, when
ordering a piano move, you are given an arbitrary long time
interval containing your desired moving day, during which your
piano is guaranteed to be moved by the piano tuners. This
strategy often makes the scheduling task easy, but this time
they just might have put themselves in some trouble. During the
last days, the piano tuners have received a lot of piano move
orders for the next
Input
On the first line is a single positive integer
Output
For each test scenario, output the text “serious trouble” if the list of piano move
orders cannot be executed as promised even if all the
Sample Input 1 | Sample Output 1 |
---|---|
3 3 2 4 5 5 6 5 7 2 5 49 50 50 50 4 2 8 10 8 10 8 10 8 10 |
weekend work fine serious trouble |