#K80517. Minimized Maximum Daily Hiking Distance
Minimized Maximum Daily Hiking Distance
Minimized Maximum Daily Hiking Distance
You are planning a multi-day hike. Given the total distance N to be hiked and the number of days D the hike will last, your task is to determine the minimized maximum distance that needs to be covered in any single day if the distance is distributed as evenly as possible.
This is equivalent to computing the ceiling of the division of N by D, that is, $$\lceil \frac{N}{D} \rceil$$.
Note: If N is 0, the answer should be 0. Additionally, when the number of days exceeds the distance, the answer remains 1 (if N > 0) because you still have to cover at least a single unit distance on any day where a hike occurs.
inputFormat
The input consists of two space-separated integers N and D on a single line, where N is the total distance to be hiked and D is the number of days the hike will take place.
outputFormat
Output a single integer representing the minimized maximum distance that needs to be covered in any single day.## sample
100 5
20