Simple solution - beats 100% 🔥
Complexity
Time complexity : O(N * M)

Space complexity: O(1)
Code


# Complexity
- Time complexity : O(N * M)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int numberOfPairs(int[] nums1, int[] nums2, int k) {
        int goodPair = 0;
        for (int i = 0;i < nums1.length; i++) {
            int rs1 = nums1[i];
            for (int j = 0; j < nums2.length; j++) {
                int rs2 = nums2[j];
                if (rs1 % (rs2 * k) == 0) {
                    goodPair += 1;
                }
            }
        }
        return goodPair;
    }
}
```
['Java']