Problem I am trying to solve this problem by finding the region to which x or y belong. I am maintaining a set of all the regions that are available. First, I find to which set x or y belong and delete that set. Two new sets are created. I am keeping the "cut distance" in a set container. But I am getting TLE on test case 11. I ma using only logarithmic data structures. My Code