题目描述
Problem Description
There are two teams, Pineapple and Blueberry, each consisting of four players, playing with water guns.
We are given specific game information, totaling $n$ pieces. Each piece of information is in the form of player $a_i$ hitting player $b_i$ at time $t_i$ seconds. For a player $i$, if $1 \le i \le 4$, they are in the Pineapple team; otherwise, they are in the Blueberry team. Each hit adds 100 points.
A "double spray" is defined as a player continuously hitting a member of the opposing team within 10 seconds. If the first hit occurs at $t_f$ seconds, the second hit must be within $[t_f+1, t_f+10]$ seconds. A double spray adds 50 points to the team and can trigger consecutive double sprays.
Calculate the scores of both teams.
Input Format
The first line contains an integer $n$.
The next $n$ lines each contain three integers $t_i, a_i, b_i$.
All $t_i$ are guaranteed to be unique and are input in ascending order.
Output Format
Output one line with two integers, representing the scores of the two teams.
Sample Input and Output
Sample Input #1
3
10 1 6
20 1 7
21 8 1
Sample Output #1
250 100
Sample Input #2
3
10 2 5
15 2 6
25 2 5
Sample Output #2
400 0
Sample Input #3
2
10 5 2
11 6 3
Sample Output #3
0 200
Notes
Data Range
For all data, $1 \le n \le 100$, $0 \le t_i \le 10^3$, $\forall 1 \le i < n, t_i < t_{i+1}$, $1 \le a_i, b_i \le 8$, player $a_i$ and player $b_i$ are not on the same team.
| Subtask | Special Constraints | Points |
|---|---|---|
| $1$ | $n \le 3$ | $10$ |
| $2$ | No double sprays | $15$ |
| $3$ | None | $25$ |
Notes
This problem is worth a total of 50 points.
This problem is translated from the Croatian Open Competition in Informatics 2021/2022 Contest #1 T1 Ljeto.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分