LCM of given array elements
Submissions: 1461   Accuracy:

33.92%

  Difficulty: Basic   Marks: 1

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 **

Author: Shubham Joshi 1


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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


to report an issue on this page.