li
Today, li
As a lazy boy, li
Tell li
Each test contains multiple test cases. The first line contains the number of test cases T(1≤T≤12). Desc
The first line contains two integers n,m(2≤n≤105,1≤m≤3×105), which are the number of nodes and the number of edges.
Each of the next mm lines contains four integers ui,vi,ei,pi(1≤ui,vi≤n,0≤ei,pi≤109), describing an edge.
For each test case, output min_emine and max_pmaxp in a single line, separated by one space.
It is guaranteed that THE ANSWER EXISTS and CAN BE REPRESENTED AS A NUMBER.
2
3 3
1 2 1 1
2 3 1 1
1 3 2 0
3 3
1 2 1 1
2 3 1 1
1 3 1 0
2 2
1 0