CF551C GukiZ hates Boxes
Description
Professor GukiZ is concerned about making his way to school, because massive piles of boxes are blocking his way.
In total there are $ n $ piles of boxes, arranged in a line, from left to right, $ i $ -th pile ( $ 1
Input Format
The first line contains two integers $ n $ and $ m $ ( $ 1
Output Format
In a single line, print one number, minimum time needed to remove all the boxes in seconds.
Explanation/Hint
First sample: Student will first move to the first pile ( $ 1 $ second), then remove box from first pile ( $ 1 $ second), then move to the second pile ( $ 1 $ second) and finally remove the box from second pile ( $ 1 $ second).
Second sample: One of optimal solutions is to send one student to remove a box from the first pile and a box from the third pile, and send another student to remove a box from the third pile. Overall, $ 5 $ seconds.
Third sample: With a lot of available students, send three of them to remove boxes from the first pile, four of them to remove boxes from the second pile, five of them to remove boxes from the third pile, and four of them to remove boxes from the fourth pile. Process will be over in $ 5 $ seconds, when removing the boxes from the last pile is finished.