Driver program Taking inputs
let n = 5 , q = 3 ; let A = [ 210 , 11 , 48 , 22 , 133 ] ; let L = [ 1 , 4 , 2 ] , R = [ 3 , 14 , 4 ] ; make_prefix ( A , n ) ; for ( let j = 0 ; j < q ; j ++ ) document . write ( Solve ( L [ j ] , R [ j ] ) + " " ) ;