Path Intersection Extended

Do you remember the problem from ICPC Dhaka Regional 2018 named PathPathPath IntersectionIntersectionIntersection by Md. Imran Bin Azad? This is an extended version of that problem.


This is a companion discussion topic for the original entry at https://toph.co/p/path-intersection-extended