← All problemsSign in

The Alien

An alien is chasing after Raj and Ravi. Raj screams at times p,p+x,p+2x,p+3x,... and Ravi screams at times q,q+y,q+2 y,q+3y,.... The Monster will catch them if at any point they scream at the same time. Input- - The first line contains two integers x and p(1≤x,p≤100). - The second line contains two integers y and q(1≤y,q≤100). Output - - Print the first time they will scream at the same time

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start