luogu#P4720. 【模板】扩展卢卡斯定理 / exLucas
【模板】扩展卢卡斯定理 / exLucas
Background
This is a template problem.
Problem Description
Compute
where is the binomial coefficient.
Input Format
One line with three integers , with meanings as described in the statement.
Output Format
Output one integer in one line, representing the answer.
5 3 3
1
666 233 123456
61728
Hint
For of the testdata, , , and it is not guaranteed that is a prime number.
Translated by ChatGPT 5