Given an array A of N integers. Your task is to make all the integers 0 by performing the following two operations.
You must perform the above two operations to make all the elements of the array to be 0.
In one step, you can perform the above two operations.
Now your job is to find the minimum number of steps needed to make all the elements of the array to be 0.
Input starts with an integer T (T <= 100), denoting the number of test cases.
Each case contains an integer N(1<=N<=100) and then next line N integers follow. Each integer is between -100 to 100 inclusive.
For each case, print the case number and minimum number of steps needed.
Input | Output |
---|---|
2 3 7 7 7 4 1 -2 1 2 | Case 1: 7 Case 2: 2 |
This problem was authored for CodeMask Championship 2016 and is being hosted on Toph per organizer’s request.