#K95697. Product Pair Existence

    ID: 38921 Type: Default 1000ms 256MiB

Product Pair Existence

Product Pair Existence

You are given an integer \( k \) and an array of \( n \) integers. Your task is to determine whether there exists a pair of distinct elements in the array whose product is exactly \( k \). Each element is considered only once for the purpose of forming the pair.

Note: Even if an element appears more than once in the array, you must choose two different indices. If \( k \) is zero, note that the pair \( (0,0) \) is not considered valid in this problem according to the problem constraints.

The input consists of multiple test cases.

inputFormat

The first line of input contains a single integer \( t \), the number of test cases.

For each test case, the first line contains two space-separated integers \( n \) and \( k \), where \( n \) is the number of elements in the array and \( k \) is the target product.

The second line contains \( n \) space-separated integers representing the array elements.

outputFormat

For each test case, output a single line containing YES if there exists at least one pair of distinct elements whose product equals \( k \), otherwise output NO.

## sample
3
4 15
1 2 3 5
5 9
7 1 3 4 2
6 6
2 3 1 6 9 4
YES

NO YES

</p>