Driver Code
public static void main ( String [ ] args ) { int a [ ] = { 1 , 2 , 3 , 5 } ; int n = a . length ; int l = 1 , r = 4 ; System . out . println ( answerQuery ( a , n , l , r ) ) ; l = 2 ; r = 4 ; System . out . println ( answerQuery ( a , n , l , r ) ) ; } }