report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
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 ```
Basic number theory
Prime number 2
Sieve of Eratosthenes
Segmented sieve
Prime factors
Maximum GCD
Divisors counting
Largest common divisor
Nearest Element
Divisors counting 2
GCD and LCM
GGCD
Square root sum
Square number
Sum sum sum
Topic
Math
Rating 1100
Solution (1) Solution