Random Number Generator

Given how many values from 1 to N have been seen zero or one time, find the expected number of draws until every value appears at least twice.

Hard8ProbabilityDynamic programmingMathImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

There is a random number generator that returns an integer from 11 to NN uniformly at random. Each time the generator returns a number, a friend writes it down. The friend stops the generator as soon as every integer from 11 to NN has been recorded at least twice.

The generator has already returned KK numbers, and the ii-th returned number is AiA_i. Since the friend has not stopped the generator yet, at least one integer from 11 to NN has been returned fewer than twice.

Compute the expected number of additional requests needed until the friend stops the generator.

Input

The first line contains the number of test cases TT (1T100,0001 \le T \le 100{,}000).

The first line of each test case contains two integers NN and KK (1N3,0001 \le N \le 3{,}000, 0K100,0000 \le K \le 100{,}000). NN is the range of returned integers and KK is the number of integers already requested.

The second line of each test case contains KK integers A1,A2,,AKA_1, A_2, \dots, A_K (1AiN1 \le A_i \le N). This line is empty when K=0K = 0.

It is guaranteed that not every integer has been returned twice yet. The sum of KK over all test cases does not exceed 100,000100{,}000.

Output

For each test case, print the expected number of additional requests until the friend stops the generator, one per line.

An answer is accepted if its absolute or relative error is at most 10610^{-6}.

Hint

The expected remaining count depends only on how many integers have never appeared and how many have appeared exactly once, not on the full history.

When N=1N = 1 and nothing has been seen yet, 22 more requests are always needed. When N=1N = 1 and 11 has already appeared once, the answer is 11.