Visiting Prime Relatives
CodeChefOpen on judge ↗
Mangilaal wants to meet his close relatives, there are $N$ colonies from $1$ to $N$ with each having house numbers in a particular range $[l_{i}, r_{i}]$ ( both inclusive). Mangilaal wants to visit the houses which falls in the range $[L, R]$ ( both inclusive) and decided that he will $\textbf{only visit the house numbers which are prime}$ as he is fond of prime numbers. You have to prin
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.
Sign in to chat with the tutor and save your progress.
Sign in to start