计蒜客 2017 ACM-ICPC 亚洲区(西安赛区)网络赛 B coin(求乘法逆元)
Bob has a not even coin, every time he tosses the coin, the probability that the coin's front face up isqp(qp≤12)\frac{q}{p}(\frac{q}{p} \le \frac{1}{2})pq(pq≤21).The question is, w