题库练习 Move by Prime
← 上一题 下一题 →

A10289 | Move by Prime

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

题目描述

Pussycat Sonya has an array consisting of $n$ positive integers. There are $2^{n}$ possible subsequences of the array. For each subsequence she counts the minimum number of operations to make all its elements equal. Each operation must be one of two:

- Choose some element of the subsequence and multiply it by some prime number.
- Choose some element of the subsequence and divide it by some prime number. The chosen element must be divisible by the chosen prime number.

What is the sum of minimum number of operations for all $2^{n}$ possible subsequences? Find and print this sum modulo $10^{9}+7$ .

输入格式

The first line of the input contains a single integer $n$ ( $1<=n<=300000$ ) — the size of the array.

The second line contains $n$ integers $t_{1},t_{2},...,t_{n}$ ( $1<=t_{i}<=300000$ ) — elements of the array.

输出格式

Print the sum of minimum number of operation for all possible subsequences of the given array modulo $10^{9}+7$ .

输入输出样例

输入 #1
3
60 60 40
输出 #1
6
输入 #2
4
1 2 3 4
输出 #2
24
C++ 编辑器
输入
输出