Respuesta :

A graph of the lights flashing (in seconds/P/Q) would look like this:

s P Q
1 15 25
2 30 50
3 45 75
4 60 100
5 90 125

The lights flashes at the same time whenever both lines intersect on the graph.