You are given an array A of N integers. Each element in the array has a value between 1 and K. You can change the value of any element by incrementing or decrementing it by 1 in a single step. The values are circular, meaning:
Find the minimum total number of steps required to make all elements in the array equal.
The first line contains two integers, N (the size of the array) and K (the maximum value in the circular range).
The second line contains N space-separated integers representing the array A.
Print a single integer representing the minimum number of steps to equalize the array.