I am working on this problem . As I am a newbie in algorithm designing , I wanted to know how can we solve this problem. Please help me in figuring this out in brief. P.S.  A tutorial can be a great help for many other people like me who wants to learn. Thanks In Advance. asked 29 Jun '15, 01:55

What you have to do is find n!(k!(nk)!)^1 right,
here is the code : click here answered 29 Jun '15, 12:39
How did you write the power function? I don't understand it.
(29 Jun '15, 14:51)
this is a common technique called modular exponentiation https://en.wikipedia.org/wiki/Modular_exponentiation
(30 Jun '15, 14:11)

@king_of_hacker,can you tell me when the fermats test can be used;if a[n] is divisible by Mod and ans of total combination value (a[n]/(a[k]*a[nk]))%Mod gives some non zero value then how to get through that case? if we do by your way it gives zero ans in that case as we are separtaely calculating mod of each and multiplying;so ifa[n]%mod=0,then whole will become zero.I am a newbie,Sorry if any conceptual mistakes are on my side. answered 29 Jun '15, 16:54
cool, mod here is 10^9+7 which is prime, so a[n]%mod wont be zero, because for a[n] to be divisible by mod, a[n] should be mod!(factorial). That's why mod will be a prime number most of the times.
(30 Jun '15, 14:08)
Got it.Thank you.
(30 Jun '15, 16:24)
