##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
You are given a circle with points. At point , there are packages.
You have to choose exactly different gaps between adjacent points and cut the circle there. These cuts divide the circle into exactly non-empty contiguous parts.
The cost of a part is the sum of the packages inside it. Your task is to minimize the maximum cost among the parts.
For example, because the array is circular, one part may contain .
You have to solve the problem for test cases.
The circle can be split into parts with sums and , for example and . Therefore the maximum cost can be .
Every part must contain exactly one value because . The largest value is , so the answer is .
One optimal split has sums , , and , for example , , and . Hence the maximum cost is .
A split with maximum cost is possible: , , and . The last part uses the circular order.
A split with maximum cost is possible: , , and .