Building Own Computer
CodeChefOpen on judge ↗
Chef wants to build his own computer. So, he bought a motherboard. Motherboard has infinite slots for RAM. Chef decided to go to the Hardware market. He possesses $M$ rupees only. In the market, there are $N$ RAMs of different brand and different memory available. Find the maximum possible memory that Chef can buy. Chef can also buy more than one unit of RAM of the same brand and same memory.
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