Simple java solution
Complexity\n- Time complexity: O(n^2)\n\n- Space complexity: O(1)\n\n# Code\n\nclass Solution {\n    public int numberOfPairs(int[] nums1, int[] nums2, int k) {
# Complexity\n- Time complexity: $$O(n^2)$$\n\n- Space complexity: $$O(1)$$\n\n# Code\n```\nclass Solution {\n    public int numberOfPairs(int[] nums1, int[] nums2, int k) {\n        int count=0;\n        for(int i=0;i<nums1.length;i++)\n        {\n            for(int j=0;j<nums2.length;j++)\n            {\n                if(nums1[i]%(nums2[j]*k)==0)\n                {\n                    count++;\n                }\n            }\n        }\n        return count;\n    }\n}\n```
['Java']