P13921 [CodeChef] CARRAY
提高
题目描述

Read problems statements in Mandarin chinese, Russian and Vietnamese as well.

Chef has a sequence A with length N and a line given by the equation y(x) = k · x + b. Let us say that an element A_{j} is reachable from another element A_{i} if the point (A_{i}, A_{j}) is lying above or on the line y(x), i.e. if A_{j} ≥ k · A_{i} + b.

Consider an arbitrary subsequence of A; let's denote it by B. Subsequence B is called good if its elements can be reordered in such a way that for each valid i, B_{i+1} is reachable from B_{i}.

Chef asked you to compute the maximum possible length of a good subsequence. Can you help him?

------ Input ------

The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains three space-separated integers N, k and b.
The second line contains N space-separated integers A_{1}, A_{2}, ..., A_{N}.

------ Output ------

For each test case, print a single line containing one integer — the length of the longest good subsequence of A.

------ Constraints ------

$1 ≤ T ≤ 5000$
$1 ≤ N ≤ 100000$
$0 ≤ k, b ≤ 10^{9}$
$0 ≤ A_{i} ≤ 10^{9} for each valid i$
$1 ≤ sum of N over all test cases ≤ 200000$

----- Sample Input 1 ------
1
5 4 1
100 2 4 17 8
----- Sample Output 1 ------
3
----- explanation 1 ------
Example case 1: We can choose the subsequence (100, 4, 17) and reorder it to get the sequence (4, 17, 100). In this sequence, 17 is reachable from 4 because 4 · 4 + 1 = 17 ? 17 and 100 is reachable from 17 because 4 · 17 + 1 = 69 ? 100. Hence, (100, 4, 17) is a good subsequence; there is no good subsequence of A with length 4 or more, so the answer is 3.

输入格式

见题面

输出格式

见题面

样例输入
1 5 4 1 100 2 4 17 8
样例输出
3