|
||||||||||
SlalomTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 165 Accepted Submission(s): 3 Problem Description You are competing in ski slalom, and you need to select an optimal path for the race to maximize the number of gates you can pass through. There are N gates in total, and the gates can be considered as points. If you pass the left or the right of one gate, this gate should not be considered as a gate that you passed through. The ith gate occurs at distance yi down the hill, with the horizontal position of the ith gate given by xi. Each gate is further down the hill than the previous gate (i.e. yi < yi+1 for all i). Your pairs of skis has speed vd (i.e. you move with a constant downward velocity of vd meters per second). Additionally, at any time you may move at a horizontal speed of at most vh meters per second. You may start and finish at any two positions. Your task now is to calculate how many gates at most that you can pass through. Input There is an integer T (1 <= T <= 1000) in the first line, which indicates there are T test cases in total. For each test case, there are three integers N (1 <= N <= 30000), vd (1 <= vd <= 10000) and vh (1 <= vh <= 10000) in the first line, which have the same meaning as above. The following N lines each contain two integers xi (1 <= xi <= 1000000) and yi (1 <= yi <= 1000000), the horizontal and vertical positions respectively of the ith gate. There are at most 10 test cases that satisfy N > 100. Output For each test case, you should output the correct answer of the above task in one line. Sample Input
Sample Output
Hint For Sample 1, you can select to pass through gate 2 and gate 3 to maximize the number of gates you passed through. For Sample 2, you can select to pass through gate 1, gate 3 and gate 4 to maximize the number of gates you passed through. Source | ||||||||||
|