QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 256 MB Total points: 100 Hackable ✓

#16577. Volleyball

الإحصائيات

Volleyball is a sport that always looks up! --- "Volleyball Boys"

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.

Input

Each 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.

Output

In 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$.

Example

Input 1

2 25
1 24
1 1
2 24
1 24
2 1
1 1
2 1
2 1

Output 1

0:25
25:0
25:27
2

Input 2

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 2

Output 2

25:0
0:25
24:26
2

Subtasks

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.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.