Kkung's Space Trip

No attempts yetTime limit2sMemory limit128 MB

Problem

Kkung wants to travel through space, so he started planning a trip. After weighing a few things, he decided that a ship's fuel and the time it takes to reach the destination matter most. Kkung is enormously rich and owns several spaceships, and each one has a slightly different top speed and fuel consumption rate. The fuel consumption rate is the amount of fuel burned per unit of time.

Assume every ship reaches its top speed the moment it departs. Work out for Kkung how many of his ships can travel all the way to the place he wants to visit.

Input

The first line contains the number of test cases TT (1T501 \le T \le 50).

The first line of each test case contains two integers separated by a space: the number of ships NN (1N1001 \le N \le 100) and the distance to the destination DD (1D1061 \le D \le 10^6). Each of the next NN lines contains three integers separated by spaces: a ship's top speed viv_i (1vi10001 \le v_i \le 1000), its amount of fuel fif_i (1fi10001 \le f_i \le 1000), and its fuel consumption rate cic_i (1ci10001 \le c_i \le 1000).

Output

For each test case, print the number of ships that can reach the destination, one per line.

Watch out for integer division.