Meeting Near the Fountain
Time limit1sMemory limit1024 MB
Given the total distance, park entrance distance, and two scooter speeds, find how many minutes late Kira arrives (rounded up), or 0 if she is on time.
- Level
Easy2 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
Kira plans to meet her friend Anna after minutes. The meeting point is in the center of the park, near the fountain. The distance from Kira's current location to the meeting point is meters.
The path to the meeting point first goes through the city streets, and then through the park. Kira realized she could be late if she walked, so she took an electric scooter.
Kira rode the electric scooter through the city streets to the park entrance, a distance of meters, at a speed of m/s. The park is a pedestrian zone, where the speed of electric scooters is limited. Kira noticed that her scooter's speed dropped to m/s right after she entered the park.
Determine whether Kira reaches the meeting point on time. If she does not, find how many minutes Anna will wait for Kira.
Input
The first line contains two integers () and (), the distance in meters between Kira's start and the meeting point, and the number of minutes until the planned meeting.
The second line contains a single integer (, ), the distance in meters between Kira's start and the park entrance.
The third line contains two integers and (), the electric scooter's speed before the park entrance and in the park, respectively.
Output
If Kira reaches the meeting point on time, print a single integer .
If she is late, print a single integer , the number of minutes Anna will wait for Kira. Round this value up.