#abc245h. [abc245_h]Product Modulo 2
[abc245_h]Product Modulo 2
Problem Statement
Among the sequences of length consisting of integers, , how many satisfy all of the conditions below?
Find the count modulo .
-
for every .
-
$\\displaystyle\\prod_{i=1}^{K} A_i \\equiv N \\pmod M$.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 3 6
Sample Output 1
5
The five sequences satisfying the conditions are .
Sample Input 2
10 0 2
Sample Output 2
1023
Sample Input 3
1000000000 20220326 1000000000000
Sample Output 3
561382653
Be sure to find the count modulo .