Driver Code
public static void main ( String [ ] args ) { int arr [ ] = { 2 , 3 , 6 , 7 , 4 , 5 , 30 } ; int queries [ ] = { 6 , 5 } ; int N = arr . length ; int M = queries . length ; calculateQuery ( arr , N , queries , M ) ; } }