
There is a country of n cities numbered from 0 to n - 1 where all the cities are connected by bi-directional roads. The roads are represented as a 2D integer array edges where edges[i] = [x _i , y _i , time _i ] denotes a road between cities x _i and y _i that takes time _i minutes to travel. There may be multiple roads of differing travel times connecting the same two cities, but no road connects a city to itself.
Each time you pass through a city, you must pay a passing fee. This is represented as a 0-indexed integer array passingFees of length n where passingFees[j] is the amount of dollars you must pay when you pass through city j .
In the beginning, you are at city 0 and want to reach city n - 1 in maxTime minutes or less . The cost of your journey is the summation of passing fees for each city that you passed through at some moment of your journey ( including the source and destination cities).
Given maxTime , edges , and passingFees , return the minimum cost to complete your journey, or -1 if you cannot complete it within maxTime minutes .
1 <= maxTime <= 1000n == passingFees.length2 <= n <= 1000n - 1 <= edges.length <= 10000 <= x _i , y _i <= n - 11 <= time _i <= 10001 <= passingFees[j] <= 1000The graph may contain multiple edges between two nodes.The graph does not contain self loops.