#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
int get_lcm(int a, int b) {
int min = a < b ? a : b;
int n = 1;
for (int i = 2; i <= min; i++) {
if (a % i == 0 && b % i == 0)
n = i;
}
return n * (a / n) * (b / n);
}
int solution(int arr[], size_t arr_len) {
int lcm = 0;
if (arr_len == 1)
return arr[0];
lcm = get_lcm(arr[0], arr[1]);
for (int i = 2; i < arr_len; i++)
lcm = get_lcm(lcm, arr[i]);
return lcm;
}