Raju always like to collect coins. Raju has already managed to collect n different types of coins a1,a2....an . One day he went into the sale and find out that the sale consists of 109 types of coins where i-th type of coin costs i dollars. He decided to buy some more different types of coins given that he does not have that type of coin already. But he has only k dollars to spend.
So help him to choose the type of coins.
The first line will contain test cases T. Then T Test cases follow. Each of the test cases will contain two integers n, k the number of types of coins that Raju already has and the money he has respectively. The next line contains n distinct integers a1,a2...an the types of coins that Raju already has.
Print a single integer denoting the number of different types of coins that Raju can buy so that the number of different coins in his collection is maximum. Cost should not exceed k.
4 6 12 8
1 3 4
For the second test case Raju should buy two coins: one coin of the 2-nd type and one coin of the 5-th type. For any other purchase for 7 dollars(assuming that the coins of types 1, 3 and 4 have already been bought), it is impossible to buy more than two coins.
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.