Chef and Stocks
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Chef has started learning about the stock market and has already selected a favourite stock.
He traded the stock for consecutive days. Let denotes the profit earned by Chef on the -th day. Note that indicates that Chef had a loss on the -th day.
Chef wants to find the maximum amount of of profit he would have earned, if he skipped trading for exactly one day.
Input
The first line contains the number of test cases . The first line of each test case contains — the number of days. The next line denotes integers , denoting the profit earned by Chef on the -th day.
Output
For each test case, print on a new line the maximum amount of profit he would have earned, if he skipped trading for exactly one day.
Examples
Input #1
Answer #1
Submissions 183
Acceptance rate 55%