Help me in solving BGME problem

My issue

help me to solve the problem

My code

#include <bits/stdc++.h>
using namespace std;
#define int long long int 
const int MOD = 1000000000 + 7;
  bool isPrime(int n)
    {
        if (n <= 1)
            return false;
        if (n <= 3)
            return true;
        if (n % 2 == 0 || n % 3 == 0)
            return false;
        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;
        return true;
    }
int power(int x, int n)
{
    int result = 1;
    while (n) {
        if (n%2!=0){
            result = result * x % MOD;}
        n = n / 2;
        x = x * x % MOD;
    }
    return result;
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
  int t;
  cin>>t;
  while(t--){
      int n;
      cin>>n;
      int a[n],sum=0;
      for(int i=0;i<n;i++){
          cin>>a[i];
      }
    for(int i=0;i<n;i++){
        sum+=a[i];
    }
    if(sum%n==0){
       cout<<"Bob"<<endl;
    }
    else{
        int rem=sum%n;
        if(rem%2==0){
            cout<<"Bob"<<endl;
        }
        else{
              cout<<"Alice"<<endl;
        }
      
    }
}
return 0;
}

Problem Link: Bucket Game Practice Coding Problem - CodeChef

@sahilurepal
U have to think about the case when u will get Draw as the answer
plzz refer my c++ code

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

int main() {
	// your code goes here
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int a[n];
        int cnt=0,cnt1=0;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
            if(a[i]%2!=0)
            {
                if(a[i]==1)
                cnt1++;
                else
                cnt++;
            }
        }
        if(cnt1%2==0)
        {
            if(cnt%2!=0)
            {
                cout<<"Alice";
            }
            else if(n==cnt1)
            cout<<"Draw";
            else
            cout<<"Bob";
        }
        else
        {
            if(cnt==1&&cnt+cnt1==n)
            cout<<"Draw";
            else if(cnt%2!=0)
            cout<<"Bob";
            else
            cout<<"Alice";
        }
        cout<<endl;
    }
}