GSHOP  Rama and Friends
Mahesh and Ramashish are good friends. Each day Ramashish gives an array arr[0,1,2...,n1] of size 'n' to Mahesh and asks him to modify it.
Modifying an array means to execute the following operation exactly 'k' times:
 "Replace any array element 'x' by 'x' i.e multiply it by 1."
Note that this operation can be performed on an array element zero,one or more times. But while modifying the array, Mahesh should also keep in mind that the sum of the elements of the final array should be maximum possible. Mahesh wants to go to sleep so he has to finish this job as soon as possible. Can you help him?
Input
First line of the input contains the number of test cases 'T'. Then follow 2T lines describing the test cases(Two lines for every test case).
For each test case, First line has two space separated integers 'n' (Number of elements in the array) and 'k' (Number of times to execute the operation described above) and the next line has 'n' space separated integers in nondecreasing order which are the array elements.
Constraints
 1 <= T <=10
 1 <= n <= 100
 1 <= k <= 100
For each 0 <= i <= n1, 10^5 <= arr[i] <= 10^5.
Output
Output T lines, one for each test case denoting the maximum possible sum which can be obtained after modifying the array.
Example
Input: 1 3 1 1 1 1 Output: 1
hide comments
vivek_dwivedi:
20180617 08:11:24
problem is very easy but. those who are getting wrong ans .. if you are calculating total in starting and then calulating min and then substracting min .... substract 2*min...


vaibhavk31:
20170616 15:24:12
Lot of Corner Cases


vengatesh15:
20170401 20:58:29
simple one no need to sort. elements are already in increasing order. 

shivendra_420:
20170207 11:13:13
can be done without sorting....just need to check for different values of k..... 

sachinsharma12:
20170120 10:57:09
Nice problem ....


fly_sky12:
20160521 17:26:06
take care of side cases. 

lalit_nit:
20160321 20:32:37
5 mint ....Sorting+....:P AC!!!!! 

pa_an:
20151023 08:51:17
k can be greater than n.. Last edit: 20151023 09:19:09 

jack_jay:
20150825 13:03:20
carefully find all cases......use sort.....no check for n......n got AC:) 

Shivam Singh:
20150821 13:30:23
after making all negatives positive, it all depends on whether the K left is even or odd ;) 
Added by:  dungeon_master 
Date:  20140124 
Time limit:  0.106s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  BF C CSHARP C++ 4.3.2 CPP C99 JAVA PASFPC PYTHON PY_NBC 
Resource:  My Own Problem 