Java solution using binarysearch
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    //https://www.youtube.com/watch?v=LktWIgiNKMQ\n    public long kthSmallestProduct(int[] nums1, int[] nums2, long k) {\n        List<Integer> negativeNums1 = applyFilter(nums1, false);\n        List<Integer> positiveNums1 = applyFilter(nums1, true);\n        List<Integer> negativeNums2 = applyFilter(nums2, false);\n        List<Integer> positiveNums2 = applyFilter(nums2, true);\n\n        long totalNegativeNumCount = negativeNums1.size() * positiveNums2.size() \n                    + negativeNums2.size() * positiveNums1.size();\n\n        if (k > totalNegativeNumCount) {\n            k -= totalNegativeNumCount;\n            // search space is positiveNums1 and positiveNums2\n            reverse(negativeNums1);\n            reverse(negativeNums2);\n\n            long low = (long) -1e10;\n            long high = (long) 1e10 + 1;\n            long mid, ans =-1, count;\n            while (low <= high) {\n                mid = low + (high - low) / 2;\n                count = count(positiveNums1, positiveNums2, mid) + \n                        count(negativeNums1, negativeNums2, mid);\n                if (count >= k) {\n                    ans = mid;\n                    high = mid - 1;\n                } else {\n                    low = mid + 1;\n                }\n            }\n            return ans;\n        } else {\n            reverse(positiveNums1);\n            reverse(positiveNums2);\n\n            long low = (long) -1e10;\n            long high = (long) 1e10 + 1;\n            long mid, ans = -1, count;\n            while (low <= high) {\n                mid = low + (high - low) / 2;\n                count = count(negativeNums1, positiveNums2, mid) + \n                        count(negativeNums2, positiveNums1, mid);\n                if (count >= k) {\n                    ans = mid;\n                    high = mid - 1;\n                } else {\n                    low = mid + 1;\n                }\n            }\n            return ans;\n        }\n\n    }\n\n    private long count(List<Integer> list1, List<Integer> list2, long val) {\n        \n        int j = list2.size() - 1;\n        long count = 0;\n        for (int i = 0; i < list1.size(); i++) {\n            while (j >= 0) {\n                if ((long) list1.get(i) * (long) list2.get(j) <= val) {\n                    count += j + 1;\n                    break;\n                } else {\n                    j -= 1;\n                }\n            }\n        }\n        System.out.println(count + " " + val);\n        return count;\n    }\n\n    private void reverse(List<Integer> list) {\n        int low = 0, high = list.size() - 1;\n        while (low <= high) {\n            int temp = list.get(low);\n            list.set(low, list.get(high));\n            list.set(high, temp);\n            low += 1;\n            high -= 1;\n        }\n    }\n    private List<Integer> applyFilter(int[] nums, boolean isPositive) {\n        List<Integer> list = new ArrayList<>();\n        for (int num : nums) {\n            if (isPositive) {\n                if (num >= 0) {\n                    list.add(num);\n                }\n            } else {\n                if (num < 0) {\n                    list.add(num);\n                }\n            }\n        }\n        return list;\n    }\n}\n```
['Java']