Kayzin has created a game called . In the game you will play as an archer and at the
beginning of the game you will get a bow with a level of . To get a more friendly game experience,
you can buy enhancement books to upgrade your bow.
Each enhancement book has two attribute. a / A is the probability of successfully upgrading your bow by 1
level when you use the book; if the upgrade fails, the bow will have a b / B probability of
breaking(reduced to level 0). When you buy an enhancement book, the store system will generate a
random integer[0,A-1] in with equal probability as attribute a and a random integer in [0 , B-1]
with equal probability as attribute b .
After you buy an enhancement book, you need to choose to use this enhancement book or discard it.
Kayzin would like to quiz the clever you on the best strategy to expectation of enhancement books you
need to buy to upgrade your bow from level to level .
输入格式
The first line contains an integer T ,denoting the number of groups of data. Next follows T
lines, for each line, there has three integers K,A,B
indicating that you need to raise the bow to level K , as well as the range of upgrade success rate A
and the range of breakage rate B using each enhancement book.
输出格式
Output the expectation of enhancement books to be purchased to raise a bow from 0 to K level, and
the result are reserved with digits after the decimal point.