You are given a connected, undirected, simple cactus graph. A cactus graph is a connected graph in which every edge belongs to at most one simple cycle. Equivalently, any two simple cycles have at most one common vertex.
Each edge has an integer weight, and weights may be negative.
Then you have to answer $$$q$$$ queries. In each query, two vertices $$$u$$$ and $$$v$$$ are given, and you must find the minimum possible total weight of a simple path from $$$u$$$ to $$$v$$$.
The first line contains three integers $$$n$$$, $$$m$$$, and $$$q$$$ ($$$2 \le n \le 200'000$$$, $$$n - 1 \le m \le 300'000$$$, $$$1 \le q \le 200'000$$$).
Each of the next $$$m$$$ lines contains three integers $$$u_i$$$, $$$v_i$$$, and $$$w_i$$$ ($$$1 \le u_i, v_i \le n$$$, $$$u_i \ne v_i$$$, $$$-10^9 \le w_i \le 10^9$$$), meaning that there is an undirected edge between $$$u_i$$$ and $$$v_i$$$ with weight $$$w_i$$$.
It is guaranteed that the graph is simple, connected, and is a cactus.
Each of the next $$$q$$$ lines contains two integers $$$u$$$ and $$$v$$$ ($$$1 \le u, v \le n$$$), describing one query.
For each query, print one integer: the minimum possible total weight of a simple path from $$$u$$$ to $$$v$$$.
5 5 31 2 52 3 -103 4 54 1 13 5 21 35 42 4
-5 -2 -5
There are two simple paths from $$$1$$$ to $$$3$$$:
So the answer to the first query is $$$-5$$$.
| Name |
|---|


