Ceizenpok’s formula
시간 제한1초메모리 제한1024 MB
n이 10^18까지 커질 수 있고 m이 합성수일 때 C(n, k) mod m을 계산한다.
문제
Dr. Ceizenpok from planet i1c5l became famous across the whole Universe thanks to his recent discovery --- the Ceizenpok’s formula. This formula has only three arguments: , and , and its value is a number of -combinations of a set of modulo .
While the whole Universe is trying to guess what the formula is useful for, we need to automate its calculation.
입력
Single line contains three integers , , , separated with spaces (, , ).
출력
Write the formula value for given arguments , , .