← All problemsSign in

Alfredo And The Alluring Aliens

Alfredo, the robot, accidentally lands in an alien matrix $A$ of size $N*N$. He is initially standing at the top-left cell, i.e., $(1,1)$. Standing there, Alfredo could see $Q$ attractive aliens each residing in the $(xi,yi)$ cell. The robot wants to meet them all but he has a problem. *Every time he goes to a cell that has a prime number in it, his confidence decreases*. So, he decides to ch

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