#P15852. [蓝桥杯第二届国际赛] 猜拳
[蓝桥杯第二届国际赛] 猜拳
Problem Description
Alice, Bob, and Cindy are playing a game of rock-paper-scissors.
Similar to rock-paper-scissors played by two people, in each round, each of them chooses one move from rock, scissors, and paper. The basic winning rules are: rock beats scissors, scissors beats paper, and paper beats rock. If in a round the players can be split into a winning side and a losing side, then every player on the losing side must pay $1 to every player on the winning side. If the players cannot be split into a winning side and a losing side, then no one pays any money.
For example, if Alice plays rock, and Bob and Cindy both play paper, then Alice must pay Bob $1 and also pay Cindy $1.
For another example, if Alice plays rock, Bob plays scissors, and Cindy plays paper, then no one pays any money.
They played a total of rounds. Ask how much money each person earns in net in the end, i.e., earned money minus paid money.
Input Format
The first line contains an integer , meaning the game is played for a total of rounds.
The next lines each contain three integers, representing the moves played by Alice, Bob, and Cindy in one round. means rock, means scissors, and means paper.
Output Format
Output three integers, one per line, representing the net money earned by Alice, Bob, and Cindy.
3
0 2 2
0 1 2
1 1 1
-2
1
1
Hint
Constraints
For all test cases, .
Translated by ChatGPT 5