Function to perform the Sieve Of Eratosthenes to find the prime number over the range [ 1 , 10 ^ 5 ]
void SieveOfEratosthenes ( vector < pair < ll , ll > > & v ) { bool prime [ MAX + 1 ] ; memset ( prime , true , sizeof ( prime ) ) ; prime [ 1 ] = false ; for ( int p = 2 ; p * p <= MAX ; p ++ ) {