January lunchtime 2021

https://www.codechef.com/LTIME92C/problems/SHSPOONS
Can you please explain this problem

Since we have to remove element from the smallest element so we cannot make 1st one as empty and then shift all to it .
The next thing is that since we want all elements in 1 so we will have yo transfer them regularly and keep on increasing it . And if at the end we are not able to transfer then the Answer is No.
You can store the array index and array value in pair of set . Iterate in the set Now till the time the height of 1st is larger than the height of the new one just keep deleting that element from set and keep adding its value to the 1st one, then when you encounter the case that value in set is greater than 1st one then just add the extra value to the next element in the set (if there is no next element there is no answer ) and remove the make the current value = value of 1st and make value of 1st twice .