Blackjack Solution || Codechef Starters - 27

       

Blackjack Solution 

Codechef Starters - 27
Problem Code : BLACKJACK

Solution :

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

void solve()
{
    ll a, b;
    cin >> a >> b;
    if ((a + b) >= 11)
    {
        cout << 21 - a - b << "\n";
    }
    else
    {
        cout << -1 << "\n";
    }
}

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

Comments