You are given an array A representing size of candles which reduce 1 unit in a day. Room is illuminated using given x candles, where x is the size of array A. Question is to find maximum number of days room is without darkness.
The first line of input consists of an integer T denoting the number of test cases. T testcases follow. Each test case contains an integer N denoting the size of the array. Then in the next line are N space separated elements of the array.
For each test case, print the maximum number of days room will be illuminated.
1<=Elements of array <=1018
1 1 2
2 3 4 1 2
Testcase1: The candles' length reduce by 1 in 1 day.
So, at the end of day 1: Sizes would be 0 0 1
So, at end of day 2: Sizes would be 0 0 0.
This means the room was illuminated for 2 days.
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.