code is giving the wrong ans why

#include<bits/stdc++.h>
using namespace std;
bool isprime(int no){
if(no<=1)
return false;
for(int i=2;i<no;i++)
{if(no%i==0)
return false;
}
return true;
}

int main(){
int t,n,i,a[110],mul;
cin>>t;
while(t–){
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];
// sort(a,a+n);
mul=a[0]*a[1];
for(i=0;i<n;i++)
{
for(int j=i+1;j<n;j++){
if(mul>a[i]*a[j])
mul=a[i]*a[j];
}
}

 if(isprime(mul))
        cout<<mul<<endl;
    else
        cout<<"-1"<<endl;

}

return 0;
}

Question link. And also provide your approach. What you are doing.