Prime Grid
CodeChefOpen on judge ↗
Hermione enjoys math and painting. She specifically likes prime numbers. She recently thought of something new. Given a square paper with side length $n$, she will drop ink blots on every prime number in that square. An ink blot covers that location along with the 8 locations directly by it. The top left of the square is 0, and the bottom right is $n^2 - 1$. Given the side length of the square, ca
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