Help me in solving DICEGAME2 problem

My issue

Logic

My code

#include <iostream>
using namespace std;

int main() {
    int t;
    cin>>t;
    while(t--)
    {
        int a1,a2,a3,b1,b2,b3,a,b;
        cin>>a1>>a2>>a3>>b1>>b2>>b3;
        a=a1+a3-a2;
        b=b1+b3-b2;
        if(a>b)
        {
            cout<<"Alice"<<endl;
        }
        else if(a<b)
        {
            cout<<"Bob"<<endl;
        }else
        {
            cout<<"Tie"<<endl;
        }
    }
	// your code goes here
	return 0;
}

Problem Link: DICEGAME2 Problem - CodeChef

@dhanushkumar55
The logic is u have to take highest two of a1,a2,a2 and sum them and then compare it with the highest two of b1,b2,b3.