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