Total Points | Event Sequence
-------------|----------------
2 | A douser
5 | A douser, then a soaker
8 | A douser, then a gusher
6 | A douser, then a soaker, then a spray
7 | A bucket
Note:Given a particular score, what is the smallest number of event sequences which will achieve that score? For Dunking, some scores are impossible (like 1 and 3). Others can be obtained in several ways--to get 8 points you could score one douser/gusher, a douser/soaker/spray and a "stand-alone" douser, or four dousers. The one douser/gusher is the optimum way to achieve 8 points, since it requires only one "event sequence". In this problem you will be presented with the scoring schemes for multiple games, and for each scheme, a set of potential scores to be analyzed. For each game and score, you are to determine if that score can be achieved, and if it can, the optimal manner in which it can be achieved. Optimal, again, means achieving the score with the smallest number of event sequences.
Following each scoring scheme will be a sequence of integers, each giving a potential score. This sequence will terminate with zero, which is not to be treated as a potential score.
5 douser 2 soaker 3 douser spray 1 soaker gusher 6 douser bucket 7 1 2 4 5 6 7 8 9 0 4 foul 0 freeshot 1 foul goal 2 whopper 4 1 2 3 4 5 0 0
Case 1.1 (1):
This score is impossible.
Case 1.2 (2):
1 douser (2)
Case 1.3 (4):
2 dousers (4)
Case 1.4 (5):
1 douser (2)
1 soaker (3)
Case 1.5 (6):
1 douser (2)
1 soaker (3)
1 spray (1)
Case 1.6 (7):
1 bucket (7)
Case 1.7 (8):
1 douser (2)
1 gusher (6)
Case 1.8 (9):
1 douser (2)
1 bucket (7)
Case 2.1 (1):
1 foul (0)
1 freeshot (1)
Case 2.2 (2):
1 goal (2)
Case 2.3 (3):
1 foul (0)
1 freeshot (1)
1 goal (2)
Case 2.4 (4):
1 whopper (4)
Case 2.5 (5):
1 foul (0)
1 freeshot (1)
1 whopper (4)