Question Link: TWONMS Problem - CodeChef
although I am getting all the testcases passed on my local compiler but on submission I am getting partially correct answer. Can you guyz help me regarding this?
S.N. I am a beginner.
My Code:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
int A,B,N;
cin>>A>>B>>N;
int result = 0;
for(int i =0;i<N;i++)
{
if(i%2==0)
{
A *= 2;
}
else
{
B *=2;
}
result = max(A,B)/min(A,B);
}
cout << result<< endl;
}
return 0;
}