Snowball Fight

No attempts yetTime limit1sMemory limit128 MB

Problem

When there is a thick layer of snow on the ground, one of the best things to do is to pack the snow into balls and throw them at other people — a snowball fight.

A snowball fight has broken out between two teams of equal size, team A and team B. To settle the match before sunset, the two teams hold a duel.

Each person throws exactly one snowball, aimed at a member of the opposing team. The throwing order is fixed before the duel begins as $a_1, b_1, a_2, b_2, \dots$, where $a_i$ is the $i$-th person on team A and $b_i$ is the $i$-th person on team B. The duel starts with $a_1$'s throw.

When a person is hit by a snowball, they are knocked out of the duel. When it becomes someone's turn but they have already been knocked out, their turn is skipped and the next not-yet-eliminated person in the fixed order throws instead. For example, if $a_1$ knocks out $b_1$, the next person to throw is $a_2$. Each person throws at most once.

Once every turn has passed, the team with more members still standing wins the duel. If both teams have the same number of members remaining, the duel is a draw.

Every participant knows, for each person, the probability that this person lands a throw (this probability is the same no matter who the target is). Each person picks a target so as to maximize the probability that their own team wins the duel. If several targets tie for the highest chance of their team winning, they choose, among those, the target that minimizes the probability of the opposing team winning.

Assuming everyone plays optimally, compute the probability that team A wins, the probability that team B wins, and the probability of a draw.

Input

The first line contains the number of data sets $K$. Each data set has the following form:

  • A line with the number of players on each team, $2 \le N \le 8$.
  • A line with $N$ real numbers: the $i$-th value is the probability that the $i$-th person on team A lands a throw.
  • A line with $N$ real numbers: the $i$-th value is the same for team B.

Every probability $p$ satisfies $0 \le p \le 1$ and is given with two digits after the decimal point.

Output

For each data set, print Data Set x: on its own line, where $x$ is the 1-based data-set number. On the next line, print three values separated by single spaces: the probability that team A wins, the probability that team B wins, and the probability of a draw. Print each probability with exactly two digits after the decimal point. Separate consecutive data sets with a single blank line (there is no blank line after the last data set).