The 2023 ICPC Asia Regionals Online Contest (2) --E Another Bus Route Problem(BFS)
Pik'svillagecomprisesofnresidentialbuildings(labeledfrom1ton)connectedbyn−1bidirectionalroads.Thevillageformsatreestructure,whereeachbuildingisinterpretedasatreevertex,andeachroadisinterpretedasatreee