Need help in Coding Squad problem VISIONMS

Can you help??
I couldn’t find the right approach.

@ram_jamuria

If you write down on paper for first few k=1,2,3… you will find a pattern of combinatorics, for for 50 points you can precalculate factorial, but for 100 points its not possible to precalculate such huge factorial, but you can calculate each ncr from previous ncr.
So, once you get the pattern and formula, you can see my code to understand how to calculate it efficiently.
https://www.codechef.com/viewsolution/30372646