
Baltazar decided to go on a vacation. Currently, he is in Baltazargrad, and wants
to travel to Primošten. To get there, he has to go through many cities. There are
Baltazar isn't sure about the route from Baltazargrad to Primošten, so he will use GPS. It will lead him to his destination using the shortest route.
But Baltazar really likes to travel, and he can pour his magic potion on any road
(even the ones he won't pass by), and increase its length by
Soon he realized that he had to check-in in at the hotel Zora in Primošten before noon, so he couldn't increase
the length of the shortest route too much. Now, he wants to know how many roads he can pour his magic
potion on so that the shortest distance between Baltazargrad and Primošten increases by exactly
Help him determine the roads he can pour his magic potion on.
Input Specification
Each test contains multiple test cases. The first line contains the number of test cases
The first line of each test case contains integers
The following
All the cities are connected, i.e., for each pair of cities, there is a path from one to another, but not necessary direct.
It is guaranteed that the sum of
Output Specification
In the first line, print the integer
Constraints
Subtask | Points | Constraints |
---|---|---|
There is a road between Baltazargrad and Primošten, and its length is |
||
No additional constraints. |
Sample Input
3
6 6
1 2 2
1 3 2
2 4 2
3 5 2
4 5 1
5 6 2
6 6
1 2 2
1 3 2
2 4 2
3 5 2
4 5 3
5 6 2
6 7
1 2 2
1 3 2
2 4 2
3 5 2
4 5 1
5 6 2
1 6 7
Sample Output
2
2 4
0
3
2 4 6
Explanation for Sample
The cities and the roads are shown in the image. If Baltazar pours his magic potion on road
Comments