#P13800. [SWERC 2023] Throwing dice
[SWERC 2023] Throwing dice
题目描述
:::align{center}
:::
Alice and Bob are discussing penalty shoot-outs and their randomness: "We might as well be throwing dice to determine the winner!", Alice said. And so they started simulating penalty shoot-outs by each throwing dice, summing the points indicated on their dice, and comparing these sums. The player with the largest sum wins; in case both sums are equal, there is a tie.
But even in such situations, some player might have an edge over their opponent, depending on which dice they throw. Thus, just by looking at the dice they are about to throw, Alice and Bob want to determine who has the better edge.
Alice has fair dice, with sides. For all integers and such that and , the die of Alice has a probability of showing its face numbered . Then, Alice's score is the sum of the numbers displayed by her dice. Similarly, Bob has fair dice, with sides.
Given these dice, Alice has a probability of having a strictly larger score than Bob, and Bob has a probability of having a strictly larger score than Alice. Which probability is the largest one?
输入格式
The input consists of three lines, each one containing space-separated integers. The first line contains the numbers and . The second line contains the numbers . The third line contains the numbers .
Limits
- ;
- ;
- for all ;
- for all ;
输出格式
The output should contain a single line, consisting of a single uppercase word: if , if , and if .
8 1
4 4 4 4 4 4 4 4
6
ALICE
2 2
6 4
4 6
TIED
提示
Sample Explanation 1
Since Alice has 8 dice, her score is always 8 or more; Bob's score is always 6 or less. Hence, Alice has a probability of beating Bob, and he has a probability of beating her. Consequently, .
Sample Explanation 2
Alice has a probability of beating Bob; he also has a probability of beating her.