Python, binary search + two pointers, explained
Discuss 2 cases: k-th smallest is negetive/positive splitArr\n2. In helper function, arr1[i+1] * arr2[j] > arr1[i] * arr2[j] and arr1[i] * arr2[j+1] > arr1[i] *
1. Discuss 2 cases: k-th smallest is negetive/positive `splitArr`\n2. In `helper` function, arr1[i+1] * arr2[j] > arr1[i] * arr2[j] and arr1[i] * arr2[j+1] > arr1[i] * arr2[j]. Same for arr3 and arr4. Do binary search in range [smallest_product, largest_product].\n3. Then for arr1 and arr2 (or arr3 and arr4), we can use two pointers to find how many products is smaller than mid. `countSmaller`\n```\nclass Solution:\n    def kthSmallestProduct(self, nums1: List[int], nums2: List[int], k: int) -> int:\n        def splitArr(arr):\n            for i in range(len(arr)):\n                if arr[i] >= 0:\n                    return arr[:i], arr[i:]\n            return arr[:], []\n        \n        def countSmaller(target, arr1, arr2) -> int:\n            i, j = 0, len(arr2)-1\n            cnt = 0\n            for i in range(len(arr1)):\n                while j>=0 and arr1[i]*arr2[j] > target:\n                    j -= 1\n                cnt += j + 1\n            return cnt\n        \n        def helper(k, arr1, arr2, arr3, arr4) -> int:\n            b1 = len(arr1) and len(arr2)\n            b2 = len(arr3) and len(arr4)\n            l = min(arr1[0]*arr2[0] if b1 else math.inf, arr3[0]*arr4[0] if b2 else math.inf) \n            r = max(arr1[-1]*arr2[-1] if b1 else -math.inf, arr3[-1]*arr4[-1] if b2 else -math.inf)\n            while l <= r:\n                mid = l+(r-l)//2\n                rank = countSmaller(mid, arr1, arr2) + countSmaller(mid, arr3, arr4)\n                if rank < k:\n                    l = mid + 1\n                else:\n                    r = mid - 1\n            return l\n        \n        \n        neg1, pos1 = splitArr(nums1)\n        neg2, pos2 = splitArr(nums2)\n        N_neg = len(pos1)*len(neg2) + len(pos2)*len(neg1)\n        if k > N_neg:\n            return helper(k-N_neg, pos1, pos2, neg1[::-1], neg2[::-1])\n        else:\n            return helper(k, neg1, pos2[::-1], neg2, pos1[::-1])\n```
['Two Pointers', 'Binary Tree', 'Python']