Puzzle involving three travellers trying to arrive at the same time I have a puzzle stated as follows:
There are three friends travelling to a party from the same location. The party is $320$ kilometres away, and they must arrive at the same time. They have two motorcycles to use - one that can go $60 \text{km/h}$, and one that can do $80 \text{km/h}$. They can also run at $40 \text{km/h}$. Each motorcycle can only carry one person. These friends can swap modes of transport at the end of each hour. They are not allowed to wait at a spot for the rest to catch up, but they can leave either of the bikes for others to pick up. How long does it take them?
Not a very realistic problem, but it's challenging me. I tried setting up a system of equations and was hoping to solve with matrices but I ended up with too many unknowns. I also tried "brute force" thinking it, but I can't make it such that they only swap modes every hour. What's the best way to go about this? Thanks for your time.
 A: For $i=1,2,3$, let us say the participant $i$ rides the fast bike for $f_i$ hours, the slow bike for $s_i$ hours and runs for $r_i$ hours.  By assumption, $f_i,s_i,r_i$ are all non-negative integers.  Also, by symmetry, and to eliminate trivial solutions, we can assume $f_1>0, s_2>0$, that is, participant $1$ starts out on the fast bike and participant $2$ starts out on the slow bike.
We have $$80f_i+60s_i+40r_i=320,\ i=1,2,3$$ or $$4f_i+3s_i+2r_i=16$$ and we observe that $s_i$ is even.
Now the fast motorbike cannot travel more than $320$ miles, and the slow motorbike cannot travel more than $240$, since it travels an even number of hours.  That makes a total of $$3\cdot320-320-240=400$$ miles to be covered running.  We have $4$ hours for each bike and $10$ hours running for the $3$ participants, so the trip cannot take less than $6$ hours.
Here is a six-hour solution.  One rides the fast motorbike for $2$ hours and runs for $4$. Another runs for $4$ hours, picks up the fast motorbike, and rides for $2$. The third rides the slow motorbike for $4$ hours, abandons it, and walks for $2$. All arrive in $6$ hours, without the slow motorbike.
I had thought this was the only solution, but that is not true.
We have $$80f_i+60s_i+40r_i=320,\ i=1,2,3$$ or $$4f_i+3s_i+2r_i=16$$ and we observe that $s_i$ is even.  We must have $f_i+s_i+r_i$ constant.  With such small numbers, we can check for possible solutions by brute force.  I wrote a little python script to do so, and found $5$ solutions:
(1, 0, 6) (0, 2, 5) (0, 2, 5)
(1, 0, 6) (0, 2, 5) (1, 0, 6)
(1, 2, 3) (1, 2, 3) (2, 0, 4)
(2, 0, 4) (0, 4, 2) (2, 0, 4)
(2, 0, 4) (1, 2, 3) (1, 2, 3)

Each triple is of the form $(f_i,s_i,r_i)$.  The last three solutions each take $6$ hours.  The fourth is the one I gave above.  To see that the third actually leads to a solution of the problem, let participant $1$ ride the fast motorbike for an hour and run for an hour, traveling $120$ miles in $2$ hours.  Let participant $2$ ride the slow motorbike for $2$ hours, also traveling $120$ miles in $2$ hours.  Participant $3$ runs for $2$ hours, arriving where participant $1$ left the fast bike.
Participant $1$ rides the slow motorbike for $2$ hours and then runs for $2$ hours, arriving at the goal.  Participant $3$ rides the fast motorbike for $2$ hours and then runs for $2$ hours.  Participant $2$ runs for $3$ hours, arriving at mile $240$, where participant $3$ left the fast motorbike, and rides it for $1$ hour.
I haven't checked the fifth solution, but I imagine it will work also.  It's possible that there's more than one protocol
