Under construction

Still being built. Things may change

Group Activities

Interview

Time limit1sMemory limit2048 MB

Summary
Given n integers up to 10^18, find their least common multiple, the smallest positive number that every given value divides evenly.
Level

Easy3 of 10

Topics
Math, Number theory
Solved
No attempts yet

Problem

The lockdown is still in place, so the yearly group excursion cannot be organized. Instead, the study association is organizing the Fictional Programmer Convention (FPC), a digital event where programmers meet other programmers while doing various digital activities. You are on the committee that plans the FPC events. The committee will run several activities at the same time for all participants, and the participants are divided into groups. Each activity requires an exact number of participants per group. For example, a variety of digital games are played in groups of 5, a pop quiz about programming history is played in teams of 3, and a workshop on clean coding practices is held in separate sessions of 31.

The budget is limited, so you want to invite as few people as possible, but at least one person. Determine the smallest number of people you must invite so that every activity can exactly fill its groups.

Input

The first line contains one integer nn (1≤n≤1051 \leq n \leq 10^5), the number of activities.

Each of the next nn lines contains one integer ii (1≤i≤10181 \leq i \leq 10^{18}). This activity requires exactly ii participants per group.

Output

Print the smallest number of people pp such that each activity can exactly fill a number of groups. It is guaranteed that 1≤p≤10181 \leq p \leq 10^{18}.

Examples2

  1. Example 1

    Input
    3
    5
    3
    31
    
    Expected output
    465
    
  2. Example 2

    Input
    4
    15
    8
    7
    11
    
    Expected output
    9240