Except One
시간 제한1초메모리 제한2048 MB
소수 p와 제외할 값 k가 주어질 때, {1,...,p-1}에서 k를 뺀 집합의 모든 t원소 부분집합의 곱의 합을 p로 나눈 나머지를 구한다.
문제
You are given three integers , , , where is a prime number.
The set is defined as follows: .
Find the sum of the products of all -element subsets of , modulo .
입력
The first line contains three integers , , ( is a prime number; ; ; ).
출력
Print the sum of the products of all -element subsets of , modulo .