A worker must clear n batches of jobs, where batch i contains piles[i] jobs. The worker picks a single integer processing rate s (jobs per hour) and keeps it fixed. During each hour the worker focuses on exactly one batch: they process up to s jobs from it. If a batch has fewer than s jobs remaining, the worker finishes that batch during the hour and does not carry the leftover capacity to another batch that hour. Thus a batch of size p takes ceil(p / s) hours.
Given a deadline of H hours (with H >= n, so a solution always exists), return the smallest integer rate s >= 1 for which the total number of hours needed is at most H.
Input format
Line 1: an integer n, the number of batches.
Line 2: n space-separated positive integers, the batch sizes.
Line 3: an integer H, the hour budget.
Output format
A single integer: the minimum feasible processing rate s.
Constraints
- 1 ≤ n ≤ 100000
- 1 ≤ piles[i] ≤ 1000000000
- n ≤ H ≤ 1000000000
- A valid rate always exists because H ≥ n.