BETA

Difficulty Level: Basic

Submissions: 1317 Accuracy:

32.19%

LCM of given array elements
     

Given an array A[ ] of N numbers, your task is to find LCM of it.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow . The first line of each test case contains an integer N denoting the number of array elements. The next line contains N space separated values of  array A[ ] .

Output:
For each test case in a new line print the lcm of the elements of the array .

Constraints:
1<=T<=100
1<=N<=20
1<=A[ ] <=20

Example:
Input

1
4
1 2 8 3

Output
24

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.