eolymp
bolt
Try our new interface for solving problems
Problems

Binomial coefficients 4

Binomial coefficients 4

You are given non-negative integers \textbf{n, k, m}. Find the number \textbf{C(n,k)} modulo \textbf{m}. \textbf{Input} The first and only line of the input file contains non-negative integers \textbf{n, k, m} separated by spaces. This numbers satisfy the inequalities \textbf{1<=n<=10^18, 0<=k<=min(n,200000), 1<=m<=2000000000}. \textbf{Output} The first and only line of the output file should contain required number \textbf{C(n,k)} modulo \textbf{m}.
Time limit 2 seconds
Memory limit 64 MiB
Input example #1
6 3 14
Output example #1
6
Author Anton Lunev