Bicycle Track Race
InterviewTime limit1sMemory limit1024 MB
Given each racer's time per lap and the race length in laps, count the racers who are never lapped and finish the race.
- Level
Medium4 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
In the Kingdom of Bits, a bicycle track race takes place. All cyclists start at the same time and ride laps. When one racer laps another, the lapped racer drops out of the race. If a racer crosses the finish line and laps a rival at that moment, the lapped rival also drops out. Given the time each cyclist needs to complete one lap of the track and the length of the race in laps, find how many participants are not lapped and finish the race.
Input
The first line contains three natural numbers separated by spaces:
- : number of racers;
- : length of the race in laps;
- : length of one lap of the track in meters.
Each of the next lines contains , the number of seconds one racer needs to complete one lap of the track. is a natural number.
Output
Print the number of racers who were not lapped and finished the race.