← All problemsSign in

Problem 1

Imagine you are in a large city with many streets. You have to reach a particular street. If the city is represented in XY plane, you are at point x0,y0. You can travel parallel to the x axis or along y axis but you have to reach the street represented by ax+by=1. Return the shortest distance to reach the street. Input - First line contains T, the number of test cases - Second line contains f

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