Portal
Time limit:2000/1000 MS (java/others) Memory limit:65536/65536 K (java/others) total submission (s): 1312 Accepted Submission (s): 656
problem DescriptionZlgg found a magic theory that the bigger banana the bigger banana peel. This important theory can and him make a portal with our universal. Unfortunately, making a pair of portals would cost min{t} energies. T in a path between point V and point U are the length of the longest edge in the path. There may lots of paths between, points. Now ZLGG owned L energies and he want to know how many kind of the path he could make. InputThere is multiple test cases. The first line of input contains three integer N, M and Q (1 < n≤10,000, 0 < m≤50,000, 0 < q≤10,000). N is the number of points, M is the number of edges and Q are the number of queries. Each of the next M lines contains three integers a, B, and C (1≤a, b≤n, 0≤c≤10^8) describing an edge connecting th E Point A and B with cost C. Each of the following Q lines contain a single integer L (0≤l≤10^8). OutputOutput The answer to all query on a separate line. Sample Input Ten Ten7 2 16 8 34 5 85 8 22 8 96 4 52 1 58 57 3 77 8 8Ten615918276 Sample Output $ -1 - $1 $2 - -
HDU 3938 Portal