```python
def min_Ops(arr, n, k):
    if n == 0:
        return 0

    value_info = {}

    for num in arr:
        op_count = 0
        current_val = num
        
        while True:
            if current_val not in value_info:
                value_info[current_val] = (0, 0)
            
            count, total_ops = value_info[current_val]
            value_info[current_val] = (count + 1, total_ops + op_count)

            if k == 1:
                break
            
            if current_val == 0:
                break

            if current_val % k == 0:
                current_val //= k
                op_count += 1
            else:
                break

    min_total_ops = float('inf')

    for val, (count, total_ops) in value_info.items():
        if count == n:
            min_total_ops = min(min_total_ops, total_ops)

    if min_total_ops == float('inf'):
        return -1
    else:
        return min_total_ops
```