10941094 SUSTech Online Judge
Problem 1094 --Index Quadruple

1094: Index Quadruple

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 239  Solved: 30
[Submit][Status][Web Board]

Description

Do you remember Index Twin? This time, Cuperman defines (i, j, k, l) as index quadruple if A[i]+A[j]+A[k] + A[l]= m. Given a unsorted array A and specific target m, could you help Aseer to determine whether there is an index quadruple in the array A with specific target m?

Input

The first line contains an integer T(0<T<=10), which is the number of test cases.

For each case contain two lines. The first line contains two numbers n(1<=n<=1000) and m(1<=m<=10^9), n is the size of array A. is the specified target.

The second line contains n integers: a1, a2, ... an (1<=ai <= 10^9 , 1 <= i <= n).

Output

For each case prints Y or N

Sample Input

1
4 4
1 1 1 1

Sample Output

Y

HINT

Median Problem

Source

[Submit][Status]