calculating number of queries
int q = sizeof ( queries ) / sizeof ( queries [ 0 ] ) ; for ( int i = 0 ; i < q ; i ++ ) { int start = queries [ i ] [ 0 ] ; int end = queries [ i ] [ 1 ] ; cout << " Answer ▁ for ▁ Query ▁ " << ( i + 1 ) << " ▁ = ▁ " << solveQuery ( start , end , A ) << endl ; } return 0 ; }