// https://www.hackerrank.com/contests/101hack44/challenges/alice-and-bobs-silly-game /* author: github.com/bokonist */ #include "bits/stdc++.h" using namespace std; /* useful utility macros */ #define MIN(a,b,res) ((a)>(b))? (res)=(b):(res)=(a) #define MAX(a,b,res) ((a)<(b))? (res)=(b):(res)=(a) #define printArray(a,l,n) for(int(i)=(l);(i)> //input from stdin #define err cerr<< //output to stderr #define nl cout<<"\n"; //newline #define limit 100001 void removeMultiples(vector &isPrime, int n) { int k=3,temp=n*2; while(temp isPrime(limit,true); isPrime[0]= isPrime[1]=false; removeMultiples(isPrime,2); for (ll i = 3; i <= limit; i+=2) { if (isPrime[i]) { removeMultiples(isPrime,i); } } int g; ip g; while(g--) { int n; ip n; int count=0; for (int i = 0; i <= n; ++i) { if(isPrime[i]) { /* op i;nl*/ count++; } } if(count%2!=0) op "Alice\n"; else op "Bob\n"; } return 0; }