CF894C Marco and GCD Sequence
题目描述
### 题目大意
有一天$Macro$做梦梦见了一位戴着黑框眼睛的长者,那位长者告诉他长生不老的密匙, $Macro$还想继续追问,但那位长者只说了四个字"无可奉告".随即他就消失在时间之风中
Macro醒来后只记得密匙是一个长度为$N$的正整数序列$a_i$,但是他事先闷声发大财,计算了所有$gcd(a_i,a_{i+1}...a_j) (1
输入格式
第一行一个正整数$M(1
输出格式
如果无解输出"-1"(没有引号)
否则第一行输出一个不超过$4000$的整数$N$表示密匙序列长度
第二行输入$N$个正整数$a_i (1
说明/提示
In the first example $ 2=gcd(4,6) $ , the other elements from the set appear in the sequence, and we can show that there are no values different from $ 2 $ , $ 4 $ , $ 6 $ and $ 12 $ among $ gcd(a_{i},a_{i+1},...,a_{j}) $ for every $ 1