Answer: The correct pairing is:
1. El hombre caminaba cuando <u>dio con un viejo amigo</u>.
2. Usaba la computadora cuando <u>se fue la luz</u>.
3. El estudiante guardaba un archivo cuando <u>se apagó la computadora</u>.
4. Yo compraba un regalo cuando <u>supe que había rebajas</u>.
Explanation:
1. In this sentence a man walked when "saw an old friend", <em>other option valid could be "lights out"</em> but <em>has its best sense in another sentence</em>.
2. The sentence says: I used the laptop when "lights out", <em>other options could be "laptop went off" but mentioning twice the substantive isn't normal.
</em>
3. In this sentence the student saved a file when "laptop went off", is unique that could use in this case.
4. The sentence says: I bought a gift when "knew that had sales", the last option from all.