#C7740. Maximum Traffic Load
Maximum Traffic Load
Maximum Traffic Load
You are given a network consisting of n intersections and m roads. Each road is described by three integers ai, bi, and ti representing the starting intersection, the ending intersection, and the traffic load of that road respectively.
Your task is to determine the maximum traffic load on any single road.
The mathematical formulation is as follows:
\( \text{Answer} = \max_{1 \leq i \leq m} t_i \)
inputFormat
The first line of input contains two integers n
and m
separated by a space, where n
is the number of intersections and m
is the number of roads.
Each of the following m
lines contains three integers ai
, bi
, and ti
separated by spaces, describing a road from intersection ai
to intersection bi
with a traffic load of ti
.
outputFormat
Output a single integer denoting the maximum traffic load on any one road.
## sample4 4
1 2 30
2 3 40
3 4 20
4 1 50
50