A search engine wants to rank websites so that, among matching results, websites with higher trust scores appear first.
Initially every website has score 1. If website A has a link to website B, then A's score is added to B's score only when B cannot reach A by following links directly or indirectly. If B can reach A, that link is ignored for scoring, because otherwise cycles could increase scores without bound.
Given the link information and the name of one website, compute that website's score.