Driven Program
int main ( ) { int q = 3 ; int L [ ] = { 2 , 2 , 24 } ; int R [ ] = { 5 , 2 , 28 } ; precompute ( prefix , suffix ) ; for ( int i = 0 ; i < q ; i ++ ) cout << query ( prefix , suffix , L [ i ] , R [ i ] ) << endl ; return 0 ; }