1. Minimum Cost (money. PAS/C/CPP) Problem Description
Some of the N people can transfer funds between their bank accounts. The fees for transfers between these individuals are different. Given the need to deduct a few percent of the service charge from the transfer amount when transferring funds between these people, may I ask how much a requires at least so that B will receive 100 yuan after the transfer.
Input
Enter two positive integers n and m in the first line, indicating the total number of people and the number of people who can transfer money to each other.
Input three positive integers x, y, and z in each row in the following m rows, indicating that the person with the X mark and the person with the Y mark must deduct the fee of Z % (z <100) for mutual transfer ).
Enter two integers A and B in the last line. Data ensures direct or indirect transfer between A and B.
Output
Output A to make B receive the total cost of at least 100 yuan. Accurate to the last 8 digits of the decimal point.
Input example
3 31 2 12 3 21 3 31 3
Output example
103.07153164
Data range: $ n \ le 2000 $
Hxoi 2014 pset 4 day 1 model 04 Day 1 Solution