Treasure cave
题号:NC214492
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

    Xiao Qian really likes money. One day, He saw many coins in a cave. He immediately ran in. The bad thing is that the front door of the cave closed suddenly. Fortunately there was a paper in the cave that said 
    "Welcome to Treasure cave! As you can see, there are n piles of coins in the air and a pile of coins on the ground. The ith pile on the air has acoins. The pile on the ground has x coins. Now, there is a magic that you can choose a pile on the air and swap the pile with the ground pile. You can use this magic any times. The back door opens when the piles of coins on the air are strictly increased(it is considered strictly increased when a1<a2<a3<...<an holds). You can take the ground pile out when the back door is open. Good Luck!" 
    Now you task is whether can Xian Qian get out of the cave. If he can, what is the maximum coins can Xiao Qian take out, else just output 0.

输入描述:

The first line contains one integer t(1<=t<=20)——the number of test cases.
Each test case consists of two lines.
The first line contains two integers n and x(1<=n<=105,1<=x<=109)——the number of piles on the air and the numer of coins on the ground. 
The second line contains n integers a1, a2, a3, ... , an(1<=ai<=109).

输出描述:

For each test case, print one line consists of one integer.
示例1

输入

复制
2
3 4
1 5 2
3 4
1 4 4

输出

复制
5
0

说明

In the first test case.
At first swap x and a3. Then x=2, a={1,5,4}.
Second swap x and a2. Then x=5,a={1,2,4}.
So the answer is 5.
In the second test case, Xiao Qian can not get out in any way.