#P1576. 最小花费

最小花费

Description

Among nn people, certain pairs can transfer money between their bank accounts. The transfer fee between these people can differ from pair to pair. Given, for each such pair, the percentage fee that will be deducted from the transferred amount, determine the minimum amount AA must have so that after the transfers BB receives 100100 yuan.

Input Format

The first line contains two positive integers n,mn,m, representing the total number of people and the number of pairs who can transfer money to each other.

Each of the following mm lines contains three positive integers x,y,zx,y,z, meaning that transferring money between person xx and person yy incurs a fee of z%z\% deducted from the transferred amount (z<100)(z<100).

The last line contains two positive integers A,BA,B. The testdata guarantees that AA and BB can transfer money directly or indirectly.

Output Format

Output the minimum total amount that AA needs so that BB receives 100100 yuan. Print to 8 digits after the decimal point.

3 3                                     
1 2 1
2 3 2
1 3 3
1 3

103.07153164

Hint

1n2000,m1000001\le n \le 2000,m\le 100000.

It is guaranteed that the answer does not exceed 10410^4.

Translated by ChatGPT 5