Hey i am not getting the test case where my code is going wrong .

```
#define loop(i,n) for(int i=0;i<n;i++)
using namespace std;
int getlcm(int* ar,int n){
int lcm = ar[0];
for(int i=1 ;i<n;i++){
lcm = (ar[i]*lcm)/__gcd(lcm,ar[i]);
}
return lcm;
}
int getmaxlcm(int lcm,int m,int* ar,int n){
//int val= *min_element(ar,ar+n);
int val=1;
for(int i=1;i<=m;i++){
int ans = (i*lcm)/__gcd(i,lcm);
if(ans > lcm){
val = i;
}
}
return val;
}
int main(void){
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
int* ar = new int[n];
loop(i,n){
cin>>ar[i];
}
int lcm = getlcm(ar,n);
int maxlcm = getmaxlcm(lcm , m,ar,n);
cout<<maxlcm<<endl;
}
return 0;
}
```