0% found this document useful (0 votes)
75 views2 pages

Problem M. Best of Two: Time Limit Code Length Limit OS

Alice and Bob play a game where each rolls a die three times, and the winner is determined by the sum of their two highest rolls. The input consists of multiple test cases with the rolls for both players, and the output indicates the winner or if it's a tie. The game can have up to 10,000 test cases, and the scores are calculated based on the highest rolls from each player's dice.

Uploaded by

shagir ahmed zia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views2 pages

Problem M. Best of Two: Time Limit Code Length Limit OS

Alice and Bob play a game where each rolls a die three times, and the winner is determined by the sum of their two highest rolls. The input consists of multiple test cases with the rolls for both players, and the output indicates the winner or if it's a tie. The game can have up to 10,000 test cases, and the scores are calculated based on the highest rolls from each player's dice.

Uploaded by

shagir ahmed zia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SPL_LAB_07 Dec 25, 2024

Problem M. Best of Two


Time limit 1000 ms
Code length Limit 50000 B
OS Linux

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.

Determine the winner of the game or if it is 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).

Test Case 3: Alice’s score is 12 = (6 + 6) which is same as Bob’s score 12 = (6 + 6).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy