Input: arr[] = {-2, -3, 4, -1, -2, 1, 5, -3}
Output: [-2 -3 1 5]
Explanation : After selecting subsequence -2 -3 1 5 and reverse it elements, modified array will be {5, 1, 4, -1, -2, -3, -2, -3} and thus the maximum contagious sum i.e. 5 + 1 + 4 = 10
Input: arr[] = {2, -6, -12, 7, -13, 9, -14}
Output: [-6 -12 7 9]
Explanation: After selecting the above subsequence modified array will be {2, 9, 7, -12, -13, -6, -14} and thus the maximum contagious sum i.e. is 2 + 9 + 7 = 18