#include <stdio.h>
long long gcd (long long x, long long y)
{
if ( y == 0 )
return x;
else
return gcd (y, x % y);
}
int main ()
{
int dataSet;
scanf ("%d", &dataSet);
while ( dataSet-- ) {
int m;
scanf ("%d", &m);
long long input, previous = 1;
for ( int i = 0; i < m; i++ ) {
scanf ("%lld", &input);
previous = (input * previous) / gcd (input, previous);
}
printf ("%lld\n", previous);
}
return 0;
}
Published by Shahab
Completed B.Sc in CSE, @United International University, Dhaka.
Currently working as Development Engineer, Android and iOS Application.
View all posts by Shahab