#Q3. 「一本通 1.1 例 3」喷水装置

「一本通 1.1 例 3」喷水装置

Description

Source: UVa 10382

A lawn is LL meters long and WW meters wide, equipped with nn sprinklers. Each sprinkler is installed on the central line of the lawn (at a distance of W2\frac{W}{2} meters from both sides). We know the position of each sprinkler (the distance from the left end of the central line) and its watering radius.

Question: What is the minimum number of sprinklers that need to be turned on simultaneously to water the entire lawn?

Picture1

Input Format

The input consists of multiple test cases.

The first line contains an integer TT indicating the number of test cases.

For each test case, the first line contains three integers nn, LL, and WW.

The next nn lines each contain two integers, representing the position and watering radius of a sprinkler (the diagram above corresponds to the first sample input).

Output Format

For each test case, output a single number representing the minimum number of sprinklers needed to water the entire lawn. If it is impossible to water the entire lawn even with all sprinklers turned on, output 1-1.

Sample 1

3
8 20 2
5 3
4 1
1 2
7 2
10 2
13 3
16 2
19 4
3 10 1
3 5
9 3
6 1
3 10 1
5 3
1 1
9 1

6
2
-1

Data Range and Hint

For 100%100\% of the data, n15000n \le 15000.