Ana has a sweets shop. There is a great festival at her village next weekend. She needs to be prepared to make a good business that day.
She has prepared N sweets which can be of at most 32 different types. On the festival day she finds K customer at her shop. She wants to sell all her sweets but the customer won’t take the same type of sweet more than 2 pieces.
The first line contains an integer T, denoting the number of test cases. The first line of each test case contains an integer N denoting number of sweets. The second lines contains N space separated integer, the ith integer denoting the type of the ith sweet. The third line contains an integer K denoting number of customer.
Print 1 if she can sell all her sweets else 0.
Types of sweet will always be in the range [1,32]
1 1 2 5 1
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.