#Lutece0561. Game

Game

Migrated from Lutece 561 Game

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Today, Alice and Bob decide to go for a tour. Before they start, they find that they have to take a lot of things and neither of them wants to do it. So they plan to play a game and the loser takes things. The game as followings:

  • First step : they write down nn integers together. The n integers form a sequence SS.
  • Second step : Alice writes down an integer AA(1An1\leq A\leq n), and Bob writes down an integer BB(1Bn1\leq B\leq n)
  • Third step : Alice randomly choose a consecutive subsequece from SS. Any subsequence containing at least AA numbers could be chosen. Name the AthA_{th} smallest number of this subsequence as SASA. Bob does the same thing and the BthB_{th} smallest number of his subsequence is named SBSB.

Alice wins the game if SASA is larger than SBSB. Bob wins if SBSB is larger. If SASA equals SBSB, Alice and Bob would toss a coin to decide who wins. In this case, the probability for each of them to win is 0.50.5.

Now, they have written down nn integers. Alice gets the number AA and Bob gets the number BB. Alice wonders the probability for him to win the game.

Input

There are multiple test cases. The first line of the input will be an integer TT (T10T \leq 10) indicating the number of test cases.

For each case, the first line is an integer NN (1N30001 \leq N \leq 3000) - the number of integers. The second line contains NN integers wrote down in the first step. The absolute value of those integers are all less than 2312^{31}. The third line are two integers AA and BB.

Output

For each test case, print Case #t: r in a single line, in which t is the number of the test case starting from 11, and rr is a single real number (rounded to six decimal place), which represents the win probability of Alice.

Samples

2
3
2 2 3
3 2
3
1 2 3
2 1
Case #1: 0.833333
Case #2: 0.750000

Note

In the first case, the segment Alice chooses is [1,3][1,3].The segments Bob may choose are [1,2][1,2], [1,3][1,3], [2,3][2,3] with the same probability of 13\frac{1}{3} and their second number if sorted are 2,2,32,2,3. So the answer is $\frac{1}{3}+\frac{1}{3}+\frac{1}{3}\times\frac{1}{2}=\frac{5}{6}$.

Resources

10th UESTC Programming Contest Preliminary