Binomial Coefficient 5
Time limit1sMemory limit256 MB
Compute the remainder of the binomial coefficient C(N, K) divided by M, where M is not necessarily prime.
- Level
Medium7 of 10
- Topics
- Number theory, Combinatorics
- Solved
- No attempts yet
Problem
You are given a natural number and an integer . Write a program that computes the remainder of the binomial coefficient divided by . is not guaranteed to be prime.
Input
The first line contains , , and , separated by spaces. (, , )
Output
Print the remainder of divided by on the first line.