array [ ] [ 0 ] start time array [ ] [ 1 ] advertising value
var array = [ [ 0 , 10 ] , [ 4 , 110 ] , [ 5 , 30 ] ] ; var N = 3 ; var K = 4 ; var M = 6 ; document . write ( max_value ( array , M , K , N ) ) ;