#P3499. [POI2010] NAJ-Divine Divisor

    ID: 2553 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>数学2010POI素数判断,质数,筛法

[POI2010] NAJ-Divine Divisor

题目描述

An integer is given.

We say that an integer is a divisor of with multiplicity ( is integer) if and does not divide .

For example, the number has the following divisors:

2 with multiplicity 4, 3 with multiplicity 1, 4 with multiplicity 2, 6 with multiplicity 1, and so on.

We say that a number is a divine divisor of the number if is a divisor of with multiplicity and has no divisors with multiplicities greater than .

For example, the sole divine divisor of 48 is 2 (with multiplicity 4), and the divine divisors of 6 are: 2, 3 and 6 (each with multiplicity 1).

Your task is to determine the multiplicity of divine divisors of and the number of its divine divisors.

给定一个正整数 mm 以及长度为 mm 的正整数序列 aa ,同时给出 n=i=1main = \prod_{i=1}^{m}{a_i}。你需要找出一个最大的 kk 使得存在一个 dd , d>1d > 1 并且 dknd^k | n。求这个最大的 kk 以及在 kk 最大的情况下有多少个 dd 满足条件。

输入格式

The number is given on the standard input, though in a somewhat unusual way.

The first line holds a single integer ().

The second line holds integers () separated by single spaces.

These denote that .

输出格式

The first line of the standard output should hold the maximum integer such that there exists a divisor of such that .

The second line should hold a single integer that is the number of (divine) divisors of with multiplicity .

3
4 3 4
4
1

提示

1m6001\le m\le 600,且1im\forall 1\le i\le m,有1ai10181\le a_i\le 10^{18}