Plz help why am I getting RE(SIGFPE) in BINXOR

#include
#include
using namespace std;
long fact(int n)
{
if(n==0)
return 1;
else
return nfact(n-1);
}
int main()
{
int t;long n;string a,b;
cin>>t;
while(t–)
{
cin>>n;
cin>>a>>b;long x=0,y=0,min_one,max_one,count=0;
for(int i=0;i<n;i++)
{
if(a[i]==‘1’)
x++;
if(b[i]==‘1’)
y++;
}
min_one=abs(x-y);
max_one=abs((x+y)-2
abs((x+y)-n));
// cout<<min_one<<" "<<max_one<<endl;
for(int i=min_one;i<=max_one;i+=2)
{
count+=fact(n)/(fact(i)*fact(n-i));
}
long long t=1000000007;
cout<<count%t<<endl;
}}

Same problem happened with me. In the end had to do it with python

Probably caused by an integer overflow or division caused by zero.