#BS0000067. Cắt khúc gỗ (Logs)
Cắt khúc gỗ (Logs)
Logs
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
There are logs of lengths . Perform at most cuts at arbitrary real positions. Minimize the length of the longest resulting log and print the ceiling of that optimum.
Input
The first line contains . The second line contains .
Output
Print the required integer.
Subtasks
- Subtask 1 — 20%: .
- Subtask 2 — 30%: .
- Subtask 3 — 50%: , , .
Example
Input
2 3
7 9
Output
4
Explanation
The optimal longest piece has length 3.5, whose ceiling is 4.