P7927 [COCI 2021/2022 #1] Ljeto
Description
Two teams of four players, Pineapple and Blueberry, are playing with water guns.
We will be given $n$ pieces of information about the game. Each piece is in the form: at second $t_i$, player $a_i$ hit player $b_i$. For a player $i$, if $1 \le i \le 4$, then they are on Team Pineapple; otherwise, they are on Team Blueberry. Each hit adds $100$ points.
A “double spray” is defined as follows: within $10$ seconds, a player **consecutively** hits players from the opposing team. Suppose this player’s first hit happens at second $t_f$. Then the second hit must happen within seconds $[t_f + 1, t_f + 10]$. Each double spray adds $50$ points to the team’s score, and double sprays can be triggered consecutively.
Find the scores of the two teams.
Input Format
The first line contains an integer $n$.
The next $n$ lines each contain three integers $t_i, a_i, b_i$.
It is guaranteed that all $t_i$ are distinct and are given in increasing order.
Output Format
Output one line with two integers, representing the scores of the two teams.
Explanation/Hint
#### Constraints
For all testdata, $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$, and 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 exist | $15$ |
| $3$ | No special constraints | $25$ |
#### Notes
**The total score of this problem is $50$ points.**
This problem is translated from [Croatian Open Competition in Informatics 2021/2022](https://hsin.hr/coci/archive/2021_2022) [Contest #1](https://hsin.hr/coci/archive/2021_2022/contest1_tasks.pdf) T1 Ljeto.
Translated by ChatGPT 5