Expected Ultimate Damage

No attempts yetTime limit1sMemory limit256 MB

Problem

The developers of Legend of League want to celebrate April Fools' Day with one absurdly strong champion. Every basic ability is finished, so only the ultimate is left.

When the champion casts the ultimate, exactly one of the four effects below is applied to the champion first.

  1. With probability adt%adt\%, your attack damage doubles.
  2. With probability adp%adp\%, your attack damage increases by 11.
  3. With probability apt%apt\%, your ability power doubles.
  4. With probability app%app\%, your ability power increases by 11.

The four probabilities add up to exactly 100100. An effect lasts until the game ends, and a doubling effect doubles the value accumulated so far.

After the effect is applied, the champion deals (attack damage)×(ability power)(\text{attack damage}) \times (\text{ability power}) damage to every enemy champion in the game.

Attack damage and ability power both start at 00, and the champion casts only the ultimate, NN times. Compute the expected total damage that one enemy takes.

Input

The first line has the number of test cases TT. Each of the next TT lines holds one test case.

A test case is five integers NN, adtadt, adpadp, aptapt, appapp separated by spaces. 1N241 \le N \le 24, and adtadt, adpadp, aptapt, appapp are percentages between 00 and 100100 whose sum is exactly 100100.

Output

For each test case, print the expected damage on its own line. Round at the seventh digit after the decimal point and print six digits after the decimal point, including trailing zeros when the value is an integer.