ns n integers C1,C2&hellip;Cn(0&lt;=Ci&lt;=10000), separated by single spaces; the number Ci specifies the cost of building a TIP in the town no. i.</div>
<div>Then, a description of the Byteotian road network follows. The i-th of the following m lines contains two integers Ai，Bi(1&lt;=Ai&lt;Bi&lt;=N), separated by a single space, that indicate that the towns no. Ai and Bi are linked by a road. There is at most one (direct) road between any pair of towns.</div>
<div><span style="white-space: pre-wrap;">