Function to count number of sub - arrays whose sum is k ^ p where p >= 0
ll countSubarrays ( int * arr , int n , int k ) { ll prefix_sum [ MAX ] ; prefix_sum [ 0 ] = 0 ; partial_sum ( arr , arr + n , prefix_sum + 1 ) ; ll sum ; if ( k == 1 ) { sum = 0 ; map < ll , int > m ; for ( int i = n ; i >= 0 ; i -- ) {