Help in a easy DP problem subtask

Problem link: https://www.codechef.com/problems/COUPON/

Solution: https://www.codechef.com/viewsolution/28426316

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.