Chef and Bird Farm Solution || Codechef Starters - 36

     

Chef and Bird Farm Solution 

Codechef Starters - 36
Problem Code : BIRDFARM

Solution :

#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    ll t = 1;
    cin >> t;
    while (t--)
    {
        ll x, y, z;
        cin >> x >> y >> z;
        if (z % x == 0 && z % y == 0)
        {
            cout << "ANY\n";
        }
        else if (z % x == 0)
        {
            cout << "CHICKEN\n";
        }
        else if (z % y == 0)
        {
            cout << "DUCK\n";
        }
        else
        {
            cout << "NONE\n";
        }
    }
}

Comments