SUBTLEBA - Trucks Transportation

题意翻译

#### 题目描述 SBC 公司是信息学竞赛的主要气球供应商;它拥有庞大的工厂、仓库和卡车车队,以此来让选手们感到快乐。Nlogonia 有很多比赛场地,并且它们都让 SBC 为比赛提供气球。Nlogonia 是一个由几座桥梁连接的群岛,每个岛屿可能有几个 SBC 的仓库。然而,在规划气球运输路线时,SBC 面临着一个问题:出于安全考虑,Nlogonia 的每座桥梁都有一定的载重限制。由于运输商品的重量很大,SBC运营负责人要求你编写一个程序,帮助他计算出仓库和比赛场地之间允许运输的最大重量。

题目背景

该题在原 OJ 已不能提交,请去 UVA12655 提交。

题目描述

The Subtle Balloons Company (SBC) is the main balloon provider for programming contests; it has huge factories and warehouses, as well as an extensive truck fleet to ensure the contestants’ happiness. There are lots of competition sites in Nlogonia, and all of them hired SBC for supplying balloons for their contests. Nlogonia is an archipelago connected by several bridges. Every island of Nlogonia may have several regional sites and may also house several SBC warehouses. When planning the routes for balloon deliveries, SBC faced a problem: for safety issues, every bridge in Nlogonia has some maximum weight limit for vehicles which cross it. And because of the great net weight of the transported merchandise, SBC operations’ chief asked you to write a program to determine the maximum weight allowed to be transported between warehouses and competition sites.

输入输出格式

输入格式


The input contains several test cases. The first line of a test case contains three integers **N**(2 N **M**(1 M **S**(1 S which indicate, respectively, the number of islands, the number of bridges that connect the islands and the number of sites. The islands are numbered from 1 to **N**. Each of the next **M** lines describes a bridge. The description of a bridge consists in a line with three integers **A**, **B** and **W**(0 W S lines describe a competition site and contains two integers **L** and **H** indicating, respectively, the number of the island where this site is and the number of the island where the wharehouse which will be used to deliver the balloons to the site is. (1 A,**B**,**L**,**H** N, **A** != **B**, **L** != **H**)

输出格式


For each site in a test case, in the order they were given, your program must produce a single line, containing a single integer, the biggest weight which can be transported by truck from the warehouse to the site.

输入输出样例

输入样例 #1

4 5 41 2 91 3 02 3 82 4 73 4 41 42 13 14 34 5 21 2 302 3 203 4 104 1 402 4 501 31 2

输出样例 #1

79872040