Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Divisor Luck
- A and B are playing a game.
- A has a range [L1 , R1] and B has a range [L2 , R2 ]. Both players pick a random number(each number is equi-probably picked) from their respective ranges.
- Their individual score is defined as the sum of divisors of the number they picked.The player with the higher score wins. You need to find out which player has a higher probability of winning.
- Output "A" if A has a higher chance of winning, "B" if B has a higher chance of winning and "Draw" if they win with equal
- probability.
- Inputs:
- The first line contains two space-separated integers, L1 and R1
- The second line contains two space-separated integers, L2 and R2
- Constraints:
- 1 <= L 1 <= R 1 <= 2 * 10^6
- 1 <= L 2 <= R 2 <= 2 * 10^6
- Sample Input
- 1 1
- 1 2
- Sample Output
- B
Add Comment
Please, Sign In to add comment