← All problemsSign in

Prime Graph

CodeChefRating 2496Open on judge ↗

While doing his research in the Institute of Lovely Graphs, Rashad came up with another problem called Prime Graph. Prime Graph is a simple graph (undirected graph which does not contain any self-loops or multiple-edges) with $N$ nodes such that the degree of each node is prime. Rashad wants to know what is the maximum number of edges a prime graph with $N$ nodes can contain. Can you help Rashad

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