← All problemsSign in

Find the Prime

Given three integers Ai, Bi and Ci , find the minimum possible prime factor which is a multiple of Ci and does not belong to the range of [Ai, Bi]. INPUT The first integer contains t test cases , t lines contains the value of the Ai , Bi and Ci. OUTPUT Print “YES” if possible Else print “NO” if not present Example Input 2 4 9 48 7 16 49 Output YES NO Explanation: In first case 2 is a

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