|Five persons are standing on one
side of a bridge.
They want to
cross the bridge.
torch, they cannot proceed.
torch is available.
has a remaining battery life of only 30 seconds.
people can go over the bridge at one time.
needs to be returned to the remaining persons.
people take different times to cross the bridge.
One takes 1
second to cross the bridge.
take 3 seconds, 6 seconds, 8 seconds and 12 seconds.
crosses the bridge within 30 seconds.
How do they proceed?