Archery
Practice
3.3 (29 votes)
Approved
Easy
Math
Number theory
Problem
70% Success 11547 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\)
Submissions
Please login to view your submissions
Similar Problems
Points:30
262 votes
Tags:
ApprovedEasyMathNumber TheoryReady
2.A to B
Points:30
24 votes
Tags:
AlgorithmsApprovedEasyOpen
Points:30
52 votes
Tags:
Basic ProgrammingNumber theoryBasic Number Theory-1MathNumber Theory
Editorial