You are living in a country which has well-developed transportation. There are $n$ cities numbered from $1$ to $n$ and $m$ public transport routes numbered from $1$ to $m$ in the country. The route numbered $i$ is a directed route from city $u_i$ to city $v_i$, with a cost $a_i$ and a preferential factor $b_i$.
To facilitate people's travel, the government has formulated a series of preferential measures. For a trip that starts from city $s$, passes through routes numbered $e_1, e_2, \dots, e_k$ and ends in city $t$, the cost of each route is calculated as follows:
- For route $e_1$, the cost is $a_{e_1}$.
- For route $e_i \ (i > 1)$, if $a_{e_i} > a_{e_{i - 1}}$, the cost is $a_{e_i} - b_{e_i}$, otherwise the cost is $a_{e_i}$.
The total cost of the trip is the sum of the costs of these routes.
You are now living in city $1$. You want to find the minimum cost of traveling from city $1$ to city $k$, for each $k \in [1, n]$ respectively.