Given an array of size n your goal is to find a number such that when the number is processed against each array element starting from the 0th index till the (n-1)-th index under the conditions given below, it never becomes negative.
First line consists of T, test cases. First line of every test case consists of N, denoting number of elements in array. Second line consists of elements of array.
Single line output, print the smallest possible number.
3 4 3 2 4
1 2 3 4 5
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.