What is the error in my program there isnt output coming

@yaswanth0412 change this condition
image

to what should i change that

@yaswanth0412 see the condition you did sum > a[l] + a[r]
i have corrected that above

Yet i am not getting all the outputs for the following Sample Input 5 1 3 4 2 5 5 Sample Output 1 and 4 2 and 3

@yaswanth0412 do this, you will get correct output
image