Ուղարկել | Բոլոր լուծումները | Լավագույն լուծումները | Վերադառնալ ցուցակին |
ACM_0060 - ASSIGNMENTS |
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
Input begins with a line with one integer T (1 ≤ T ≤ 50) denoting the number of test cases. Each test case begins with a line with two space-separated integers N and D, where N (1 ≤ N ≤ 100) denotes the number of ships in the docking bay and D (1 ≤ D ≤ 106) denotes the distance in light- years to the expedition site. Next follow N lines with three space-separated integers vi, fi, and ci, where vi (1 ≤ vi ≤ 1000) denotes the top speed of ship i in light-years per hour, fi (1 ≤ fi ≤ 1000) denotes the fuel on ship i in kilos of deuterium, and ci (1 ≤ ci ≤ 1000) denotes the fuel consumption of ship i in kilos of deuterium per hour.
Output
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
№ |
stdin |
stdout |
1 |
2 3 100 52 75 10 88 13 44 56 9 5 2 920368 950 950 1 943 976 1 |
2 1 |
Ավելացրեց. | Հրանտ Հովհաննիսյան |
Ամսաթիվ. | 2014-01-03 |
Ժամանակի սահմանափակումը. | 1s |
Ծրագրի տեքստի սահմանափակումը. | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Լեզուներ. | Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE |
Աղբյուրը. | NA Pacific NW 2013.A |