You have rooms and tunnels with score values. You start at room and want to reach room with maximum total score. Some tunnels have negative scores. If you can loop through rooms infinitely to increase score, output . Otherwise, output the maximum score you can achieve on any path from room to room .
This is a shortest path problem disguised as a maximum path problem. The twist is that you are maximizing score instead of minimizing cost, and you need to detect if infinite score is possible.