Hxoi 2014 pset 4 day 1 model 04 Day 1 Solution

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.