[ad_1]
My first try resulted in crashes. Thanks Ross for pointing it out.
Crashes are dangerous. We should land all planes.
Issues like this require you considering in the proper items. Here is a revised resolution:
Assumptions:
A tank holds 180 items of gas.
Every diploma of journey consumes 1 unit of gas.
Planes at all times journey 1 diploma a minute,
Gas switch is instantaneous.
Denote a aircraft as A(place in levels, Gas)
1: A, B ,C all take off on the similar time, and fly 45 levels. A(45,135), B(45,135), C(45, 135). (t = 45 m)
2: C transfers 45 items of gas to every of A and B. A(45, 180) B(45,180), C(45, 45)
3: C returns and refuels C(0,180)(t= 90 m)
4: A and B keep it up to 90. A(90, 135), B(90, 135)
5: B transfers 45 gas to A(90, 180), B(90, 90) (t= 90 m)
6: B returns and refuels (t= 180 m)
7: A carries on to 270. A(270, 0) (t= 270 m)
8: C takes off within the different route at t = 180 to satisfy A at 270. A(270,0) C(270,90) (t= 270)
9: C transfers 45 items of gas to A. A(270,45) C(270,45) (t= 270)
10: C and A keep it up to 315. A(315,0) C(315,0) (t= 315)
11: B takes off at t=270, and travels to 315. A(315,0) B(315, 135) C(315,0) (t= 315)
12: B transfers 45 items to every of A and C, A(315,45) B(315, 45) C(315,45)
13: All of them have simply sufficient gas to get dwelling.
The primary trick is that the query specifies tank dimension, not gas quantity. So refueling is allowed.
[ad_2]