Baltazar

아직 제출이 없습니다시간 제한4초메모리 제한1024 MB

문제

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 nn citites, and they are connected with mm two-way roads. Baltazargrad is labeled as city no. 11, and Primošten as city no. nn.

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 22 kilometers. He can pour it on only one road.

Soon he realized that he has to check-in in the hotel Zora in Primošten before noon, so he can’t increase the length of the shortest route too much. Now, he wants to know how many roads can he pour his magic potion on, so that the shortest distance between Baltazargrad and Primošten increases by exactly 11 kilometer.

Help him determine the roads he can pour his magic potion on.

입력

Each test contains multiple test cases. The first line contains the number of test cases tt (1t10,0001 ≤ t ≤ 10\\,000). The description of the test cases follows.

The first line of each test case contains integers nn and mm (2n300,0002 ≤ n ≤ 300\\,000, 1mmin(300,000,n(n1)21 ≤ m ≤ \min(300\\,000, \frac{n·(n-1)}{2}), the number of cities, and the number of roads between cities.

The following mm lines contain integers a_ia\_i, b_ib\_i and w_iw\_i (1a_i,b_in1 ≤ a\_i , b\_i ≤ n, a_ib_ia\_i \ne b\_i, 1w_i1091 ≤ w\_i ≤ 10^9), meaning there is a road between cities a_ia\_i and b_ib\_i, and its length is w_iw\_i. Between each pair of cities, there is at most one road connecting them.

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 nn over all test cases does not exceed 300,000300\\,000, and that the sum of mm over all test cases does not exceed 300,000300\\,000.

출력

In the first line, print the integer cc, the number of roads on which Baltazar can pour his magic potion. In the second line, print cc integers, the indices of the roads in increasing order.

힌트

Clarification of the example: The cities and the roads are shown in the image. If Baltazar pours his magic potion on road 22 (between cities 11 and 33), or on road 44 (between cities 33 and 55), then the shortest distance between cities 11 and nn will increase by 11.