#P1576. 最小花费
最小花费
Description
Among 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 must have so that after the transfers receives yuan.
Input Format
The first line contains two positive integers , representing the total number of people and the number of pairs who can transfer money to each other.
Each of the following lines contains three positive integers , meaning that transferring money between person and person incurs a fee of deducted from the transferred amount .
The last line contains two positive integers . The testdata guarantees that and can transfer money directly or indirectly.
Output Format
Output the minimum total amount that needs so that receives 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
.
It is guaranteed that the answer does not exceed .
Translated by ChatGPT 5
京公网安备 11011102002149号