A Function to answer the Queries
void queryResults ( string str , Query q [ ] , int m , int n , unsigned long long int prefix [ ] , unsigned long long int suffix [ ] , unsigned long long int power [ ] ) { for ( int i = 0 ; i <= m - 1 ; i ++ ) { int L = q [ i ] . L ; int R = q [ i ] . R ;