Sakshi And Art Problem

Sir, How to approach this problem, I have no idea how to store the coordinates so that i can develop an efficient algorithm. Please make me clear algorithm behind this problem. I think it is related to MST.
Problem Link–https://hack.codingblocks.com/contests/c/784/557

this is an euler path Q . if you are not familiar with what is euler path i will advise you to read it first. Considering about approach what you can do is that you can assume a point to be a node .you can use a pair of map to store coordinate point. assign every point a different key using map and make a graph with that. After that you can further think how to approach after reading euler path algo.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.