Segmentation fault in the code

Please tell me why there is a segmentation fault error in my code.

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007

vector<vector> multiply(vector<vector> A,vector<vector> B)
{
vector<vector> C(2,vector(2));

for(int i=0;i<2;i++)
{
    for(int j=0;j<2;j++)
    {
        for(int x=0;x<2;x++)
        {
            C[i][j] = (C[i][j] + (A[i][x]*B[x][j])%mod)%mod;
        }
    }
}

return C;

}

vector<vector> pow(vector<vector> A,ll p)
{
if(p==1)
{
return A;
}
if(p&1)
{
return multiply(A,pow(A,p-1));
}
vector<vector> x = pow(A,p/2);
return multiply(x,x);
}

ll compute(ll n)
{

vector<vector<ll>> T = {{1,1},{1,0}};

T = pow(T,n-1);

ll res=0;
res = (T[0][0])%mod;

return res;

}

int main()
{
ll t;
cin>>t;

while(t--)
{
	ll n,m;
    cin>>n>>m;

    ll fm = compute(m+2);
    ll fn = compute(n+1);

    cout<< ( ( fm - fn ) + mod ) % mod <<endl;

}

return 0 ;

}

Hi @vritant2405
pls save ur code on ide and send link…

Hi @Vaibhav277 here it is below.

Hi @vritant2405
u can refer my code https://ide.codingblocks.com/s/639828

Hi @Vaibhav277
understood. Thank you very much.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.