Monster i starts dist[i] kilometers away and moves toward the city at speed[i] kilometers per minute. You can eliminate one monster at time 0, then one at each whole minute. If any surviving monster reaches the city, you lose immediately, including when its arrival coincides with a shot time. Return the greatest number of monsters you can eliminate before losing, or the total number if you can eliminate them all.
Example 1:
Input: dist = [2,4,6]
speed = [1,1,1]
Output: 3Explanation: Eliminate the monsters at minutes 0, 1, and 2. Their arrival times are 2, 4, and 6, so all three shots occur in time.
Example 2:
Input: dist = [1,1]
speed = [1,1]
Output: 1Explanation: Both monsters reach the city at minute 1. Only one can be eliminated at minute 0; the other arrives before the next shot.
Example 3:
Input: dist = [3,5]
speed = [2,2]
Output: 2Explanation: The arrival times are 1.5 and 2.5 minutes. Eliminate the first monster at minute 0 and the second at minute 1, before either arrival.
Constraints:
1 <= dist.length <= 100000dist.length == speed.length1 <= dist[i], speed[i] <= 100000