Help me in solving ADD12GAME problem

My issue

int T;
cin >> T; // Number of test cases
while (T–) {
int N;
cin >> N;

    if (N % 3 == 0) {
        // If N is a multiple of 3, Bob wins
        cout << "BOB" << endl;
    } else {
        // If N is not a multiple of 3, Alice wins
        cout << "ALICE" << endl;
    }
}
return 0;what is wrong in the logic?

My code

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

int main() {
   

    int T;
    cin >> T;  // Number of test cases
    while (T--) {
        int N;
        cin >> N;
        
        if (N % 3 == 0) {
            // If N is a multiple of 3, Bob wins
            cout << "BOB" << endl;
        } else {
            // If N is not a multiple of 3, Alice wins
            cout << "ALICE" << endl;
        }
    }
    
    return 0;
    

}

Problem Link: Add 1 or 2 Game Practice Coding Problem

Consider the case: N=2. There is no possibility for Alice to win the game.
If Alice chooses 1, Bob will choose 1 and score will 2. Bob wins
If Alics chooses 2, game stops here. Bob wins again.

import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
	    while(t-->0){
	        int n=sc.nextInt();
	        
	        if(n==1){
	            System.out.println("ALICE");
	        }
	        else{
	            System.out.println("BOB");
	        }
	        
	    }
	}
}

``//Only at n==1 Alice wins, rest all will be won by Bob

:+1:

logic behind this