#include <stdio.h>

int gcd(int a,int b)

{

```
if(b!= 0 )
return gcd(b,a%b);
else return a;
```

}

int main(void) {

int t;

int n,m;

char c;

scanf("%d",&t);

c = getchar();

for(int i = 0; i<t ; i++)

{

int ans = 1;

scanf("%d",&n);

c = getchar();

scanf("%d",&m);

c = getchar();

int arr[n];

for(int i = 0 ; i<n ; i++)

{

scanf("%d",&arr[i]);

c = getchar();

ans = ((arr[i]*ans)/(gcd(arr[i],ans)));

}

```
int max = ans;
int ans2 = ans;
int i = 1;
for(int j = 2 ; j<=m ; j++)
{
ans2 = (j*ans2)/gcd(j,ans2);
if(ans2>max)
{
i = j;
max = ans2;
}
ans2 = ans;
}
printf("%d\n",i);
}
return 0;
```

}

I donâ€™t understand which cases this answer is failing for?