PROBLEM LINK:
DIFFICULTY:
Easy
PREREQUISITES:
Probability, Maths
PROBLEM:
Ayush and Abhimanyu are trying to hit a target in turns. Probability of hitting target by Ayush is p/q and by Abhimanyu person is r/s. Ayush starts the game first. Find probability that ayush wins the game.
EXPLANATION:
We need to consider the case when ayush hits the target and when both do not hit the target.
let x=p/q and y=( 1-r/s )( 1-p/q ). Probability is xy^0 + xy^1 + xy^2 + …. We can reduce it to x/(1-y)
TIME COMPLEXITY:
O(1) per testcase
SOLUTION:
To be Updated Soon