#K77787. Dice Game Results
Dice Game Results
Dice Game Results
You are given the results of dice throws for two players, Sophie and Max. Each test case consists of 6 integers: the first three integers represent Sophie's dice throws and the last three integers represent Max's dice throws. For each test case, calculate the total sum for each player using the formulas:
\( S = a_1 + a_2 + a_3 \) and \( M = b_1 + b_2 + b_3 \).
Then output the result for that round as follows:
- If \( S > M \), output
1 0 0
(indicating Sophie wins the round). - If \( M > S \), output
0 1 0
(indicating Max wins the round). - If \( S = M \), output
0 0 1
(indicating the round is a draw).
The solution must read input from stdin and print the outputs to stdout, one line per test case.
inputFormat
The input begins with an integer T
(the number of test cases). Each of the next T
lines contains 6 space-separated integers: a1 a2 a3 b1 b2 b3
, representing the dice throw results of Sophie and Max respectively.
outputFormat
For each test case, output a single line containing three space-separated integers. These integers represent the outcome following these rules:
1 0 0
if Sophie wins0 1 0
if Max wins0 0 1
if it is a draw
3
1 2 3 4 5 6
3 3 3 2 2 2
6 5 4 3 2 1
0 1 0
1 0 0
1 0 0
</p>