资 源 简 介
Rules
The faster time is the better solution
Maximum items can crossing river per round is 2
Require at least one to drive a boat
Result
[[ GO ] | [BACK]] [, ] -> Total time is
* GO, BACK - Direction of boat
* X0, X1 - Weight of person
* W - Weight per round
* T - Total weight
Sample
java -jar RiverCrossing.jar 1 5 2 10[ GO ] 1 2 -> 2[BACK] 1 -> 1[ GO ] 10 5 -> 10[BACK] 2 -> 2[ GO ] 1 2 -> 2Total time is 17
Enjoy :P