← All problemsSign in

Lasers Everywhere

CodeChefRating 2396Open on judge ↗

Vivek likes playing with lasers, but his friend Divyansh says that reading biographies is much more interesting. In order to prove that lasers are fun too, Vivek proposed an interesting task involving them: You are given $N$ points in a plane (numbered $1$ through $N$); for each valid $i$, the $i$-th point is $P_i = (i, A_i)$. There are $N-1$ line segments between them (numbered $1$ through $N-

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