• + 0 comments

    One-liner in Haskell (no focus on performance though):

    solve :: [Integer] -> [Integer] -> Integer
    solve ns ms = flip mod (10^9 + 7) 
                $ gcd (product ns) (product ms)