short and concise C++ code
IntuitionBinary SearchApproachIterate througth nums1 and denote current elemnt as num.
In each iteration, count the number of elements in nums2 such that their
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Binary Search

# Approach
<!-- Describe your approach to solving the problem. -->
Iterate througth `nums1` and denote current elemnt as `num`. 
In each iteration, count the number of elements in `nums2` such that their product <= `mid`.
Divide into three cases. Dry running test cases makes it easier to understand.
1. `num > 0` 
2. `num == 0`
3. `num < 0`


Compute `mid` with `floor` to get rid of infinite loop since `l` and `r` may be negative numbers.

# Complexity
- Time complexity: $$O(N1 ∗ Log(N2) ∗ Log(2 * 10^{10}))$$

- Space complexity: $$O(1)$$

# Code
```cpp []
class Solution {
public:
    long long kthSmallestProduct(vector<int>& nums1, vector<int>& nums2, long long k) {
        int n1 = nums1.size(), n2 = nums2.size();
        if (n1 > n2) {
            swap(n1, n2);
            nums1.swap(nums2);
        }
        long long l = -1e10, r = 1e10;
        while (l < r) {
            long long mid = floor((l + r) / 2.);
            long long cnt = 0;
            for (auto &num : nums1) {
                if (num == 0) {
                    if (mid >= 0) cnt += n2;
                }
                else if (num > 0) {
                    double target = (double)mid / num;
                    int j = upper_bound(begin(nums2), end(nums2), target) - begin(nums2);
                    cnt += j;
                }
                else {
                    double target = (double)mid / num;
                    int j = lower_bound(begin(nums2), end(nums2), target) - begin(nums2);
                    cnt += (n2 - j);
                }
            }

            if (cnt >= k) {
                r = mid;
            }
            else {
                l = mid + 1;
            }
        }
        return l;
    }
};

```
['C++']