Book allocation problem

hey I am getting the correct output in sample test case but cant pass any test case after submiting.

https://ide.codingblocks.com/s/214307 this is my code

@S19WDPP0014 The code is although correct, but the initialisation for result variable is small, INT8_MAX, here the answer will surely more than of 8 bits. Use INT32_MAX value atleast.