https://www.codechef.com/submit/RECIPE

above is the link of the solution of the problem RECIPE Problem - CodeChef .
it is showing correct answer in the dev c++,but its showing wrong answer in codechef …
please help me find where my solution is going wrong.

No it isn’t :wink: This is, though :slight_smile:

Edit:

Consider the testcase:

1
2 52 54