There are 4 people (A, B, C, and D) who want to cross a bridge at night.
A, B, C, and D take 1, 2, 5, and 8 minutes, respectively, to cross the bridge.
There is only one torch with them, and the bridge cannot be crossed without the torch.
There cannot be more than two people on the bridge at any time, and when two people cross the bridge together, they must move at the slower person's pace.
The trick here is that the persons with the fastest speeds only should come back (and that too only if there is a need to come back, as here we need to bring back the torch). A comes back in step-1 and B comes back in step-2. And, finally reduce the number of traveling back, like C, D does not come back.