Matrix
CodeChefOpen on judge ↗
Noyal wants ‘n’ papers for his event ‘Matrix’. He went to Roy Brothers Shop and found many piles of papers there. The shopkeeper told him that the ith pile contains i^3 papers and costs Rs. i and immediately asked him to take all the alternate piles starting from the last pile to the 1st or 2nd pile (depending on no. of piles being odd or even respectively) to meet his requirements. Now Noyal too
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