Doubt in a question

This is a question from CodeChef. I have tried to code it. The code works on the custom inputs but not for the inbuilt inputs. Therefore, I request you to kindly point out my mistake.

Here is the link for the question:
https://www.codechef.com/FEB21C/problems/MAXFUN

Here is the link to my code:

you have taken 3 consecutive values of x,y and z
but it is not necessary to be consecutive

x,y,z can be anything and it any order

as it is an ongoing contest
so i didn’t provide you the code
but i will share the brute force approach (which is partially correct)


now try to optimized this

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.