#P9142. Bowcraft

Bowcraft

Source: Super League of Chinese College Students Algorithm Design 2022, Contest 2 by HDU.

Problem Description

Kayzin has created a game called Bowcraft. 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 00. To get a more friendly game experience, you can buy enhancement books to upgrade your bow.

Each enhancement book has two attribute. aA\frac{a}{A} is the probability of successfully upgrading your bow by 11 level when you use the book; if the upgrade fails, the bow will have a bB\frac{b}{B} probability of breaking(reduced to level 0). When you buy an enhancement book, the store system will generate a random integer in [0,A1][0, A-1] with equal probability as attribute aa and a random integer in [0,B1][0, B-1] with equal probability as attribute bb.

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 00 to level KK.

Input

The first line contains an integer T(T10)T(T\le 10) ,denoting the number of groups of data. Next follows TT lines, for each line, there has three integers KK (1K1000)(1\le K\le 1000) , AA , BB (2A,B100)(2\le A,B\le 100), indicating that you need to raise the bow to level KK, as well as the range of upgrade success rate AA and the range of breakage rate BB using each enhancement book.

Output

Output the expectation of enhancement books to be purchased to raise a bow from 00 to KK level, and the result are reserved with 33 digits after the decimal point.

Sample

3
1 3 3
2 3 3
319 100 100
3.000
7.000
13436.938