--[[ Task Alice and Bob invented the following silly game: The game starts with an integer, , that's used to build a of distinct integers in the inclusive range from to (i.e., ). Alice always plays first, and the two players move in alternating turns. During each move, the current player chooses a prime number, , from . The player then removes and all of its multiples from . The first player to be unable to make a move loses the game. Alice and Bob play games. Given the value of for each game, print the name of the game's winner on a new line. If Alice wins, print Alice; otherwise, print Bob. Note: Each player always plays optimally, meaning they will not make a move that causes them to lose the game if some better, winning move exists. Input Format The first line contains an integer, , denoting the number of games Alice and Bob play. Each line of the subsequent lines contains a single integer, , describing a game. Constraints g in [1, 1000] n in [1, 100000] Subtasks 50% for of the maximum score Output Format For each game, print the name of the winner on a new line. If Alice wins, print Alice; otherwise, print Bob. Sample Input 0 3 1 2 5 Sample Output 0 Bob Alice Alice ]] local max_n = 100000 local is_prime = {} local fill_primes = function() for i = 1, max_n do is_prime[i] = true end is_prime[1] = false local start = 2 while (start <= max_n) do local step = start local i = start + step while (i <= max_n) do is_prime[i] = false i = i + step end repeat start = start + 1 until is_prime[start] or (start > max_n) end end fill_primes() local num_primes = {} local fill_num_primes = function() local primes_so_far = 0 for i = 1, #is_prime do if is_prime[i] then primes_so_far = primes_so_far + 1 end num_primes[i] = primes_so_far -- print(i, num_primes[i]) end end fill_num_primes() local num_games = io.read('*n', '*l') for i = 1, num_games do local n = io.read('*n', '*l') if (num_primes[n] % 2 == 0) then io.write('Bob', '\n') else io.write('Alice', '\n') end end