Simple C solution || 100% Beats 
Code

# Code
```c []
int countPairs(int* nums, int size, int k) {
    int count = 0;
    for(int i=0;i<size;i++)
    {
        for(int j=i+1;j<size;j++)
        {
            if((i<j<size && (nums[i]==nums[j]) && (i*j)%k==0)) count++;
        }
    }
    return count;
}
```
['C']