Help me in solving AOCC17 problem

My issue

also provide the solution of this code

My code

// Update the code below to solve the problem

#include <bits/stdc++.h>
using namespace std;

int main() 
{
	int t;
    cin >> t;
	
	while(t--)
	{
	    int N;
	    cin >> N;
	    int A[N], B[N],sum=0;
	    for(int i=0; i < N; i++)
	    {
	        cin >> A[i];
	    }
	    for(int i=0; i < N; i++)
	    {
	        cin >> B[i];
	    }
	    for(int i=0;i<N;i++){
	       A[i]=sum+A[i];
	    }
	    for(int i=0;i<N;i++){
	        B[i]=sum+B[i];
	    }
	    for(int i=0;i<N;i++){
	        if(A[i]>B[i]){
	            cout<<"Alice"<<endl;
	        }
	        else if(B[i]>A[i]){
	            cout<<"Bob"<<endl;
	        }
	        else{
	            cout<<"Draw"<<endl;
	        }
	    }
	    
	}
}

Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone

@rs83050583
This is the correct code for this problem.
Hope u will get the logic.

// Update the code below to solve the problem

#include <bits/stdc++.h>
using namespace std;

int main() 
{
	int t;
    cin >> t;
	
	while(t--)
	{
	    int N;
	    cin >> N;
	    int A[N], B[N];
	    int mxa=0,mxb=0;
	    int sma=0,smb=0;
	    for(int i=0; i < N; i++)
	    {
	        cin >> A[i];
	        sma+=A[i];
	        mxa=max(mxa,A[i]);
	    }
	    for(int i=0; i < N; i++)
	    {
	        cin >> B[i];
	        smb+=B[i];
	        mxb=max(mxb,B[i]);
	    }
	    sma-=mxa;
	    smb-=mxb;
	    if(sma<smb)
	    cout<<"Alice";
	    else if(smb<sma)
	    cout<<"Bob";
	    else
	    cout<<"Draw";
	    cout<<endl;
	}
}

// Update the code below to solve the problem

include <bits/stdc++.h>
using namespace std;

int main()
{
int t;
cin >> t;

while(t--)
{
    int N;
    cin >> N;
    int A[N], B[N];
    for(int i=0; i < N; i++)
    {
        cin >> A[i];
    }
    for(int i=0; i < N; i++)
    {
        cin >> B[i];
    }
    //  Finding neglecting case of Alice
    int max_A = 0;         
    for(int i=0; i<N; i++){
        if(A[i] > max_A)
            max_A = A[i];
    }
    // Finding neglecting case of Bob
    int max_B = 0;
    for(int i=0; i<N; i++){
        if(B[i] > max_B)
            max_B = B[i];
    }
    
    int sum_A = 0;
    for(int i=0; i<N; i++){
        sum_A += A[i];
    }
    // Subtracting the max time from complete time 
    int net_A = sum_A - max_A;
    
    int sum_B = 0;
    for(int i=0; i<N; i++){
        sum_B += B[i];
    }
   // Subtracting the max time from complete time
    int net_B = sum_B - max_B;
    
    if (net_A>net_B)
        cout<<"Bob"<<endl;
    else if(net_B>net_A)
        cout<<"Alice"<<endl;
    else
        cout<<"Draw"<<endl;
}

}