Coal Transportation by train

Source: Internet
Author: User

Question:

A coal mine has 3000 tons of coal to be sold on the market. A train can be used to transport coal. A train can hold up to 1000 tons of coal, and the train itself needs to burn coal for power, each kilometer consumes 1 ton of coal. How can I transport the most coal to the market?


Analysis:

Set the train start point to a and end to B, so that the train cannot suddenly run from A to B, so there is nothing left for B. It does not work at the midpoint, because it returns to a after the midpoint, and just runs out of all the coal it carries, only burning coal does not work! How far is it necessary to return the appropriate response?


We can reverse the reasoning. The best case for the last train to arrive at is that the train departs from a certain point between B with 1000 tons of coal, except for the amount consumed on the road, the rest can be shipped to point B.


Where should we start from the last 1000 tons of coal? It must have come from 2000 tons of coal. Why is it 2000 tons instead of other figures? Other numbers are acceptable, but they may be complicated. The 2000-ton number is special, which is exactly twice the transportation volume of trains and is just a complete number. The problem is: how far can 2000 tons of coal be consumed by 1000 tons at most? We know that 2000 tons of coal need to be set off twice by train, plus the return time in the middle, three times in total (no return is required after the last departure), that is, how far the 1000-ton coal train can run three times, 1000/3 meters.


Likewise, 2000 tons should start from the starting point, which is converted from 2000 tons. This time, 3000 tons of trains need to be transported three times, plus two returns, five in total, the train consumes 1000 tons of coal and can run 200 meters.


In summary, the last departure of the train was from the starting point of 200 + 1000/3, and there was still 1000-(200 + 1000/3) M to the point of B. The coal consumption was also so many tons, so there are 200 + 1000/3 tons of coal.


Of course, forward derivation is also possible. This is a piecewise function, which can be pushed from the start point to the end point. I will not elaborate on it here. If you are interested, please search online.


Coal Transportation by train

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.