3075: 【普及/提高-】【P1414】又是毕业季II

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:1 解决:1

题目描述

彩排了一次,老师不太满意。当然啦,取每位同学的号数来找最大公约数显然不太合理。于是老师给每位同学评了一个能力值。于是现在问题变为,从 lns="http://www.w3.org/1998/Math/MathML"> 个学生中挑出 lns="http://www.w3.org/1998/Math/MathML"> 个人使得他们的默契程度(即能力值的最大公约数)最大。但因为节目太多了,而且每个节目需要的人数又不知道。老师想要知道所有情况下能达到的最大默契程度是多少。这下子更麻烦了,还是交给你吧~

PS:一个数的最大公约数即本身。

【数据范围】

记输入数据中能力值的最大值为 lns="http://www.w3.org/1998/Math/MathML">inf

  • 对于 lns="http://www.w3.org/1998/Math/MathML">20% 的数据,lns="http://www.w3.org/1998/Math/MathML">5lns="http://www.w3.org/1998/Math/MathML">inf103
  • 对于另 lns="http://www.w3.org/1998/Math/MathML">30% 的数据,lns="http://www.w3.org/1998/Math/MathML">100lns="http://www.w3.org/1998/Math/MathML">inf10
  • 对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">104lns="http://www.w3.org/1998/Math/MathML">inf106

输入

第一行一个正整数 lns="http://www.w3.org/1998/Math/MathML">

第二行为 lns="http://www.w3.org/1998/Math/MathML"> 个空格隔开的正整数,表示每个学生的能力值。

输出

总共 lns="http://www.w3.org/1998/Math/MathML"> 行,第 lns="http://www.w3.org/1998/Math/MathML"> 行为 lns="http://www.w3.org/1998/Math/MathML">= 情况下的最大默契程度。

样例输入 复制

4
1 2 3 4

样例输出 复制

4
2
1
1