Archery
Practice
3.3 (29 votes)
Approved
Easy
Math
Number theory
Problem
70% Success 11546 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

N archers are shooting arrows at targets. There are infinite targets numbered starting with 1. The \(i^{th}\) archer shoots at all targets that are multiples of \(k_i\).

Find the smallest target that is hit by all the archers.

Input

The first line contains an integer T - the total no. of testc ases.

T test cases follow. Each test case is of the following format:

The first line contains a natural number - N - the number of archers. The second line contains N space-separated integers, where the \(i^{th}\) integer denotes the value of \(k_i\) for the \(i^{th}\) archer.

Output

For each test case, print the smallest target that is hit by all archers on a new line.

Constraints

\(1 \le T \le 5\)

\(1 \le N \le 15\)

\(1 \le k_i \le 48\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
57 votes
Tags:
ApprovedCombinatoricsEasyException handlingMathNumber TheoryOpenProbabilityStatistics
Points:30
262 votes
Tags:
ApprovedEasyMathNumber TheoryReady
Points:30
53 votes
Tags:
EasyMath