Mia
Time limit1sMemory limit1024 MB
Given two dice rolls for each player, decide who wins under Mia scoring: Mia is highest, then doubles, then the larger digit first.
- Level
Easy2 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Mia is a dice game for two players. Each roll consists of two dice. Mia involves bluffing about what a player has rolled, but this problem focuses only on its scoring rules. Unlike most other dice games, the score of a roll is not simply the sum of the dice.
A roll is scored as follows:
- Mia (12 or 21) is always the highest.
- Next come doubles (11, 22, and so on). Ties are broken by value, with 66 the highest.
- All remaining rolls are sorted so that the higher number comes first, forming a two-digit number. The value of the roll is the value of that number. For example, 3 and 4 become 43.
Input
The input contains multiple test cases. Each test case is a single line with four integers s0 s1 r0 r1, where s0 and s1 are the dice rolled by player 1 and r0 and r1 are the dice rolled by player 2. The input ends with a line containing four zeros.
Output
For each test case, print which player won, or whether the game was a tie, in exactly this format: Player 1 wins., Player 2 wins., or Tie.