CF838B Diverging Directions

Description

You are given a directed weighted graph with $ n $ nodes and $ 2n-2 $ edges. The nodes are labeled from $ 1 $ to $ n $ , while the edges are labeled from $ 1 $ to $ 2n-2 $ . The graph's edges can be split into two parts. - The first $ n-1 $ edges will form a rooted spanning tree, with node $ 1 $ as the root. All these edges will point away from the root. - The last $ n-1 $ edges will be from node $ i $ to node $ 1 $ , for all $ 2

Input Format

N/A

Output Format

N/A