Output #1
2
The following procedure carries the treasure chest to island $4$ for a total of $2$ coins.
1. Resident $1$ moves from island $3$ to island $2$. The route is not covered by the coupon, so $1$ coin is paid.
2. Resident $1$ moves from island $2$ to island $1$. The route is covered by the coupon, so no coin is needed.
3. Resident $1$ moves from island $1$ to island $0$. The route is covered by the coupon, so no coin is needed.
4. Resident $1$ picks up the treasure chest.
5. Resident $1$, carrying the treasure chest, moves from island $0$ to island $1$. The route is covered by the coupon, so no coin is needed.
6. Resident $1$ passes the treasure chest to resident $2$.
7. Resident $2$, carrying the treasure chest, moves from island $1$ to island $2$. The route is not covered by the coupon, so $1$ coin is paid.
8. Resident $2$, carrying the treasure chest, moves from island $2$ to island $3$. The route is covered by the coupon, so no coin is needed.
9. Resident $2$, carrying the treasure chest, moves from island $3$ to island $4$. The route is covered by the coupon, so no coin is needed.
