1 #include<iostream> 2 using namespace std; 3 4 long long gcd(long long a, long long b) { 5 int c = a%b; 6 if (!c) 7 return b; 8 a = b, b = c; 9 gcd(a, b); 10 } 11 int main() { 12 int n; 13 while ((cin>>n)&&n) 14 { 15 long long num[1000]; 16 for (int i = 0;i < n;i++) 17 cin >> num[i]; 18 for (int i = 0;i < n - 1;i++) 19 num[i + 1] = num[i]*num[i+1]/gcd(num[i], num[i + 1]); 20 cout << num[n - 1] << endl; 21 }23 return 0; 24 }