Question- https://www.spoj.com/problems/LCA/
I did this problem using naive approach and got accpeted.
But i was wondering if the constraints were more complex then i could have got TLE.
I found that this question can be done using techniques such as Segment trees,RMQ etc.
But i was not able to find out how could i do it with segment trees.
Some hint would be appreciated. 