C++
\ntypedef long long int ll;\n\nclass Solution \n{\npublic:\n    long long kthSmallestProduct(vector<int>& nums1, vector<int>& nums2, long long k) \n    {\n     
```\ntypedef long long int ll;\n\nclass Solution \n{\npublic:\n    long long kthSmallestProduct(vector<int>& nums1, vector<int>& nums2, long long k) \n    {\n        ll left = -(ll)(1e10) - 1;\n        ll right = (ll)(1e10) + 1;\n        \n        while(right - left > 1)\n        {\n            ll mid = (left + right) / 2;\n            ll num = 0;\n            \n            for(int number : nums1)\n            {\n                if(number == 0)\n                {\n                    if(mid >= 0)\n                    {\n                        num += nums2.size();\n                    }\n                }\n                else if(number > 0)\n                {\n                    ll roundedNumber = floor(mid / (double)number); // round down\n                    auto iter = upper_bound(nums2.begin(), nums2.end(), roundedNumber);\n                    num += iter - nums2.begin();\n                }\n                else\n                {\n                    ll roundedNumber = ceil(mid / (double)number); // round up\n                    auto iter = lower_bound(nums2.begin(), nums2.end(), roundedNumber);\n                    num += nums2.size() - (iter - nums2.begin());             \n                }\n            }\n            \n            if(num >= k)\n            {\n                right = mid;\n            }\n            else\n            {\n                left = mid;\n            }\n        }\n        \n        return right;\n    }\n};\n\n// The complexity is O(NlogNlogA), where N denotes max(nums1.size(), nums2.size()) and A denotes the size of the range\n```
['Binary Tree']