创建于 2026/07/16 · 更新于 2026/07/16
Given a sequence of positive integers .
For every prefix of length (), consider all subsets of indices . Let . Count the number of subsets for which is a perfect square.
The empty subset is allowed; its product is defined as , which is a perfect square.
Two subsets are considered different if their sets of indices differ.
Since the answer can be large, output each count modulo .
The first line contains a single integer ().
The second line contains space-separated integers ().
Print exactly integers in a single line, separated by spaces. The -th integer () should be the answer for the prefix of length , modulo .
5
2 3 6 4 5
1
1
2
4
4
5
6 10 15 30 60
1
1
2
2
4