Text from the official booklet. Refer to the PDF for original mathematical notation, formatting, and linked input files. Printed samples and inputs are reproduced as published.
A company wants to standardize a set of numerical values by adjusting them to a common target in the most cost-efficient way. The cost of adjusting a value is the absolute difference between the original and new value. Given an array of N values, determine the minimum total adjustment cost required to make all values equal. The first line contains an integer N (1 ≤ N ≤ 100,000), the number of values. The second line contains an array of N integers A₁, A₂, ..., A� (-1,000,000 ≤ Aᵢ ≤ 1,000,000), representing the values. Output a single integer representing the minimum total cost to make all values equal. Sample Input: 5 50000 52000 54000 70000 75000 Sample Output: 43000 Explanation: 1. Sort the values: 50000, 52000, 54000, 70000, 75000 2. Choose the median value: 54000 3. Compute the adjustment cost: ● Adjust 50000 → 54000 (+4000) ● Adjust 52000 → 54000 (+2000) ● 54000 stays the same (0) ● Adjust 70000 → 54000 (-16000) ● Adjust 75000 → 54000 (-21000) 4. Total cost = 43000 Find the minimum total adjustment cost for the following input: 6 55000 60000 62000 75000 80000 50000