You are traveling through a car to your destination. The car is units from your destination. There are petrol stations between your current location and destination.
You are required to reach the destination by making the minimum possible number of stops on the way to your destination. The capacity of the petrol tank is large as there is no limit to the amount of petrol it can store. The car contains some initial amount of petrol in the tank that is denoted by .
Determine the minimum number of stops that is required to reach the destination or whether you can reach the destination.
Note:
Your destination is situated at coordinate . All the other distances are given with respect to the destination's location.
Input format
Output format
Print a single integer denoting the minimum number of stops that is required to reach the destination. If it is not possible to reach the destination, then print .
Constraints
There are 4 petrol stations on the way to town at distance 3, 6, 8, 15 from the town. These fuel stops can supply up to 15, 4, 5, and 6 units of petrol, respectively. The car is currently located 20 units away from the town. The car has 17 units of petrol initially.
Car drives 17 units and stops at station at distance 3 from the town to acquire petrol and drives to the town. Thus minimum number of stops required to drive to the town is 1.