eolymp
bolt
Try our new interface for solving problems
Problems

Assignments

Assignments

Time limit 1 second
Memory limit 122 MiB

When Starfleet headquarters gets a request for an exploration expedition, they need to determine which ship from those currently docked in the docking bay to send. They decide to send whichever ship is currently able to make the expedition based on how much fuel is currently stored on the ship as well as how long it will take the ship to arrive at the expected destination.

Due to the age and current maintenance of the ships, each ship travels at a different top speed and has a different fuel consumption rate. Each ship reaches its top speed instantaneously.

Input data

The first line contains the number of test cases t (1t50). Each test case begins with a line with two space-separated integers n and d, where n (1n100) denotes the number of ships in the docking bay and d (1d10^6) denotes the distance in light-years to the expedition site. Next follow n lines with three space-separated integers v[i], f[i], and c[i], where v[i] (1v[i]1000) denotes the top speed of ship i in light-years per hour, f[i] (1f[i]1000) denotes the fuel on ship i in kilos of deuterium, and c[i] (1c[i]1000) denotes the fuel consumption of ship i in kilos of deuterium per hour.

Output data

For each test case, print a single integer on its own line denoting the number of ships capable of reaching the expedition site. Be careful with integer division!

Examples

Input example #1
2
3 100
52 75 10
88 13 44
56 9 5
2 920368
950 950 1
943 976 1
Output example #1
2
1
Source 2013 ACM North America - Pacific Northwest, Problem A