EASY TO UNDERSTAND | CLEAN CODE | 2X BINARY SEARCH 
Binary Search on Answer.For each index i in nums1 , find the point in nums2 till which the product is less than the value in the binary search on answer.For fin
Binary Search on Answer. \n\nFor each index i in nums1 , find the point in nums2 till which the product is less than the value in the binary search on answer.\n\nFor finding the point we can just observe that if nums1[i] <= 0 then it is better to perform the binary search for the point on the array sorted in descending order & if nums[i] > 0 then we can just perform binary search for the point in ascending order. As they form monotonic product pairs.\n\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<int>a;\n    vector<int>b;\n    vector<int>nums;\n    long long k;\n\n    bool ok(long long x) {\n        int m = (int)nums.size();\n        int n = (int)a.size();\n        long long cnt = 0;\n        for(int i = 0 ; i < m ; i++) {\n            int l = -1;\n            int r = n;\n            while(r > l + 1) {\n                int m = (l+r) >> 1;\n                int val;\n                if(nums[i] <= 0) {\n                    val = b[m];\n                } else {\n                    val = a[m];\n                }\n                if(nums[i] *1LL* val <= x) {\n                    l = m;\n                } else {\n                    r = m;\n                }\n            }\n            cnt += (l+1);\n        }\n        return cnt >= k;\n    }\n\n    long long kthSmallestProduct(vector<int>& nums1, vector<int>& nums2, long long _k) {\n        k = _k;\n        nums = nums1;\n        a = nums2;\n        b = nums2;\n        sort(a.begin(),a.end());\n        sort(b.rbegin(),b.rend());\n        long long l = -1e11;\n        long long r = 1e11;\n        while(r > l + 1) {\n            long long m = (l+r) >> 1;\n            if(ok(m)) {\n                r = m;\n            } else {\n                l = m;\n            }\n        }\n        return r;\n    }\n};\n```
['C++']