← All problemsSign in

By Hook or By Crook

There is an organisation having $N$ departments,where $i^{th}$ department has $M_i$ members. $Vermaji$ wants to become president of this organisation and for this, he needs to get at least half of the votes in his favour from each department i.e $\lceil M_i/2 \rceil$ members, where $i^{th}$ department has $M_i$ members. However, he gets to know that none of the members wants to vote for him. As

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