Function to answer every query in O ( 1 )
static void answerQuery ( int l , int r , bool [ , ] dp ) { if ( dp [ l , r ] ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } }