#P15742. [JAG 2024 Summer Camp #2] Noncoprime Subsequences
[JAG 2024 Summer Camp #2] Noncoprime Subsequences
题目描述
Given a sequence , a good subsequence of is defined as a subsequence, that is not necessarily contiguous, where adjacent elements in the subsequence are not coprime.
Find the maximum length of a good subsequence of . Also, determine the number of good subsequences of length , modulo .
输入格式
The input is given in the following format:
$$\begin{aligned} &N \\ &A_1 \ A_2 \ \ldots \ A_N \end{aligned} $$- All input values are integers.
输出格式
Output 2 lines. On the first line, output . On the second line, output the number of good subsequences of length of , modulo .
3
2 3 6
2
2
5
1 1 1 1 1
1
5
10
631932 735902 895728 78537 723857 330739 286918 329211 539679 238506
7
2