Largest common divisor - MarisaOJ: Marisa Online Judge

Largest common divisor

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integers. Calculate: $$LCM(A_1, A_2,...,A_n) \mod 10^9+7$$ ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print the LCM of all elements in $A$ modulo $10^9+7$. ### Constraints - $1 \le n \le 10^5$. - $1 \le A_i \le 10^5$. ### Example Input: ``` 4 1 3 4 5 ``` Output: ``` 60 ```