Simple solution
Code

# Code
```cpp []
class Solution {
public:
    int numberOfPairs(vector<int>& nums1, vector<int>& nums2, int k) {
        int res = 0;
        size_t len1 = nums1.size(), len2 = nums2.size();

        for (size_t i = 0; i < len1; ++i)
        {
            for (size_t j = 0; j < len2; ++j)
            {
                // is "good"
                if (0 == (nums1[i] % (nums2[j] * k)))
                {
                    ++res;
                }
            }
        }

        return res;
    }
};
```
['C++']