Consider a chain say P1-->**P2**-->**P3**-->**P4**--> ... --> Pn, initially it is like this, directed. Here it is like if the information starts at P1 it flows till Pn, similarly, if information starts at P2 it flows till Pn.
We have two queries
Query 1: Say we query for P2 then we have to say where the information ends? Query 2: We may break a link say P2-->P3
Now the chain may look like P1-->**P2** and P3-->**P4**-->...-->**Pn** now the query 1 for P1 is P2 and query for P2 is also P2?
I have seen this question in one contest on some website and it is removed now?
How to solve this efficiently?