This is my solution to the problem:
#include
using namespace std;
void Shop(int Aayush, int Harshit)
{
int oddcount=1, i=1;
int evencount=2, j=1;
while (oddcount<=Aayush)
{
oddcount+=2;
i++;
}
while (evencount<=Harshit)
{
evencount+=2;
j++;
}
if (i>j)
{
cout<<"Aayush"<<endl;
}
else
{
cout<<"Harshit"<<endl;
}
}
int main()
{
int T;
cin>>T;
int Aayush;
int Harshit;
while (T--)
{
cin>>Aayush>>Harshit;
Shop(Aayush,Harshit);
}
return 0;
}
But it always fails 4th testcase. Why?