Sample testcases of Marble program pases but testcases give an run error

int t,temp1=1,temp2=1,h=0,g=0;
cin>>t;
unsigned long long ans = 0;
int* a = new int[t];
int* k = new int[t];
int* n = new int[t];

for(int j=0;j<t;j++)
{
    cin>>n[j];
	cin>>k[j];
}

for(int i=0;i<t;i++)
{
	
    if(k[i]==n[i])
        ans = 1;
    else
    {
        h = n[i]-1;
        g = k[i]-1;
        for(int j=0;j<k[i]-1;j++)
        {
            temp1 *= h;
            temp2 *= g;
            h--;
            g--;
        }

        ans = temp1/temp2;
    }

    a[i] = ans;
}

for(int i=0;i<t;i++)
    cout<<a[i]<<endl;

Please help I can’t figure out where I am going wrong.

Please run your code on https://ide.codingblocks.com/ and share the link

I have pasted the code in the ide. Please help me to figure out where I am going wrong.

Please share the link then so that I can take a look at it.

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.