Help in a easy DP problem subtask

Problem link: COUPON Problem - CodeChef

Solution: CodeChef: Practical coding for everyone

In subtask 1 where m = 2, the solution is giving wrong answer, any help. Thank you

The answer is large, so INT_MAX may not work

1 Like

thanks, it worked with 1e18.