Binomial coefficients 4
Medium
Execution time limit is 2 seconds
Runtime memory usage limit is 64 megabytes
You are given non-negative integers n, k, m. Find the number C(n,k) modulo m.
Input The first and only line of the input file contains non-negative integers n, k, m separated by spaces. This numbers satisfy the inequalities 1<=n<=10^18, 0<=k<=min(n,200000), 1<=m<=2000000000. Output The first and only line of the output file should contain required number C(n,k) modulo m.
Examples
Input #1
Answer #1
Submissions 738
Acceptance rate 11%