Here is your task. Given a sequence A1, A2,.....AN , you have to find the maximum possible difference between sum of all elements of subsequence S of length K such that S1≥S2≥..........SK and sum of all elements of subsequence D of length same as S such that D1≤D2≤.........Dn (i.e (S1+S2+.....SK) - (D1+D2+.......DK)).
NOTE: Elements of both subsequences may be same or different.
In Sample Input
Maximum possible difference between sum of all elements of subsequence S and subsequence D is 45 where elements of Subsequence S are ( 28 , 20 , 16 ) and elements of
Subsequence D are ( 3 , 6 , 10 ).