Help me in solving TWONMS problemwhy my subtask 2 is failed

My issue

My code

#include <iostream>
using namespace std;
#define in long long

int main() {
	// your code goes hereint t;
	int t;
	cin>>t;
	while(t--)
	{
	   long int a,b,n,i;
	    cin>>a>>b>>n;
	    for(i=1;i<=n;i=i+2)
	    {
	        a=2*a;
	        b=2*b;
	    }
	    if(n%2!=0)
	    {
	        b=b/2;
	    }
	  //  cout<<a<<b<<endl;
	    if(a>b)
	    {
	        cout<<a/b<<endl;
	    }
	    else
	    {
	        cout<<b/a<<endl;
	    }
	    
	}
	return 0;
}

Problem Link: TWONMS Problem - CodeChef

@kjha1893
u can’t store the a and b after multiplication in any datatype.
that is why u r getting integer overflow error to overcome this just think if n%2==0 then equal number of 2’s will get in multiplication of a and b and if n%2==1 then one extra 2 will get in a.
so either all two will cancel or either one 2 will get in multiplication.
so to don’t need to multiply each 2 . This will prevent your integer overflow