#abc285h. Ex - Avoid Square Number
Ex - Avoid Square Number
Score : points
问题描述
给定整数 和 ,以及长度为 的序列 。
求满足以下条件的长度为 的正整数序列的数量,结果对 取模:
- 序列中没有平方数元素;
- 所有元素的乘积为 。
这里,
- 表示第 小的质数。
- 两个相同长度且由正整数组成的序列 和 被认为是不同的,当且仅当存在某个整数 ,使得 和 的第 项不同。
以上为通义千问 qwen-max 翻译,仅供参考。
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 .
update @ 2024/3/10 11:56:46