
ZOJ Problem Set  3557
Given a set S = {1, 2, ..., n}, number m and p, your job is to count how many set T satisfies the following condition:
InputThere are multiple cases, each contains 3 integers n ( 1 <= n <= 10^{9} ), m ( 0 <= m <= 10^{4}, m <= n ) and p ( p is prime, 1 <= p <= 10^{9} ) in one line seperated by a single space, proceed to the end of file. OutputOutput the total number mod p. Sample Input5 1 11 5 2 11 Sample Output5 6 Author: QU, Zhe Contest: ZOJ Monthly, October 2011 