Janmansh and Games Solution || Codechef March Cook-Off 2022

        

Janmansh and Games Solution 

Codechef March Cook-Off 2022
Problem Code : JGAMES

Solution :

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

void solve()
{
    ll x, y;
    cin >> x >> y;
    if (x % 2 == 1)
    {
        if (y % 2 == 1)
        {
            cout << "Janmansh\n";
        }
        else
        {
            cout << "Jay\n";
        }
    }
    else
    {
        if (y % 2 == 1)
        {
            cout << "Jay\n";
        }
        else
        {
            cout << "Janmansh\n";
        }
    }
}

int main()
{
    ll t;
    cin >> t;
    while (t--)
    {
        solve();
    }
}

Comments