Company: Makemytrip_3aug
Difficulty: medium
Airport Connectivity Challenge Problem Description There are N airports scattered across a vast territory. The i-th airport is located at coordinates (x_i, y_i) on a coordinate plane. Multiple airports can exist at the same location (co-located airports). Flight Route Construction Rules You can establish direct flight routes between any two airports at coordinates (a,b) and (c,d). The cost to establish a route is determined by the minimum of the horizontal and vertical distances between the airports, measured in flight credits. Important: The cost calculation uses the minimum of the two distances, not the sum or maximum. This reflects the fact that flight paths can be optimized to follow either the horizontal or vertical direction more efficiently. Objective Your goal is to establish flight routes so that passengers can travel between any pair of airports by taking connecting flights. What is the minimum total cost in flight credits required to achieve complete airport connectivity? In