The Treasure of The Segments

Problem Name:
The Treasure of The Segments
Site:CodeForces
Links:
Tags:
Problem setters: