#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
int t;
cin>>t;
while(t--){
int n, x;
cin>>n>>x;
int ans = 0, prev = 0;
for(int i=0;i<n;i++){
int a;
cin>>a;
ans=max(ans, a-prev);
prev=a;
}
ans= max(ans, 2*(x-prev));
cout<<ans<<endl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nIGludAoKaW50IG1haW4oKSB7CglpbnQgdDsKCWNpbj4+dDsKCXdoaWxlKHQtLSl7CgkJaW50IG4sIHg7CgkJY2luPj5uPj54OwoJCWludCBhbnMgPSAwLCBwcmV2ID0gMDsKCQlmb3IoaW50IGk9MDtpPG47aSsrKXsKCQkJaW50IGE7CgkJCWNpbj4+YTsKCQkJYW5zPW1heChhbnMsIGEtcHJldik7CgkJCXByZXY9YTsKCQl9CgkJYW5zPSBtYXgoYW5zLCAyKih4LXByZXYpKTsKCQljb3V0PDxhbnM8PGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==