There are two lights that blink at regular intervals. When each one blinks, it turns on and then immediately back off; they don't toggle. They are both off at time t = 0. The first one blinks at t = p, 2p, 3p,⋯seconds; the second one blinks at t = q, 2q, 3q,⋯seconds. Once they start, they both keep blinking forever. It is veryexciting to see them blink at the same time (on the same second). But your patience is going to run out eventually, in ss seconds. Will they blink at same time between t = 1 and t = s (inclusive)? Write a program that can answer this question, quick, before they start blinking again!
Figure B.1: Illustration of the sample inputs. A black circle means the light is off, a white circle means the light blinks at that second. The arrows above point out times when both lights blink.