best soln
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

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

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

# Code
```cpp []
class Solution {
public:
    
    int check(long long mid,vector<int>& nums1, vector<int>& nums2, long long k)
    {
        long long count=0;
        for (int i = 0; i<nums1.size(); i++) {
            if (nums1[i] > 0) {
                count += upper_bound(nums2.begin(), nums2.end(),floor((double) mid / nums1[i]) ) - nums2.begin();
            } else if (nums1[i] < 0) {
                long long rem = ceil((double)mid/nums1[i]);
                int ind = lower_bound(nums2.begin(), nums2.end(), rem) - nums2.begin();
                count += (nums2.size()-ind);
            } else {
                if (mid >= 0) count += nums2.size();
            }
        }
        return count>=k;
    }
    long long kthSmallestProduct(vector<int>& nums1, vector<int>& nums2, long long k) {
        int n=nums1.size(),m=nums2.size();
        long long lo=-1e18;
        long long hi=1e18;
        long long ans=-1;
        while(lo<=hi)
        {
            long long mid=lo+(hi-lo)/2;
            if(check(mid,nums1,nums2,k))
            {
                ans=mid;
                hi=mid-1;
            }else{
                lo=mid+1;
            }
        }
        return ans;
    }
};
```
['Array', 'Binary Search', 'C++']