Combi problem (with number theory I suppose?)
This is not relevant for jee but the first part was easy but the second one seems to elude me, case-working for small numbers didn't help either.

+solved @user1 @user2... to close the thread when your doubt is solved. Mention the users who helped you solve the doubt. This will be added to their stats.