barney live NYC NYC infinite number intersection number positive integer start 1 there exist bidirectional road intersection 2i road 2i1 positive integer you clearly exist unique short path intersection initially pass road free but slapsgive ahead q consecutive event happen soon there type events1 government make new rule a rule denote integer v u w as result action pass fee road short path u v increase w dollar 2 Barney start move intersection v go intersection u there s girl want cuddle fake Lorenzo Von Matterhorn he use short path visit minimum number intersection road intersectionsgovernment need calculation for time Barney go cuddle girl need tell government money pay sum passing fee road pass