#C8533. Minimum Water Stations
Minimum Water Stations
Minimum Water Stations
In a marathon event, it is essential to ensure that runners are never without water for too long. Given the length of the marathon route (n) and a maximum allowed run distance without water (d), your task is to determine the minimum number of water stations required along the route. The problem can be modeled by considering that a water station is available at the start of the route. The number of stations is computed using the formula (\frac{n+d}{d}), which effectively accounts for the starting station. For example, if (n = 10) and (d = 3), the stations are distributed such that no gap between consecutive stations exceeds (d) units, leading to a solution of 4 water stations.
inputFormat
The input consists of two space-separated integers provided in one line:\( n ) and ( d ), where ( n ) is the total length of the marathon route and ( d ) is the maximum distance a runner can go without reaching a water station.
outputFormat
Output a single integer representing the minimum number of water stations needed so that the distance between any two consecutive stations does not exceed ( d ) units.## sample
10 3
4