Simple Java code with Binary search with comments.
IntuitionSimple Java coding using Binary SearchCode
# Intuition
Simple Java coding using Binary Search

# Code
```java []
class Solution {
    
    private long INF = (long) 1e10;

    public long kthSmallestProduct(int[] nums1, int[] nums2, long k) {
        long min = -INF - 1;
        long max = INF + 1;
        while (min <= max) {
            long mid = max + (min - max) / 2;
            long s = countOfProductLessThanEqNum(mid, nums1, nums2);
            if (s >= k) {
                max = mid - 1;
            } else {
                min = mid + 1;
            }
        }
        return min;
    }

    private long countOfProductLessThanEqNum(long num, int nums1[], int nums2[]) {
        long countOfProductLessThanEqNum = 0;
        int m = nums2.length;
        for (long num1 : nums1) {
            if (num1 < 0) {
                // Since num1 is -ve, its product with all nums2 will be in descresing order.
                // Pivote is the index where product of num1 and num2 is small or eq to num.
                int left = 0;
                int right = m - 1;
                int pivot = 0;
                while (left <= right) {
                    int mid = (left + right) / 2;
                    long product = num1 * nums2[mid];
                    if (product <= num) {
                        /**
                         * eg num1 = -2, num = -5
                         * nums2 = {-3,2,3}
                         * for this the pivot is at 3 so number of products less than -5 is 1 only -6
                         * from (6,-4,-6)
                         */
                        pivot = m - mid;
                        right = mid - 1;
                    } else
                        left = mid + 1;
                }
                countOfProductLessThanEqNum += pivot;
            }
            else {
                int left = 0;
                int right = m - 1;
                int pivot = 0;
                while (left <= right) {
                    int mid = (left + right) / 2;
                    long product = num1 * nums2[mid];
                    if (product <= num) {
                        pivot = mid + 1;
                        left = mid + 1;
                    } else
                        right = mid - 1;
                }
                countOfProductLessThanEqNum += pivot;
            }
        }
        return countOfProductLessThanEqNum;
    }
}
```
['Java']