Chess Format: CHSFORMT

                     

link: https://www.codechef.com/CU1PP0006/problems/CHSFORMT

Read problem statements in Russian and Mandarin Chinese.

Given the time control of a chess match as a+ba+b, determine which format of chess out of the given 44 it belongs to.

1)1) Bullet if a+b<3a+b<3

2)2) Blitz if 3≤a+b≤103≤a+b≤10

3)3) Rapid if 11≤a+b≤6011≤a+b≤60

4)4) Classical if 60<a+b60<a+b

Solution:

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int t;
    cin>>t;
    while(t--)
    {
        int a,b;
        cin>>a>>b;
        if(a+b<3)
        cout<<"1\n";
        else if(a+b<=10)
        cout<<"2\n";
        else if(a+b<=60)
        cout<<"3\n";
        else
        cout<<"4\n";
    }
    return 0;
}