← All problemsSign in

Back to School 2

Consider a circle with center C. Two lines are drawn from an exterior point P, such that one of them is tangent to the circle at a point S, while the other intersects the circle at points Q and R. You are given co-ordinates of points P(x1,y1), S(x2,y2) and R(x3,y3). Print the length of the segment QR. In case it is impossible for segment QR of non-zero length to exist, print “-1” (without the quot

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