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.
The four probabilities add up to exactly 100. 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) damage to every enemy champion in the game.
Attack damage and ability power both start at 0, and the champion casts only the ultimate, N times. Compute the expected total damage that one enemy takes.
The first line has the number of test cases T. Each of the next T lines holds one test case.
A test case is five integers N, adt, adp, apt, app separated by spaces. 1≤N≤24, and adt, adp, apt, app are percentages between 0 and 100 whose sum is exactly 100.
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.