Help me in solving LBCV202A problem

My issue

logic to find no.of hens and ducks?

My code

// Step 1: Read and understand the problem statement and sample test cases

// Click on 'Next' once you are ready to proceed.

int main()
{
    int t;
    cin>>t;
    
    while(t--)
    {
        int X,Y,Z;
        cin>>X>>Y>>Z;
        
        if()
        
    }
}

Learning course: C++ for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone

@abhinavram786
The logic is if Z%X ==0 and Z%Y==0 then print any.
else if Z%X==0 print chicken.
else if Z%Y==0 print ducks.
else
print none.