| acmsguru |
|---|
| Finished |
;
), where N is a number of the cities in the country and m is a number of the roads. The following M lines contain the description of the roads, one per line. Each road description is given as the four integer numbers aj, bj, lj, tj, where aj, bj are numbers of the cities connected by the road (1 ≤ aj,bj ≤ n; aj <> bj), lj — length of the road (1 ≤ lj ≤ 105), tj is equal to 1 if the road belongs to the shortest paths tree T and to 0 otherwise. sample input | sample output |
5 9 3 1 3 1 1 4 2 1 2 1 6 0 2 3 4 0 5 2 3 0 3 2 2 1 5 3 1 1 3 5 2 0 4 5 4 0 | 6 7 8 5 |
| Name |
|---|


