Chef and Gym Solution || Codechef May Cook-Off 2022

         

Chef and Gym Solution 

Codechef May Cook-Off 2022
Problem Code : CGYM

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 (x + y <= z)
        {
            cout << "2\n";
        }
        else if (x <= z)
        {
            cout << "1\n";
        }
        else
        {
            cout << "0\n";
        }
    }
}

Comments