Codeforces Round 157 (Div. 2)
E
Little Elephant and LCM
Codeforces
未评级
原题
← D→
翻译中…

The Little Elephant loves the LCM (least common multiple) operation of a non-empty set of positive integers. The result of the LCM operation of $*k*$ positive integers $*x*_{1}, *x*_{2}, ..., *x*_{*k*}$ is the minimum positive integer that is divisible by each of numbers $*x*_{*i*}$.

翻译中…

Let's assume that there is a sequence of integers $*b*_{1}, *b*_{2}, ..., *b*_{*n*}$. Let's denote their LCMs as $*lcm*(*b*_{1}, *b*_{2}, ..., *b*_{*n*})$ and the maximum of them as $*max*(*b*_{1}, *b*_{2}, ..., *b*_{*n*})$. The Little Elephant considers a sequence $*b*$ good, if $*lcm*(*b*_{1}, *b*_{2}, ..., *b*_{*n*}) = *max*(*b*_{1}, *b*_{2}, ..., *b*_{*n*})$.

翻译中…

The Little Elephant has a sequence of integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$. Help him find the number of good sequences of integers $*b*_{1}, *b*_{2}, ..., *b*_{*n*}$, such that for all $*i*$ $(1 ≤ *i* ≤ *n*)$ the following condition fulfills: $1 ≤ *b*_{*i*} ≤ *a*_{*i*}$. As the answer can be rather large, print the remainder from dividing it by $1000000007$ $(10^{9} + 7)$.

翻译中…

Input

翻译中…

The first line contains a single positive integer $*n*$ $(1 ≤ *n* ≤ 10^{5})$ — the number of integers in the sequence $*a*$. The second line contains $*n*$ space-separated integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ $(1 ≤ *a*_{*i*} ≤ 10^{5})$ — sequence $*a*$.

翻译中…

Output

翻译中…

In the single line print a single integer — the answer to the problem modulo $1000000007$ $(10^{9} + 7)$.

翻译中…

样例

Input #1
4
1 4 3 2
Output #1
15
InputCopy OutputCopy
Input #2
2
6 3
Output #2
13
InputCopy OutputCopy
题目信息
题号
259E
时间限制
4 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。