The alarm went off just as they came out of the building.
A.Scarcely they had come out of the building when the alarm went off.
B.Scarcely had they come out of the building when the alarm went off.
C.Scarcely they had come out of the building when did the alarm go off.
D.Scarcely had the alarm gone off when they came out of the building.