Kkung's Space Trip
InterviewTime limit2sMemory limit128 MB
Count the ships that reach the destination by checking whether each ship's fuel covers its burn rate over the travel time.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
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 ().
The first line of each test case contains two integers separated by a space: the number of ships () and the distance to the destination (). Each of the next lines contains three integers separated by spaces: a ship's top speed (), its amount of fuel (), and its fuel consumption rate ().
Output
For each test case, print the number of ships that can reach the destination, one per line.
Watch out for integer division.