Rock Paper Scissors
InterviewTime limit1sMemory limit128 MB
Compare the two players' winning chances from their move probabilities and print who is more likely to win each match.
- Level
Easy2 of 10
- Topics
- Probability, Math, Implementation
- Solved
- No attempts yet
Problem
Adam and Gosia play Rock Paper Scissors.
In each round both players simultaneously choose paper, rock, or scissors.
- Paper beats rock.
- Rock beats scissors.
- Scissors beats paper.
If both players choose the same move, that round is replayed until someone wins.
Given the probability with which each player chooses paper, rock, and scissors, determine which player is more likely to win the match.
Input
The first line contains the number of test cases ().
Each test case consists of two lines. The first line contains three real numbers (, ): the probabilities that Adam chooses paper, rock, and scissors respectively. The second line contains three real numbers (, ): the probabilities that Gosia chooses paper, rock, and scissors respectively.
Output
For each test case, print one line:
ADAMif Adam is more likely to win,GOSIAif Gosia is more likely to win,=if both players have an equal chance of winning.