A Math Contest P13 - Ways

View as PDF

Submit solution

Points: 17
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

There are N objects, and you need to choose M of them. Determine the number of ways to choose objects, where the order does not matter. Since this answer may be quite large, output this value modulo K.

Constraints

1MN1018

1K106

Input Specification

The only line contains three space-separated integers, N, M and K.

Output Specification

Output the number of unordered ways to choose M of the N objects, modulo K.

Sample Input

Copy
5 3 111

Sample Output

Copy
10

Comments

There are no comments at the moment.