409711: GYM103698 A Volleyball
Description
As we all know, the scoring rule for volleyball is as follows:
- A team wins when it reaches 25 points and leads the other team by 2 or more points. If the game ties at 24 points, it will continue until a team gains 2 or more points than the other team.
Wuye and Qingcheng meet again in the county's preliminary match. The rule of the match is best-of-three. Please be a scorer, output the score of each game, and at the end of the match, output which team wins.
InputEach line contains two integers $$$opt, x$$$. When $$$opt = 1$$$, it means Qingcheng scores $$$x$$$ balls consecutively, and when $$$opt=2$$$, it means Wuye scores $$$x$$$ balls consecutively.
When one of the teams wins the match, stop reading. The input guarantees that it describes a legitimate volleyball game, i.e., there will be no exception with regard to the score.
OutputIn the first $$$2$$$ or $$$3$$$ lines, output the score of each game. Qingcheng is in the front of Wuye.
At the end of the match, output another line. If Qingcheng wins the match, output $$$1$$$, otherwise output $$$2$$$.
ExamplesInput2 25 1 24 1 1 2 24 1 24 2 1 1 1 2 1 2 1Output
0:25 25:0 25:27 2Input
1 25 2 25 1 2 1 1 2 3 1 3 1 1 1 3 2 3 1 1 1 2 2 3 1 3 2 2 1 3 2 4 1 3 2 1 2 4 2 1 2 3 1 2 2 2Output
25:0 0:25 24:26 2Note
Subtask 1 (50pts): It is guaranteed that $$$x=1$$$, that is, each line of input describes only one ball.
Subtask 2 (50pts): The number of input lines is guaranteed to be less than $$$1000$$$ lines. Scores are guaranteed to be within $$$1000$$$ at all times.