The family approached the bridge at night. Dad can cross it in 1 minute, Mom in 2, the child in 5, and Grandma in 10 minutes. They have one flashlight. The bridge can only hold two people at a time. How can they cross the bridge in 17 minutes? (If two people cross together, they move at the slower of their speeds. Moving across the bridge without a flashlight is not allowed. Shining the light from a distance is not allowed. Carrying each other is not allowed.)
Here is the sought-after algorithm:

dad and mom - 2 min dad back with the flashlight -1 min, baby and grandma - 10 min, mom back with the flashlight -2 min, dad and mom - 2 min.

In total 17 minutes