Problem M. Best of Two: Time Limit Code Length Limit OS
Problem M. Best of Two: Time Limit Code Length Limit OS
Alice and Bob are playing a game. Each player rolls a standard six-sided die three times.
The score of a player is calculated as the sum of the two highest rolls. The player with the
higher score wins. If both players have the same score, the game ends in a tie.
Input Format
The first line of input will contain a single integer T , denoting the number of test
cases.
Each test case contains six space-separated integers A1 , A2 , A3 , B1 , B2 and B3 — the
values Alice gets in her 3 dice rolls, followed by the values which Bob gets in his 3 dice
rolls.
Output Format
For each test case, output on a new line Alice if Alice wins, Bob if Bob wins and Tie in
case of a tie.
Note that you may print each character in uppercase or lowercase. For example, the strings
tie , TIE , Tie , and tIe are considered identical.
Constraints
1 ≤ T ≤ 104
1 ≤ A1 , A2 , A3 , B1 , B2 , B3 ≤ 6
Sample 1
-
SPL_LAB_07 Dec 25, 2024
Input Output
3 Alice
3 2 5 6 1 1 Bob
4 4 5 6 4 1 Tie
6 6 6 6 6 1
**Test Case 1:** Alice's score is 8 = (3 + 5) which is greater than Bob's score 7 = (6 + 1).
Test Case 2: Alice’s score is 9 = (5 + 4) which is less than Bob’s score 10 = (6 + 4).