题库练习 Bash's Big Day
← 上一题 下一题 →

A10679 | Bash's Big Day

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Bash has set out on a journey to become the greatest Pokemon master. To get his first Pokemon, he went to Professor Zulu's Lab. Since Bash is Professor Zulu's favourite student, Zulu allows him to take as many Pokemon from his lab as he pleases.

But Zulu warns him that a group of $k>1$ Pokemon with strengths ${s_{1},s_{2},s_{3},...,s_{k}}$ tend to fight among each other if $gcd(s_{1},s_{2},s_{3},...,s_{k})=1$ (see notes for $gcd$ definition).

Bash, being smart, does not want his Pokemon to fight among each other. However, he also wants to maximize the number of Pokemon he takes from the lab. Can you help Bash find out the maximum number of Pokemon he can take?

Note: A Pokemon cannot fight with itself.

输入格式

The input consists of two lines.

The first line contains an integer $n$ ( $1<=n<=10^{5}$ ), the number of Pokemon in the lab.

The next line contains $n$ space separated integers, where the $i$ -th of them denotes $s_{i}$ ( $1<=s_{i}<=10^{5}$ ), the strength of the $i$ -th Pokemon.

输出格式

Print single integer — the maximum number of Pokemons Bash can take.

输入输出样例

输入 #1
3
2 3 4
输出 #1
2
输入 #2
5
2 3 4 6 7
输出 #2
3
C++ 编辑器
输入
输出