N cities are connected by a network of M one-way roads. It is known that these roads do not cross outside the cities. The numeration of the cities and the roads starts from 1.
One day, Haryy Potter must make a dangerous trip from city 1 to city N. Because there may have many monsters along the roads, he wants to finish this trip as soon as possible. Luckily, he knows a specil magic which can change the length of a road to half of the original length. But his magic is limited, and he can only use this magic once.
Now give you the network, try to find the minumum time he can finish this dangerous trip.
Input
The first line contains an integer T,which means there are T test cases to be followed.
For each test case: the first line contains two integer n and m, which are the number of vertices and edges int the network.
Following the next m lines: each line describes an edge with three integers in the format: i, j, C_{ij}.（c_{ij} is the time Haryy Potter must pay for from the city i to j if he don’t use magic）
(0 < n <= 10^{4}, 0 < m < 10^{5}, 0 < i, j <= n, 0 < c_{ij} < 10^{5})
Output
For each test case, output the minimum time he must pay for this dangerous trip.