Example 1

Example 2

3 <= n <= 1050 <= edges.length <= 105edges[i].length == 30 <= fromi, toi, src1, src2, dest <= n - 1fromi != toisrc1, src2, and dest are pairwise distinct.1 <= weight[i] <= 105Example 1

Example 2

3 <= n <= 1050 <= edges.length <= 105edges[i].length == 30 <= fromi, toi, src1, src2, dest <= n - 1fromi != toisrc1, src2, and dest are pairwise distinct.1 <= weight[i] <= 105