#abc285h. [abc285_h]Avoid Square Number
[abc285_h]Avoid Square Number
Problem Statement
You are given integers and , and a sequence of length .
Find the number, modulo , of sequences of length consisting of positive integers that satisfy the following conditions:
- no element is a square number;
- the product of all elements is .
Here,
- denotes the -th smallest prime.
- Two sequences and of the same length consisting of positive integers are considered different if and only if there exists an integer such that the -th terms of and are different.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Sample Input 1
3 2
3 2
Sample Output 1
15
The sequences of length whose total product is are listed below.
- and its permutations ( instances) are inappropriate because is a square number.
- and its permutations ( instances) are inappropriate because and are square numbers.
- and its permutations ( instances) are inappropriate because is a square number.
- and its permutations ( instances) are inappropriate because and are square numbers.
- and its permutations ( instances) are inappropriate because is a square number.
- and its permutations ( instances) are inappropriate because and are square numbers.
- and its permutations ( instances) are appropriate.
- and its permutations ( instances) are appropriate.
- and its permutations ( instances) are inappropriate because and are square numbers.
- and its permutations ( instances) are appropriate.
- and its permutations ( instances) are appropriate.
- and its permutations ( instances) are inappropriate because is a square number.
Therefore, sequences satisfy the conditions.
Sample Input 2
285 10
3141 5926 5358 9793 2384 6264 3383 279 5028 8419
Sample Output 2
672860525
Be sure to find the count modulo .