Save the computer

No attempts yetTime limit1sMemory limit256 MB

Problem

A computer is built from several components. If any one of them fails, the whole computer stops. The semester budget arrives in one lump at the start of the semester, so you can spend it on spare components and swap a spare in the moment something breaks.

Failures follow a Poisson distribution. The probability that component ii fails exactly kk times during tt time units is

Pi(k,t)=eλit(λit)kk!P_i(k, t) = \frac{e^{-\lambda_i t}(\lambda_i t)^k}{k!}

Only one semester is considered here, so tt is fixed at 1 and the formula reduces to

Pi(k)=eλiλikk!P_i(k) = \frac{e^{-\lambda_i}\lambda_i^k}{k!}

λi\lambda_i is the expected number of times component ii fails in one semester. Failures of different components are independent.

If you buy sis_i spares of component ii, the computer keeps running as long as component ii fails at most sis_i times during the semester. One spare of component ii costs rir_i, and the total money spent on spares cannot exceed the budget bb. The probability that the computer survives the whole semester is the product of the per component probabilities.

Decide how many spares of each component to buy within the budget so that this probability is as large as possible.

Input

The first line contains the number of test cases nn (1n501 \le n \le 50).

Each test case consists of three lines. The first line contains the number of components that may fail, cc (1c5001 \le c \le 500), and the budget bb (0b5000 \le b \le 500), separated by a single space. The second line contains cc floating point numbers. The iith number is λi\lambda_i (0.0λi5.00.0 \le \lambda_i \le 5.0), the expected number of times component ii fails in one semester. The third line contains cc integers. The iith number is rir_i (1ri1001 \le r_i \le 100), the price of one spare of component ii.

Output

For each test case, print the maximum survival probability you can reach on a line of its own, rounded to 5 decimal places.