Minimum operations to make GCD of array a multiple of k

We are given an array and k, we need to find the minimum operations needed to make GCD of the array equal or multiple of k. Here an operation means either increment or decrement an array element by 1.

Read this article to explore the solution to this problem

This is a companion discussion topic for the original entry at