I have written a code. but before taking input and giving output it is terminating. How can i fix this? I can not give input to the code. It says:
Process returned 4256912 (0x40F490) execution time : 0.069 s.
#include<bits/stdc++.h>
using namespace std;
int fact(int n) {
   if ((n==0)||(n==1)||(n<0))
      return 1;
   else
      return n*fact(n-1);
}  
int main()
{
   ios_base:: sync_with_stdio(false);
   cin.tie(NULL);
   int t;
   cin>>t;
   for(int i=0;i<t;i++)
   {
       int x1,y1,x2,y2,n,m,r,N,res;
       cin>>x1>>y1>>x2>>y2;
        n=y2-y1;
        m=x2-x1;
        N=n+m;
        r=n;
       res= fact(N)/(fact(r)*fact(N-r));
       cout<<res;
   }
}
 
     
    