logo AlgoBeat OnlineJudge
登录 注册

#215799. [JAG 2024 Summer Camp #2] Noncoprime Subsequences

内存限制:1024 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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:

  • 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 .

样例

样例输入 1

3
2 3 6

样例输出 1

2
2

样例输入 2

5
1 1 1 1 1

样例输出 2

1
5

样例输入 3

10
631932 735902 895728 78537 723857 330739 286918 329211 539679 238506

样例输出 3

7
2