logic for matchstick with normal DStructure
segment max tree.....1 st implementation
solved small input for codejam.
solved matchstick for codechef.

proper implementation of segment max and min tree.