Company: Uber_23july
Difficulty: medium
Roads on Fastest Delivery Routes Uber operates a road network connecting n cities, numbered from 0 to n - 1 . The network is an undirected weighted graph : every road connects two cities and has an associated travel time. For planning premium deliveries, Uber wants to identify all roads that belong to at least one fastest route from the main distribution center (city 0 ) to the destination hub (city n - 1 ). A fastest route is any route whose total travel time is the minimum possible over all routes from city 0 to city n - 1 . Given the road network, determine for every road whether it appears on at least one fastest route from city 0 to city n - 1 . Input The first line contains two integers n and m — the number of cities and the number of roads. Each of the next m lines contains three integers u v w , describing a road between cities u and v with travel time w . Roads are undirected. Output Print m space-separated tokens on a single line. The i -th token (0-indexed, in the same order