Road To Savings

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Pat Wholes is in charge of road maintenance in Capitol City, and boy do those roads need maintenance. The road conditions are so poor that accidents have become almost a daily event, and the surviving public is in an uproar. Now while Pat would love to pave every road in the city, he also wants to keep his job. The cost of all that paving would certainly upset the mayor, who would just as certainly replace Pat if he spends too much. So now the decision is: which roads get paved and which don't? After thinking about this problem -- and his job security -- Pat came up with a bright idea: since the ultimate goal is to keep the mayor happy, he'll pave only those roads that are on a shortest path from the mayor's house to the mayor's office. There actually might be several ways for the mayor to drive to work that are equally short, but that should still leave plenty of roads that aren't on any of these paths and hence plenty of roads that don't need to be paved (hopefully). Pat's come down to your cubicle in the basement to ask you to determine the length of roads that don't need to be paved.

입력

Input starts with four positive integers nn mm aa bb (n,a,b100,abn, a, b \leq 100, a \neq b) where nn indicates the number of intersections in the town (numbered 11 to nn), mm is the number of roads connecting intersections, and aa and bb are the intersections where the mayor's house and office are located, respectively. Following this are mm lines, each containing a triplet of numbers i_1i\_1 i_2i\_2 \ell (1i_1,i_2n,i_1i_2,11001 \leq i\_1, i\_2 \leq n, i\_1 \neq i\_2, 1 \leq \ell \leq 100) indicating a two-way road exists between intersection i_1i\_1 and i_2i\_2 with length \ell. At most one road exists between any two intersections and at least one path exists between aa and bb.

출력

Output the total length of all roads that don't need to be paved.