SEGMENT REE-Max queies

i saw the hint video but still not sure how to implement and things will work…please help