Farmer John is building a brand new N-story barn with the help of his K cows (1≤N≤K≤1012 and N≤105). To build it as quickly as possible, he needs your help to figure out how to allocate work among the cows.
Each cow must be assigned to work on exactly one of the N floors of the barn, and each floor must have at least one cow assigned to it. The i-th floor requires ai units of total work, and each cow completes one unit of work per hour, so if c cows work on floor i, it is completed in ai/c units of time. For safety reasons, floor i must be completed before construction can begin on floor i+1.
Compute the minimum total time in which the barn can be completed if the cows are allocated to floors optimally. Output this number rounded to the nearest integer. It is guaranteed that the exact answer is more than 0.1 away from the boundary between two integers.