← All problemsSign in

Mehul, His Friends and His Enemy

It was Mehul's birthday. So Madhav being his best friend gave him a magic tree . The magical properties of the tree is that, the fruit grows only on N magical points in a tree., which are numbered as 1, 2,3 …N. Each magical point can have maximum of 10^6 fruits. The fun part is that Shailesh who doesn’t likes Madhav has the control of those magical point i.e. he can decide the numbers of fruits

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