Aryabhatta and his Generosity
CodeChefOpen on judge ↗
Aryabhatta along with being a very great mathematician was also a great human being. He used to donate all his hard earned money to the needy. Aryabhatta has $N$ rupees with him and there are $Q$ people who need money. A person will be happy if he gets the amount of money he needs. The amount of money $i^{th}$ person needs is given by an integer $X_{i}$. Aryabhatta wants to make maximum people
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