Chef and Railway Stations
CodeChefOpen on judge ↗
Chef was working on building rail tracks connecting pairs of railway stations in a 2D Cartesian coordinate system. There are $N$ stations on the $x$-axis, with coordinates $x_1, x_2, \ldots, x_N$, and $M$ stations on the $y$-axis, with coordinates $y_1, y_2, \ldots, y_M$. Chef has completed his task and built a rail track (line segment) between each pair of stations. Now, Chef is wondering how
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