The input consists of several test cases. The first line of the input contains a single integer $T$ $(1 \leq T \leq 3000)$, denoting the number of test cases.
For each test case, the first line contains two integers $n$ $(1 \leq n \leq 10^5)$ and $m$ $(1 \leq m \leq 2 \times 10^5)$, denoting the number of vertices and the number of edges in the graph.
Each of the next $m$ lines contains three integers $u_i,v_i,w_i\ (1 \leq u_i, v_i \leq n, 1 \leq w_i \leq 10^9)$, denoting the source, the target and the weight of the $i$-th edge. Please note that the edges are directed.
Let $S_n$ and $S_m$ be the sum of $n$ and the sum of $m$ in the input respectively. It is guaranteed that $1 \leq S_n \leq 5 \times 10^5$ and $1 \leq S_m \leq 10^6$.