← All problemsSign in

Party At Anwesha

A party has been organised after the successful launching of Codechef Chapter at IIT Patna. There are a total of n people attending the party. Everyone wishes to talk and shake hand with each other atleast once. Which means, for every pair of people (i,j), there should be at least one hand-shake. To ensure this, organisers decided to split n people into two groups each of size n/2 (n is guarantee

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