#P1338A. Powered Addition
Powered Addition
No submission language available for this problem.
Description
You have an array of length . For every positive integer you are going to perform the following operation during the -th second:
- Select some distinct indices which are between and inclusive, and add to each corresponding position of . Formally, for . Note that you are allowed to not select any indices at all.
You have to make nondecreasing as fast as possible. Find the smallest number such that you can make the array nondecreasing after at most seconds.
Array is nondecreasing if and only if .
You have to answer independent test cases.
The first line contains a single integer () — the number of test cases.
The first line of each test case contains single integer () — the length of array . It is guaranteed that the sum of values of over all test cases in the input does not exceed .
The second line of each test case contains integers ().
For each test case, print the minimum number of seconds in which you can make nondecreasing.
Input
The first line contains a single integer () — the number of test cases.
The first line of each test case contains single integer () — the length of array . It is guaranteed that the sum of values of over all test cases in the input does not exceed .
The second line of each test case contains integers ().
Output
For each test case, print the minimum number of seconds in which you can make nondecreasing.
Samples
Note
In the first test case, if you select indices at the -st second and at the -nd second, then will become . There are some other possible ways to make nondecreasing in seconds, but you can't do it faster.
In the second test case, is already nondecreasing, so answer is .
In the third test case, if you do nothing at first seconds and select index at the -rd second, will become .