The first line of the standard input contains two integers N,M(2<=N<=20 000,0<=m<=25000), separated by a single space, that specify the number of towns and roads in Byteotia respectively. The towns are numbered from to n. The second line of input contains n integers C1,C2…Cn(0<=Ci<=10000), separated by single spaces; the number Ci specifies the cost of building a TIP in the town no. i.
Then, a description of the Byteotian road network follows. The i-th of the following m lines contains two integers Ai,Bi(1<=Ai<Bi<=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.
第一行包含两个正整数n,m(1<=n<=20000,0<=m<=25000),分别表示点数和边数。
第二行包含n个整数,其中第i个数为C[i](0<=C[i]<=10000),表示在第i个点建立旅游站点的费用。
接下来m行,每行两个正整数u,v(1<=u,v<=n),表示u与v之间连了一条边,保证没有重边