AlgoLensArena
ContestlərProblemlərOtaqlar
Vizualizator
← Məsələlər

FPC20-032.Group Activities

Easy · 1 s · 256 MB

  • icpc
  • fpc
  • 2020

The lockdown is still in place, so organizing the yearly group excursion is a no-go. Instead, the study association is organizing the Fictional Programmer Convention (FPC): a digital event where programmers can meet other programmers while performing various digital activities. You are on the committee that is concerned with planning the events of the FPC. They give you the following task: determine how many programmers you want to invite.

The committee will plan different activities that will take place for all participants at the same time, with the participants 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 given in separate sessions of 31.

Because of a limited budget, you want to invite as few people as possible, but still at least one person of course. Can you determine the exact number of people you must invite to exactly fill each activity?

Giriş formatı

• One line containing one integer 1≤n≤1051 \leq n \leq 10^51≤n≤105, the number of activities organized.

• For each of the nnn activities, one line with an integer 1≤i≤10181 \leq i \leq 10^{18}1≤i≤1018: this activity requires exactly iii participants per group.

Çıxış formatı

An integer indicating the smallest number of people ppp you can invite, such that each activity can exactly fill a number of groups. It is guaranteed that 1≤p≤10181 \leq p \leq 10^{18}1≤p≤1018.

Qeyd

Source: Freshmen Programming Contest 2020 · License: CC BY-SA 4.0 · Original: https://fpc.wisv.ch · Statement adapted for AlgoLens and shared under the same license.

Nümunələr

Giriş #1

3
5
3
31

Çıxış #1

465

Giriş #2

4
15
8
7
11

Çıxış #2

9240