Unable to pass all test cases for the problem Optimal Game Strategy 1

All my test cases are passing except for 1 test case in the above mentioned problem. I am using recursion to fnd the maximum number player 1 can get. I am unable to figure out any mistake in my approach. Please help.

Here is my ccode: https://ide.codingblocks.com/s/299110

@Yash5646 please share the correct code

@Ishitagambhir Sorry, overwrote the code by mistake.
Here is the correct link : https://ide.codingblocks.com/s/299110

hi @Yash5646 please refer to this