Function to solve all the queries
static void solve ( int n , int q ) { int [ ] qu = { 5 , 3 , 6 } ; seg_tree = new int [ 4 * n + 1 ] ; Array . Fill ( seg_tree , 0 ) ; build_tree ( 1 , 0 , n - 1 ) ; for ( int i = 0 ; i < qu . Length ; i ++ ) { Console . WriteLine ( qu [ i ] ) ; } for ( int i = q ; i < q ; i ++ ) {