Chemistry Class

Time limit: 0.5s Memory limit: 256MB Input: Output:

I am an extremely overqualified high school chemistry teacher. When I can work, I make 43,700$ per year.

  • Walter White, Breaking Bad

Walter White has 2n2n students in his chemistry class. Student ii has chemistry skill aia_i.

He wants to divide students into nn pairs for a group exercise. The pair works better together if their skills are closer. More precisely,

  • If skills of students in a pair differ by more than AA, they will blow up the lab;
  • If skills of students in a pair differ by at most AA, but by more than BB, they will produce a mediocre product;
  • If skills of students differ by at most BB, they will produce 99.1%99.1\% pure product.

Walter wants to split students into nn pairs so that:

  • Lab is not blown up;
  • The number of pairs that produced 99.1%99.1\% pure product is as large as possible.

Determine if Walter can split students in such a way, and if he can, find the largest possible number of pairs that would produce 99.1%99.1\% pure product.

Input data

The first line contains a single integer tt (1t1051 \le t \le 10^5) - the number of test cases. The description of test cases follows.

The first line of each test case contains three integers n,A,Bn, A, B (1n2105,1B<A10181 \leq n \leq 2\cdot 10^5, 1 \leq B < A \leq 10^{18}) - the number of students.

The second line of each test case contains 2n2n integers a1,a2,,a2na_1, a_2, \ldots, a_{2n} (0ai10180 \leq a_i \leq 10^{18}) - skills of the students.

It is guaranteed that the sum of nn over all test cases does not exceed 21052\cdot 10^5.

Output data

For each test case, if there is no way to split the students into pairs without blowing up the lab, output 1-1. Otherwise, output the largest possible number of pairs that would produce 99.1%99.1\% pure product.

Example

stdin

4
1 2 1
42 69
2 3 1
1 2 3 4
2 5 1
6 1 3 4
5 19 1
1 7 8 9 10 11 12 13 14 20

stdout

-1
2
1
4

Explanation

In the first test case, it's impossible to split students into pairs without blowing up the lab.

In the second test case, we can pair the first student with the second, and the third one with the fourth one. Both pairs will have a difference in skills equal to 11, and both will produce 99.1%99.1\% pure product.

Log in or sign up to be able to send submissions!