← All problemsSign in

Ken and his Political Party

Ken Kaneki has formed his political party. In order to make his party win the upcoming elections, Ken wants to recruit new candidates. He knows $N$ famous candidates. Each candidate has certain number of supporters. Due to pandemic, Ken only has certain amount of money left in his party funds. Hence, he can only recruit $p$ number of candidates. In order to win, he wants to recruit candidates w

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