Four friends A, B, C, D need to cross a bridge. A maximum of 2 people can cross at a time. It is night and they have just 1 lamp. People that cross the bridge must carry the lamp to see the way. A pair must walk together at the speed of slower person.
It takes:
A: 1 minute to cross bridge.
B: 2 minutes to cross bridge.
C: 7 minutes to cross bridge.
D: 10 minutes to cross bridge.
What is the total minimum time in minutes required for all 4 friends to cross the bridge?