Guest User

Untitled

a guest
Jul 21st, 2019
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Divisor Luck
  2.  
  3. A and B are playing a game.
  4. 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.
  5.  
  6. 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.
  7.  
  8. 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
  9. probability.
  10.  
  11. Inputs:
  12.  
  13. The first line contains two space-separated integers, L1 and R1
  14. The second line contains two space-separated integers, L2 and R2
  15.  
  16. Constraints:
  17. 1 <= L 1 <= R 1 <= 2 * 10^6
  18. 1 <= L 2 <= R 2 <= 2 * 10^6
  19.  
  20. Sample Input
  21. 1 1
  22. 1 2
  23.  
  24. Sample Output
  25. B
Add Comment
Please, Sign In to add comment