Company: Auxia_22july
Difficulty: medium
Challenge 10c Problem Description You are given n points on a number line. The i-th point sits at coordinate x[i] . Two points i and j may be matched with each other when both of the following hold: neither i nor j is already matched with some other point; |x[i] - x[j]| >= z . Every point may belong to at most one matched pair. Determine the maximum number of pairs that can be formed. Two points that happen to share the same coordinate are still two distinct points, and they may be matched with each other only if 0 >= z , which never holds under the constraints below. Input Format (inferred - the source describes the input only as "an integer array"; the concrete line layout below is pinned here. The element order is unchanged: n, then z, then the n coordinates.) The input consists of three lines: Line 1: a single integer n , the number of points. Line 2: a single integer z , the minimum required distance between two matched points. Line 3: n space-separated integers x[1] x[2] ..