← All problemsSign in

Save The Trees

CodeChef has been very busy with his Christmas preparations and he doesn't have time to look after Samosa Bhai and Jalebi Bai. To keep them busy, CodeChef has given them an array **A** of size **N**. He has asked them to plant trees at the points with Cartesian coordinates (**A[ i ]**, **A[ j ]**), such that **i** 5** - **1** ≤ **Value of the array elements** ≤ **108** - **1** ≤ **Sum of N over al

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