luogu#P7927. [COCI 2021/2022 #1] Ljeto
[COCI 2021/2022 #1] Ljeto
Problem Description
Two teams of four players, Pineapple and Blueberry, are playing with water guns.
We will be given pieces of information about the game. Each piece is in the form: at second , player hit player . For a player , if , then they are on Team Pineapple; otherwise, they are on Team Blueberry. Each hit adds points.
A “double spray” is defined as follows: within seconds, a player consecutively hits players from the opposing team. Suppose this player’s first hit happens at second . Then the second hit must happen within seconds . Each double spray adds 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 .
The next lines each contain three integers .
It is guaranteed that all are distinct and are given in increasing order.
Output Format
Output one line with two integers, representing the scores of the two teams.
3
10 1 6
20 1 7
21 8 1
250 100
3
10 2 5
15 2 6
25 2 5
400 0
2
10 5 2
11 6 3
0 200
Hint
Constraints
For all testdata, , , , , and player and player are not on the same team.
| Subtask | Special Constraints | Points |
|---|---|---|
| No double sprays exist | ||
| No special constraints |
Notes
The total score of this problem is points.
This problem is translated from Croatian Open Competition in Informatics 2021/2022 Contest #1 T1 Ljeto.
Translated by ChatGPT 5