Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Is it possible to make two integers a and b equal if they have different remainders dividing by x?
If it is possible, which number should you select to minimize the number of operations?
What if the elements are sorted?