Naruto and Boruto
CodeChefOpen on judge ↗
Naruto and Boruto both are capable of generating powerful shadow clones. One day they decided to test the strength of each others shadow clones. Naruto created N shadow clones indexed from 1 to N and Boruto created M shadow clones indexed from 1 to M. Naruto's clones are attacking Boruto's clones. Whenever Naruto's Clone attack it costs Naruto some energy. Similarly whenever Boruto's clone gets at
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