#include <bits/stdc++.h>
#define cc continue
#define eb emplace_back
#define bb break
#define time_to_forget cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n"
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
int main()
{
    double a,b,c,d,m,k;
    ll t,n;
    cin>>t;
    while(t--){
      ll l;
      cin>>n>>l;
      double tt1[n+2];
      double tt2[n+2];
      double v1[n+2];
      double v2[n+2];
      double f[n+2];
      f[0]=0.0;
      f[n+1]=l*1.0;
      tt1[0]=tt2[n+1]=0.0;
      v1[0]=v2[n+1]=1.0;
      for(int i=1;i<=n;i++){
	cin>>f[i];
      }
      for(int i=0;i<n;i++){
	tt1[i+1]=tt1[i]+(f[i+1]-f[i])/v1[i];
	v1[i+1]=v1[i]+1.0;
      }
      for(int i=n+1;i>0;i--){
	tt2[i-1]=tt2[i]+(f[i]-f[i-1])/v2[i];
	v2[i-1]=v2[i]+1.0;
      }
      double res=0;
      for(int i=0;i<=n;i++){
	if(tt1[i]<=tt2[i+1]){
	  double pp=(tt2[i+1]-tt1[i]);
	double dis=(pp*v1[i]);
	double aux=(f[i+1]-(dis+f[i]));
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt2[i+1]<<endl;*/
	if(double(ans)<double(0.0000000))cc;
	res=tt2[i+1]+ans;
	bb;
	/*if(double(ans+tt1[i]+pp)==double(ans+tt2[i+1])){
	  res=tt2[i+1]+ans;
	  bb;
	  }*/
	}
	else{
	double pp=(tt1[i]-tt2[i+1]);
	double dis=(pp*v2[i+1]);
	double aux=(f[i+1]-dis-f[i]);
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt1[i]<<endl;*/
	if(double(ans)<double(0.0000000))cc;
	res=tt1[i]+ans;
	bb;
	/*if(double(ans+tt1[i])==double(ans+tt2[i+1]+pp)){
	  res=tt1[i]+ans;
	  bb;
	  }*/
	}
      }
     cout<<fixed<<setprecision(11)<<res<<endl;
    }
    time_to_forget;
  return 0;
}


#include <bits/stdc++.h>
#define cc continue
#define eb emplace_back
#define bb break
#define time_to_forget cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n"
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie();
    double a,b,c,d,m,k;
    ll t,n;
    cin>>t;
    while(t--){
      ll l;
      cin>>n>>l;
      double tt1[n+2];
      double tt2[n+2];
      double v1[n+2];
      double v2[n+2];
      double f[n+2];
      f[0]=0;
      f[n+1]=l;
      tt1[0]=tt2[n+1]=0;
      v1[0]=v2[n+1]=1;
      for(int i=1;i<=n;i++){
	cin>>f[i];
      }
      for(int i=0;i<n;i++){
	tt1[i+1]=tt1[i]+(f[i+1]-f[i])/v1[i];
	v1[i+1]=v1[i]+1;
      }
      for(int i=n+1;i>0;i--){
	tt2[i-1]=tt2[i]+(f[i]-f[i-1])/v2[i];
	v2[i-1]=v2[i]+1;
      }
      double res=0;
      for(int i=0;i<=n;i++){
	if(tt1[i]<tt2[i+1]){
	  double pp=(tt2[i+1]-tt1[i]);
	double dis=(pp*v1[i]);
	double aux=(f[i+1]-(dis+f[i]));
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt2[i+1]<<endl;*/
	if(double(ans)<(0.0))cc;
	res=tt2[i+1]+ans;
	bb;
	/*if(double(ans+tt1[i]+pp)==double(ans+tt2[i+1])){
	  res=tt2[i+1]+ans;
	  bb;
	  }*/
	}
	else{
	double pp=(tt1[i]-tt2[i+1]);
	double dis=(pp*v2[i+1]);
	double aux=(f[i+1]-dis-f[i]);
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt1[i]<<endl;*/
	if(double(ans)<(0.0))cc;
	res=tt1[i]+ans;
	bb;
	/*if(double(ans+tt1[i])==double(ans+tt2[i+1]+pp)){
	  res=tt1[i]+ans;
	  bb;
	  }*/
	}
      }
     cout<<fixed<<setprecision(11)<<res<<endl;
    }
    time_to_forget;
  return 0;
}


#include <bits/stdc++.h>
#define cc continue
#define eb emplace_back
#define bb break
#define time_to_forget cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n"
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
int main()
{
    double a,b,c,d,m,k;
    ll t,n;
    cin>>t;
    while(t--){
      ll l;
      cin>>n>>l;
      double tt1[n+2];
      double tt2[n+2];
      double v1[n+2];
      double v2[n+2];
      double f[n+2];
      f[0]=0.0;
      f[n+1]=l*1.0;
      tt1[0]=tt2[n+1]=0.0;
      v1[0]=v2[n+1]=1.0;
      for(int i=1;i<=n;i++){
	cin>>f[i];
      }
      for(int i=0;i<n;i++){
	tt1[i+1]=tt1[i]+(f[i+1]-f[i])/v1[i];
	v1[i+1]=v1[i]+1.0;
      }
      for(int i=n+1;i>0;i--){
	tt2[i-1]=tt2[i]+(f[i]-f[i-1])/v2[i];
	v2[i-1]=v2[i]+1.0;
      }
      double res=0;
      for(int i=0;i<=n;i++){
	if(tt1[i]<=tt2[i+1]){
	  double pp=(tt2[i+1]-tt1[i]);
	double dis=(pp*v1[i]);
	double aux=(f[i+1]-(dis+f[i]));
	double ans=aux/(v1[i]+v2[i+1]);
	if(double(ans)<=double(-0.000000000001))cc;
	res=tt2[i+1]+ans;
	bb;
	}
	else{
	double pp=(tt1[i]-tt2[i+1]);
	double dis=(pp*v2[i+1]);
	double aux=(f[i+1]-dis-f[i]);
	double ans=aux/(v1[i]+v2[i+1]);
	if(double(ans)<double(-0.0000000000001))cc;
	res=tt1[i]+ans;
	bb;
	}
      }
     cout<<fixed<<setprecision(11)<<res<<endl;
    }
    time_to_forget;
  return 0;
}


#include <bits/stdc++.h>
#define cc continue
#define eb emplace_back
#define bb break
#define time_to_forget cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n"
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie();
    double a,b,c,d,m,k;
    ll t,n;
    cin>>t;
    while(t--){
      ll l;
      cin>>n>>l;
      double tt1[n+2];
      double tt2[n+2];
      double v1[n+2];
      double v2[n+2];
      double f[n+2];
      f[0]=0;
      f[n+1]=l;
      tt1[0]=tt2[n+1]=0;
      v1[0]=v2[n+1]=1;
      for(int i=1;i<=n;i++){
	cin>>f[i];
      }
      for(int i=0;i<n;i++){
	tt1[i+1]=tt1[i]+(f[i+1]-f[i])/v1[i];
	v1[i+1]=v1[i]+1;
      }
      for(int i=n+1;i>0;i--){
	tt2[i-1]=tt2[i]+(f[i]-f[i-1])/v2[i];
	v2[i-1]=v2[i]+1;
      }
      double res=0;
      for(int i=0;i<=n;i++){
	if(tt1[i]<tt2[i+1]){
	  double pp=(tt2[i+1]-tt1[i]);
	double dis=(pp*v1[i]);
	double aux=(f[i+1]-(dis+f[i]));
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt2[i+1]<<endl;*/
	if(ans<double(0.0000000))cc;
	res=tt2[i+1]+ans;
	bb;
	/*if(double(ans+tt1[i]+pp)==double(ans+tt2[i+1])){
	  res=tt2[i+1]+ans;
	  bb;
	  }*/
	}
	else{
	double pp=(tt1[i]-tt2[i+1]);
	double dis=(pp*v2[i+1]);
	double aux=(f[i+1]-dis-f[i]);
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt1[i]<<endl;*/
	if(ans<double(0.0000000))cc;
	res=tt1[i]+ans;
	bb;
	/*if(double(ans+tt1[i])==double(ans+tt2[i+1]+pp)){
	  res=tt1[i]+ans;
	  bb;
	  }*/
	}
      }
     cout<<fixed<<setprecision(11)<<res<<endl;
    }
    time_to_forget;
  return 0;
}


#include <bits/stdc++.h>
#define cc continue
#define eb emplace_back
#define bb break
#define time_to_forget cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n"
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie();
    double a,b,c,d,m,k;
    ll t,n;
    cin>>t;
    while(t--){
      ll l;
      cin>>n>>l;
      double tt1[n+2];
      double tt2[n+2];
      double v1[n+2];
      double v2[n+2];
      double f[n+2];
      f[0]=0.0;
      f[n+1]=l*1.0;
      tt1[0]=tt2[n+1]=0.0;
      v1[0]=v2[n+1]=1.0;
      for(int i=1;i<=n;i++){
	cin>>f[i];
      }
      for(int i=0;i<n;i++){
	tt1[i+1]=tt1[i]+(f[i+1]-f[i])/v1[i];
	v1[i+1]=v1[i]+1.0;
      }
      for(int i=n+1;i>0;i--){
	tt2[i-1]=tt2[i]+(f[i]-f[i-1])/v2[i];
	v2[i-1]=v2[i]+1.0;
      }
      double res=0;
      for(int i=0;i<=n;i++){
	if(tt1[i]<tt2[i+1]){
	  double pp=(tt2[i+1]-tt1[i]);
	double dis=(pp*v1[i]);
	double aux=(f[i+1]-(dis+f[i]));
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt2[i+1]<<endl;*/
	if(ans<double(0.0000000))cc;
	res=tt2[i+1]+ans;
	bb;
	/*if(double(ans+tt1[i]+pp)==double(ans+tt2[i+1])){
	  res=tt2[i+1]+ans;
	  bb;
	  }*/
	}
	else{
	double pp=(tt1[i]-tt2[i+1]);
	double dis=(pp*v2[i+1]);
	double aux=(f[i+1]-dis-f[i]);
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt1[i]<<endl;*/
	if(ans<double(0.0000000))cc;
	res=tt1[i]+ans;
	bb;
	/*if(double(ans+tt1[i])==double(ans+tt2[i+1]+pp)){
	  res=tt1[i]+ans;
	  bb;
	  }*/
	}
      }
     cout<<fixed<<setprecision(11)<<res<<endl;
    }
    time_to_forget;
  return 0;
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define ff first
#define sc second
#define INF 3000000000
#define SINF 2*(1e18)
#define inf -10000000
#define pb push_back
#define mpk make_pair
#define upb(a,s) upper_bound(a.begin(),a.end(),s)
#define lwb(a,s) lower_bound(a.begin(),a.end(),s)
#define mem(a,val) memset(a,val,sizeof a)
#define cc continue
#define eb emplace_back
#define bb break
#define mostbit(n) 32-__builtin_clz(n)-1
#define time_to_forget cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n"
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
//typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> order_set;
int x[]={0,1,0,-1};
int y[]={1,0,-1,0};
//priority_queue<ll> pq;
ll gcd(ll a,ll b){
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll fastpow(ll a,ll b){
    if(b==0)return 1ll;
    if(b==1)return a;
    ll sw;
    if(b%2==1)sw=a;
    else sw=1;
    ll h=fastpow(a,b/2);
    return h*h*sw;
}
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie();
    double a,b,c,d,m,k;
    ll t,n;
    cin>>t;
    while(t--){
      ll l;
      cin>>n>>l;
      double tt1[n+2];
      double tt2[n+2];
      double v1[n+2];
      double v2[n+2];
      double f[n+2];
      f[0]=0;
      f[n+1]=l;
      tt1[0]=tt2[n+1]=0;
      v1[0]=v2[n+1]=1;
      for(int i=1;i<=n;i++){
	cin>>f[i];
      }
      for(int i=0;i<n;i++){
	tt1[i+1]=tt1[i]+(f[i+1]-f[i])/v1[i];
	v1[i+1]=v1[i]+1;
      }
      for(int i=n+1;i>0;i--){
	tt2[i-1]=tt2[i]+(f[i]-f[i-1])/v2[i];
	v2[i-1]=v2[i]+1;
      }/*
      for(int i=1;i<=n;i++){
	cout<<tt1[i]<<" "<<v1[i]<<endl;
      }
      cout<<endl;
      for(int i=1;i<=n;i++){
	cout<<tt2[i]<<" "<<v2[i]<<endl;
      }*/
      double res=0;
      for(int i=0;i<=n;i++){
	if(tt1[i]<tt2[i+1]){
	  double pp=(tt2[i+1]-tt1[i]);
	double dis=(pp*v1[i]);
	double aux=(f[i+1]-(dis+f[i]));
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt2[i+1]<<endl;*/
	if(ans<0)cc;
	if(ans+tt1[i]+pp==ans+tt2[i+1] and tt2[i]>=ans+tt1[i]+pp){
	  res=tt2[i+1]+ans;
	  bb;
	}
	}
	else{
	double pp=(tt1[i]-tt2[i+1]);
	double dis=(pp*v2[i+1]);
	double aux=(f[i+1]-dis-f[i]);
	double ans=aux/(v1[i]+v2[i+1]);/*
	cout<<i<<" -- "<<endl;
	cout<<pp<<" "<<dis<<endl;
	cout<<tt1[i]<<" "<<tt2[i+1]<<endl;
	cout<<v1[i]<<" "<<v2[i+1]<<endl;
	cout<<ans+tt1[i]<<endl;*/
	if(ans<0)cc;
	if(ans+tt1[i]==ans+tt2[i+1]+pp and tt1[i]<=ans+tt2[i+1]+pp){
	  res=tt1[i]+ans;
	  bb;
	}
	}
      }
     cout<<fixed<<setprecision(11)<<res<<endl;
    }
    time_to_forget;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _ % MOD
#define __ %= MOD

#define each(it, s) for (auto it = s.begin(); it != s.end(); ++it)
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.begin(), v.end(), greater<auto>())
#define fill(a) memset(a, 0, sizeof(a))

#define swap(a, b) \
	{              \
		a = a + b; \
		b = a - b; \
		a = a - b; \
	}
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) << endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

#define pv(a)                                 \
	{                                         \
		rep(i, a.size()) cout << a[i] << " "; \
		cout << endl;                         \
	}
#define mark(v) cout << "Here--" << v << endl;

const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	ll res = 1;
	while (y > 0)
	{
		if (y & 1)
			res = res * x;
		y = y >> 1;
		x = x * x;
	}
	return res;
} // modular exponent

int main()
{
	ios_base::sync_with_stdio(false); // don't use printf and scanf
	cin.tie(NULL);					  // cout<<fixed<<setprecision
	int t;
	cin >> t;
	while (t--)
	{
		double n, d;
		cin >> n >> d;
		vector<double> flags(n);
		rep(i, n)
		{
			cin >> flags[i];
		}
		double pos1 = 0;
		double pos2 = d;
		double tm = 0;
		double v1 = 1;
		double v2 = 1;
		int i = 0;
		int j = n - 1;
		while (i <= j)
		{
			double t1 = ((flags[i] - pos1) * 1.0) / v1;
			double t2 = ((pos2 - flags[j]) * 1.0) / v2;
			double t3 = ((pos2 - pos1) / (v1 + v2));
			if (t3 < min(t1, t2))
			{
				tm += t3;
				pos2 = 0;
				pos1 = 0;
				break;
			}
			//cout << t1 << " t1 , t2 " << t2 << endl;
			tm += min(t1, t2);
			if (dcmp(t1, t2) == 1)
			{
				//mark(1);
				j--;
				pos1 += min(t1, t2) * v1;
				pos2 = flags[j + 1];
				v2++;
			}
			else if (dcmp(t1, t2) == -1)
			{
				//mark(2);
				i++;
				pos1 = flags[i - 1];
				pos2 -= min(t1, t2) * 1.0 * v2;
				v1++;
			}
			else if (dcmp(t1, t2) == 0)
			{
				//mark(3);
				j--;
				i++;
				pos1 = flags[i - 1];
				pos2 = flags[j + 1];
				v1++;
				v2++;
			}
			//cout << tm << " <-- Time " << pos1 << " " << v1 << " ----" << pos2 << " " << v2 << endl;
		}
		if (pos2 > pos1)
		{
			tm += ((pos2 - pos1) * 1.0) / (v1 + v2);
		}
		cout << fixed << std::setprecision(15) << tm << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _ % MOD
#define __ %= MOD

#define each(it, s) for (auto it = s.begin(); it != s.end(); ++it)
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.begin(), v.end(), greater<auto>())
#define fill(a) memset(a, 0, sizeof(a))

#define swap(a, b) \
	{              \
		a = a + b; \
		b = a - b; \
		a = a - b; \
	}
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) << endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

#define pv(a)                                 \
	{                                         \
		rep(i, a.size()) cout << a[i] << " "; \
		cout << endl;                         \
	}
#define mark(v) cout << "Here--" << v << endl;

const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	ll res = 1;
	while (y > 0)
	{
		if (y & 1)
			res = res * x;
		y = y >> 1;
		x = x * x;
	}
	return res;
} // modular exponent

int main()
{
	ios_base::sync_with_stdio(false); // don't use printf and scanf
	cin.tie(NULL);					  // cout<<fixed<<setprecision
	int t;
	cin >> t;
	while (t--)
	{
		double n, d;
		cin >> n >> d;
		vector<double> flags(n);
		rep(i, n)
		{
			cin >> flags[i];
		}
		double pos1 = 0;
		double pos2 = d;
		double tm = 0;
		double v1 = 1;
		double v2 = 1;
		int i = 0;
		int j = n - 1;
		while (i <= j)
		{
			double t1 = ((flags[i] - pos1) * 1.0) / v1;
			double t2 = ((pos2 - flags[j]) * 1.0) / v2;
			double t3 = ((pos2 - pos1) / (v1 + v2));
			if (t3 < min(t1, t2))
			{
				tm += t3;
				pos2 = 0;
				pos1 = 0;
				break;
			}
			//cout << t1 << " t1 , t2 " << t2 << endl;
			tm += min(t1, t2);
			if (dcmp(t1, t2) == 1)
			{
				//mark(1);
				j--;
				pos1 += min(t1, t2) * v1;
				pos2 = flags[j + 1];
				v2++;
			}
			else if (dcmp(t1, t2) == -1)
			{
				//mark(2);
				i++;
				pos1 = flags[i - 1];
				pos2 -= min(t1, t2) * 1.0 * v2;
				v1++;
			}
			else if (dcmp(t1, t2) == 0)
			{
				//mark(3);
				j--;
				i++;
				pos1 = flags[i - 1];
				pos2 = flags[j + 1];
				v1++;
				v2++;
			}
			//cout << tm << " <-- Time " << pos1 << " " << v1 << " ----" << pos2 << " " << v2 << endl;
		}
		tm += ((pos2 - pos1) * 1.0) / (v1 + v2);
		cout << fixed << std::setprecision(15) << tm << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _ % MOD
#define __ %= MOD

#define each(it, s) for (auto it = s.begin(); it != s.end(); ++it)
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.begin(), v.end(), greater<auto>())
#define fill(a) memset(a, 0, sizeof(a))

#define swap(a, b) \
	{              \
		a = a + b; \
		b = a - b; \
		a = a - b; \
	}
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) << endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

#define pv(a)                                 \
	{                                         \
		rep(i, a.size()) cout << a[i] << " "; \
		cout << endl;                         \
	}
#define mark(v) cout << "Here--" << v << endl;

const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	ll res = 1;
	while (y > 0)
	{
		if (y & 1)
			res = res * x;
		y = y >> 1;
		x = x * x;
	}
	return res;
} // modular exponent

int main()
{
	ios_base::sync_with_stdio(false); // don't use printf and scanf
	cin.tie(NULL);					  // cout<<fixed<<setprecision
	int t;
	cin >> t;
	while (t--)
	{
		double n, d;
		cin >> n >> d;
		vector<double> flags(n);
		rep(i, n)
		{
			cin >> flags[i];
		}
		double pos1 = 0;
		double pos2 = d;
		double tm = 0;
		double v1 = 1;
		double v2 = 1;
		int i = 0;
		int j = n - 1;
		while (i <= j)
		{
			double t1 = ((flags[i] - pos1) * 1.0) / v1;
			double t2 = ((pos2 - flags[j]) * 1.0) / v2;
			//cout << t1 << " t1 , t2 " << t2 << endl;
			tm += min(t1, t2);
			if (dcmp(t1, t2) == 1)
			{
				//mark(1);
				j--;
				pos1 += min(t1, t2) * v1;
				pos2 = flags[j + 1];
				v2++;
			}
			else if (dcmp(t1, t2) == -1)
			{
				//mark(2);
				i++;
				pos1 = flags[i - 1];
				pos2 -= min(t1, t2) * 1.0 * v2;
				v1++;
			}
			else if (dcmp(t1, t2) == 0)
			{
				//mark(3);
				j--;
				i++;
				pos1 = flags[i - 1];
				pos2 = flags[j + 1];
				v1++;
				v2++;
			}
			//cout << tm << " <-- Time " << pos1 << " " << v1 << " ----" << pos2 << " " << v2 << endl;
		}
		tm += ((pos2 - pos1) * 1.0) / (v1 + v2);
		cout << fixed << std::setprecision(15) << tm << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _ % MOD
#define __ %= MOD

#define each(it, s) for (auto it = s.begin(); it != s.end(); ++it)
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.begin(), v.end(), greater<auto>())
#define fill(a) memset(a, 0, sizeof(a))

#define swap(a, b) \
	{              \
		a = a + b; \
		b = a - b; \
		a = a - b; \
	}
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) << endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

#define pv(a)                                 \
	{                                         \
		rep(i, a.size()) cout << a[i] << " "; \
		cout << endl;                         \
	}
#define mark(v) cout << "Here--" << v << endl;

const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	ll res = 1;
	while (y > 0)
	{
		if (y & 1)
			res = res * x;
		y = y >> 1;
		x = x * x;
	}
	return res;
} // modular exponent

int main()
{
	ios_base::sync_with_stdio(false); // don't use printf and scanf
	cin.tie(NULL);					  // cout<<fixed<<setprecision
	int t;
	cin >> t;
	while (t--)
	{
		double n, d;
		cin >> n >> d;
		vector<double> flags(n);
		rep(i, n)
		{
			cin >> flags[i];
		}
		double pos1 = 0;
		double pos2 = d;
		double tm = 0;
		double v1 = 1;
		double v2 = 1;
		int i = 0;
		int j = n - 1;
		while (i <= j)
		{
			double t1 = ((flags[i] - pos1) * 1.0) / v1;
			double t2 = ((pos2 - flags[j]) * 1.0) / v2;
			//cout << t1 << " t1 , t2 " << t2 << endl;
			tm += min(t1, t2);
			if (dcmp(t1, t2) == 1)
			{
				//mark(1);
				j--;
				pos1 += min(t1, t2) * v1;
				pos2 = flags[j + 1];
				v2++;
			}
			else if (dcmp(t1, t2) == -1)
			{
				//mark(2);
				i++;
				pos1 = flags[i - 1];
				pos2 -= min(t1, t2) * 1.0 * v2;
				v1++;
			}
			else if (dcmp(t1, t2) == 0)
			{
				//mark(3);
				j--;
				i++;
				pos1 = flags[i - 1];
				pos2 = flags[j + 1];
				v1++;
				v2++;
			}
			//cout << tm << " <-- Time " << pos1 << " " << v1 << " ----" << pos2 << " " << v2 << endl;
		}
		tm += ((pos2 - pos1) * 1.0) / (v1 + v2);
		cout << std::setprecision(6) << tm << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _ % MOD
#define __ %= MOD

#define each(it, s) for (auto it = s.begin(); it != s.end(); ++it)
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.begin(), v.end(), greater<auto>())
#define fill(a) memset(a, 0, sizeof(a))

#define swap(a, b) \
	{              \
		a = a + b; \
		b = a - b; \
		a = a - b; \
	}
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) << endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

#define pv(a)                                 \
	{                                         \
		rep(i, a.size()) cout << a[i] << " "; \
		cout << endl;                         \
	}
#define mark(v) cout << "Here--" << v << endl;

const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	ll res = 1;
	while (y > 0)
	{
		if (y & 1)
			res = res * x;
		y = y >> 1;
		x = x * x;
	}
	return res;
} // modular exponent

int main()
{
	ios_base::sync_with_stdio(false); // don't use printf and scanf
	cin.tie(NULL);					  // cout<<fixed<<setprecision
	int t;
	cin >> t;
	while (t--)
	{
		ll n, k;
		cin >> n >> k;
		vector<double> a(n + 2);
		a[0] = 0;
		a[n + 1] = k;
		repA(i, 1, n)
		{
			cin >> a[i];
		}
		vector<double> v1times(n + 2, 0);
		vector<double> v2times(n + 2, 0);
		v1times[1] = ((a[1] * 1.0) / 1.0);
		v2times[n] = (((k - a[n]) * 1.0) / 1.0);
		ll v1 = 2;
		ll v2 = 2;
		repA(i, 2, n + 1)
		{
			double t1 = ((a[i] - a[i - 1]) / v1++);
			v1times[i] = v1times[i - 1] + t1;
		}
		repD(i, n - 1, 0)
		{
			double t1 = ((a[i + 1] - a[i]) / v2++);
			v2times[i] = v2times[i + 1] + t1;
		}
		int i = 0;
		while (i <= n + 1)
		{
			if (v1times[i] < v2times[i])
			{
				i++;
			}
			else
			{
				break;
			}
		}
		//pv(v1times);
		//pv(v2times);
		v1 = i;
		v2 = n + 1 - i + 1;
		//cout << v1 << " " << v2 << endl;
		double pos1 = a[i - 1] + v1 * (v2times[i] - v1times[i - 1]);
		double pos2 = a[i];
		double t2 = (pos2 - pos1) / (v1 + v2);
		double ans = v2times[i] + t2;
		cout << fixed << setprecision(15) << ans << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _ % MOD
#define __ %= MOD

#define each(it, s) for (auto it = s.begin(); it != s.end(); ++it)
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.begin(), v.end(), greater<auto>())
#define fill(a) memset(a, 0, sizeof(a))

#define swap(a, b) \
	{              \
		a = a + b; \
		b = a - b; \
		a = a - b; \
	}
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) << endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

#define pv(a)                                 \
	{                                         \
		rep(i, a.size()) cout << a[i] << " "; \
		cout << endl;                         \
	}
#define mark(v) cout << "Here--" << v << endl;

const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	ll res = 1;
	while (y > 0)
	{
		if (y & 1)
			res = res * x;
		y = y >> 1;
		x = x * x;
	}
	return res;
} // modular exponent

int main()
{
	ios_base::sync_with_stdio(false); // don't use printf and scanf
	cin.tie(NULL);					  // cout<<fixed<<setprecision
	int t;
	cin >> t;
	while (t--)
	{
		double n, d;
		cin >> n >> d;
		vector<double> flags(n);
		rep(i, n)
		{
			cin >> flags[i];
		}
		double pos1 = 0;
		double pos2 = d;
		double tm = 0;
		double v1 = 1;
		double v2 = 1;
		int i = 0;
		int j = n - 1;
		while (i <= j)
		{
			double t1 = ((flags[i] - pos1) * 1.0) / v1;
			double t2 = ((pos2 - flags[j]) * 1.0) / v2;
			//cout << t1 << " t1 , t2 " << t2 << endl;
			tm += min(t1, t2);
			if (dcmp(t1, t2) == 1)
			{
				//mark(1);
				j--;
				pos1 += min(t1, t2) * v1;
				pos2 = flags[j + 1];
				v2++;
			}
			else if (dcmp(t1, t2) == -1)
			{
				//mark(2);
				i++;
				pos1 = flags[i - 1];
				pos2 -= min(t1, t2) * 1.0 * v2;
				v1++;
			}
			else if (dcmp(t1, t2) == 0)
			{
				//mark(3);
				j--;
				i++;
				pos1 = flags[i - 1];
				pos2 = flags[j + 1];
				v1++;
				v2++;
			}
			//cout << tm << " <-- Time " << pos1 << " " << v1 << " ----" << pos2 << " " << v2 << endl;
		}
		tm += ((pos2 - pos1) * 1.0) / (v1 + v2);
		cout << fixed << std::setprecision(6) << tm << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _ % MOD
#define __ %= MOD

#define each(it, s) for (auto it = s.begin(); it != s.end(); ++it)
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.begin(), v.end(), greater<auto>())
#define fill(a) memset(a, 0, sizeof(a))

#define swap(a, b) \
	{              \
		a = a + b; \
		b = a - b; \
		a = a - b; \
	}
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) << endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

#define pv(a)                                 \
	{                                         \
		rep(i, a.size()) cout << a[i] << " "; \
		cout << endl;                         \
	}
#define mark(v) cout << "Here--" << v << endl;

const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	ll res = 1;
	while (y > 0)
	{
		if (y & 1)
			res = res * x;
		y = y >> 1;
		x = x * x;
	}
	return res;
} // modular exponent

int main()
{
	ios_base::sync_with_stdio(false); // don't use printf and scanf
	cin.tie(NULL);					  // cout<<fixed<<setprecision
	int t;
	cin >> t;
	while (t--)
	{
		double n, d;
		cin >> n >> d;
		vector<double> flags(n);
		rep(i, n)
		{
			cin >> flags[i];
		}
		double pos1 = 0;
		double pos2 = d;
		double tm = 0;
		double v1 = 1;
		double v2 = 1;
		int i = 0;
		int j = n - 1;
		while (i <= j)
		{
			double t1 = ((flags[i] - pos1) * 1.0) / v1;
			double t2 = ((pos2 - flags[j]) * 1.0) / v2;
			//cout << t1 << " t1 , t2 " << t2 << endl;
			tm += min(t1, t2);
			if (dcmp(t1, t2) == 1)
			{
				//mark(1);
				j--;
				pos1 += min(t1, t2) * v1;
				pos2 = flags[j + 1];
				v2++;
			}
			else if (dcmp(t1, t2) == -1)
			{
				//mark(2);
				i++;
				pos1 = flags[i - 1];
				pos2 -= min(t1, t2) * 1.0 * v2;
				v1++;
			}
			else if (dcmp(t1, t2) == 0)
			{
				//mark(3);
				j--;
				i++;
				pos1 = flags[i - 1];
				pos2 = flags[j + 1];
				v1++;
				v2++;
			}
			//cout << tm << " <-- Time " << pos1 << " " << v1 << " ----" << pos2 << " " << v2 << endl;
		}
		tm += ((pos2 - pos1) * 1.0) / (v1 + v2);
		cout << std::setprecision(15) << tm << endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
int ar[100009] ;
int main()
{
    int t ; cin>>t ;
    while(t--)
    {
        int n,l,ct=0 ; cin>>n>>l ;
        for(int i = 1 ; i <= n ; i++) cin>>ar[i] ;
        double lo=0,hi=l,ans ;
        while(ct!=100)
        {
            double md=(lo+hi)/2.0 ;
            double cr=0 , tot=md , in=1 ;
            for(int i = 1 ; i <= n ; i++)
            {
                double x=ar[i] ;
                double d=x-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr+=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(tot>0.0 && cr!=l)
            {
                double d=l-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=l ; in++ ;}
                else
                {
                    cr+=(tot*in) ;
                }
            }
            double c1=cr ;
            cr=l , tot=md , in=1 ;
            for(int i = n ; i >= 1 ; i--)
            {
                double x=ar[i] ;
                double d=cr-x,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr-=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(cr!=0.0 && tot>0.0)
            {
                int d=cr , tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=0.0 ; }
                else cr-=(tot*in) ;
            }
            double c2=cr ;
            if(abs(c1-c2)<=0.00000000001) {ans=md ; break ;}
            if(c1<c2) lo=md+0.0000001 ;
            else hi=md-0.0000001 ;
            ct++ ;

        }
        printf("%.10f\n",ans) ;
    }
}


#include<bits/stdc++.h>
using namespace std;
double ar[100009] ;
int main()
{
    int t ; cin>>t ;
    while(t--)
    {
        int n,l,ct=0 ; cin>>n>>l ;
        l=(double)l ;
        for(int i = 1 ; i <= n ; i++) cin>>ar[i] ;
        double lo=0.0,hi=l*1.0,ans ;
        while(ct!=200)
        {
            double md=(lo+hi)/2.0 ;
            double cr=0 , tot=md , in=1.0 ;
            for(int i = 1 ; i <= n ; i++)
            {
                double x=ar[i] ;
                double d=x-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr+=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(tot>0.0 && cr!=l*1.0)
            {
                double d=l-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=l ; in++ ;}
                else
                {
                    cr+=(tot*in) ;
                }
            }
            double c1=cr ;
            cr=l , tot=md , in=1.0 ;
            for(int i = n ; i >= 1 ; i--)
            {
                double x=ar[i] ;
                double d=cr-x,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr-=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(cr!=0.0 && tot>0.0)
            {
                double d=cr , tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=0.0 ; }
                else cr-=(tot*in) ;
            }
            double c2=cr ;
            if(abs(c1-c2)<=0.000001) {ans=md ; break ; }
            if(c1<c2) lo=md ;
            else hi=md ;
            ct++ ;

        }
        printf("%.10f\n",ans) ;
    }
}
/*
1
1 1000000000
10000
*/


#include<bits/stdc++.h>
using namespace std;
double ar[100009] ;
int main()
{
    int t ; cin>>t ;
    while(t--)
    {
        int n,l,ct=0 ; cin>>n>>l ;
        l=(double)l ;
        for(int i = 1 ; i <= n ; i++) cin>>ar[i] ;
        double lo=0.0,hi=l*1.0,ans ;
        while(ct!=200)
        {
            double md=(lo+hi)/2.0 ;
            double cr=0 , tot=md , in=1.0 ;
            for(int i = 1 ; i <= n ; i++)
            {
                double x=ar[i] ;
                double d=x-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr+=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(tot>0.0 && cr!=l*1.0)
            {
                double d=l-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=l ; in++ ;}
                else
                {
                    cr+=(tot*in) ;
                }
            }
            double c1=cr ;
            cr=l , tot=md , in=1.0 ;
            for(int i = n ; i >= 1 ; i--)
            {
                double x=ar[i] ;
                double d=cr-x,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr-=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(cr!=0.0 && tot>0.0)
            {
                double d=cr , tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=0.0 ; }
                else cr-=(tot*in) ;
            }
            double c2=cr ;
            if(abs(c1-c2)<=0.000000001) {ans=md ; }
            if(c1<c2) lo=md+0.001 ;
            else hi=md-0.001 ;
            ct++ ;

        }
        printf("%.10f\n",ans) ;
    }
}
/*
1
1 1000000000
10000
*/


#include<bits/stdc++.h>
using namespace std;
int ar[100009] ;
int main()
{
    int t ; cin>>t ;
    while(t--)
    {
        int n,l,ct=0 ; cin>>n>>l ;
        for(int i = 1 ; i <= n ; i++) cin>>ar[i] ;
        double lo=0,hi=l,ans ;
        while(ct!=100)
        {
            double md=(lo+hi)/2.0 ;
            double cr=0 , tot=md , in=1 ;
            for(int i = 1 ; i <= n ; i++)
            {
                double x=ar[i] ;
                double d=x-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr+=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(tot>0.0 && cr!=l)
            {
                double d=l-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=l ; in++ ;}
                else
                {
                    cr+=(tot*in) ;
                }
            }
            double c1=cr ;
            cr=l , tot=md , in=1 ;
            for(int i = n ; i >= 1 ; i--)
            {
                double x=ar[i] ;
                double d=cr-x,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr-=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(cr!=0.0 && tot>0.0)
            {
                int d=cr , tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=0.0 ; }
                else cr-=(tot*in) ;
            }
            double c2=cr ;
            if(abs(c1-c2)<=0.00000000001) {ans=md ; break ;}
            if(c1<c2) lo=md+0.00000000001 ;
            else hi=md-0.00000000001 ;
            ct++ ;

        }
        printf("%.10f\n",ans) ;
    }
}


#include<bits/stdc++.h>
using namespace std;
int ar[100009] ;
int main()
{
    int t ; cin>>t ;
    while(t--)
    {
        int n,l,ct=0 ; cin>>n>>l ;
        for(int i = 1 ; i <= n ; i++) cin>>ar[i] ;
        double lo=0.0,hi=l*1.0,ans ;
        while(ct!=100)
        {
            //cout<<lo<<" "<<hi<<endl ;
            double md=(lo+hi)/2.0 ;
            double cr=0 , tot=md , in=1.0 ;
            for(int i = 1 ; i <= n ; i++)
            {
                double x=ar[i] ;
                double d=x-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr+=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(tot>0.0 && cr!=l*1.0)
            {
                double d=l-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=l ; in++ ;}
                else
                {
                    cr+=(tot*in) ;
                }
            }
            double c1=cr ;
            cr=l , tot=md , in=1.0 ;
            for(int i = n ; i >= 1 ; i--)
            {
                double x=ar[i] ;
                double d=cr-x,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr-=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(cr!=0.0 && tot>0.0)
            {
                double d=cr , tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=0.0 ; }
                else cr-=(tot*in) ;
            }
            double c2=cr ;
            if(abs(c1-c2)<=0.00000000001) {ans=md ; break ;}
            if(c1<c2) lo=md+0.00000000001 ;
            else hi=md-0.00000000001 ;
            ct++ ;

        }
        printf("%.10f\n",ans) ;
    }
}


#include<bits/stdc++.h>
using namespace std;
double ar[100009] ;
int main()
{
    int t ; cin>>t ;
    while(t--)
    {
        int n,l,ct=0 ; cin>>n>>l ;
        l=(double)l ;
        for(int i = 1 ; i <= n ; i++) cin>>ar[i] ;
        double lo=0.0,hi=l*1.0,ans ;
        while(ct!=200)
        {
           // printf("%0.10f %0.10f\n",lo,hi) ;
            double md=(lo+hi)/2.0 ;
            double cr=0 , tot=md , in=1.0 ;
            for(int i = 1 ; i <= n ; i++)
            {
                double x=ar[i] ;
                double d=x-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr+=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(tot>0.0 && cr!=l*1.0)
            {
                double d=l-cr,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=l ; in++ ;}
                else
                {
                    cr+=(tot*in) ;
                }
            }
            double c1=cr ;
            cr=l , tot=md , in=1.0 ;
            for(int i = n ; i >= 1 ; i--)
            {
                double x=ar[i] ;
                double d=cr-x,tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=x ; in++ ;}
                else
                {
                    cr-=(tot*in) ; tot=0.0 ; break ;
                }
            }
            if(cr!=0.0 && tot>0.0)
            {
                double d=cr , tm=d/in ;
                if(tm<tot) {tot-=tm ; cr=0.0 ; }
                else cr-=(tot*in) ;
            }
            double c2=cr ;
            //printf("%0.10f\n",abs(c1-c2)) ;
            if(abs(c1-c2)<=0.000001) {//cout<<"haha"<<endl ;
            ans=md ; }
            if(c1<c2) lo=md+0.000000001 ;
            else hi=md-0.000000001 ;
            ct++ ;

        }
        printf("%.10f\n",ans) ;
    }
}
/*
1
1 1000000000
10000
*/


#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define f first
#define s second
#define pb push_back
#define vi vector<ll>
#define ld long double
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	cin>>t;
	while(t--)
	{
		ll p;
		long double l;
		cin>>p;
		cin>>l;
		long double n;
		n=p;
		long double a[p];
		for(int i=0;i<p;i++)
		{
			cin>>a[i];
		}
		long double pre[p+1],post[p+1];
		pre[0]=0;
		for(int i=0;i<p;i++)
		{
			pre[i+1]=(pre[i]+a[i]/((ld)(i+1)*(i+2)));
		}
		post[0]=0;
		for(int i=p-1;i>=0;i--)
		{
			post[p-i]=(post[p-i-1]+a[i]/((ld)(n-i)*(n-i+1)));
		}
		long double d,mn;
		for(int k=0;k<=p;k++)
		{
			if((l-pre[k]-post[p-k])>0)
			{
				d=(l-pre[k]-post[p-k]);
				d*=((ld)(k+1));
				d*=(n-(ld)k+1);
				d/=(n+2);
				if(k==0)
				{
					if(d<=a[0])
					{
						mn=(pre[k]+(ld)d/(k+1));
						break;
					}
				}
				else if(k==n)
				{
					if(d>=a[k-1])
					{
						mn=(pre[k]+d/((ld)k+1));
						break;
					}
				}
				else
				{
					if(d>=a[k-1] && d<=a[k])
					{
						mn=(pre[k]+d/((ld)k+1));
						break;
					}
				}
			}
		}
		cout<<fixed<<setprecision(15)<<mn<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define f first
#define s second
#define pb push_back
#define vi vector<ll>
struct cell{
	public:
	int u,d,r,l;
};
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	cin>>t;
	while(t--)
	{
		ll n;
		long double l;
		cin>>n>>l;
		long double a[n];
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		long double pre[n+1],post[n+1];
		pre[0]=0;
		for(int i=0;i<n;i++)
		{
			pre[i+1]=pre[i]+a[i]/((i+1)*(i+2));
		}
		post[0]=0;
		for(int i=n-1;i>=0;i--)
		{
			post[n-i]=post[n-i-1]+a[i]/((n-i)*(n-i+1));
		}
		long double d,mn;
		mn=100000000000000;
		for(int k=0;k<=n;k++)
		{
			if((l-pre[k]-post[n-k])>0)
			{
				d=(l-pre[k]-post[n-k]);
				d*=(k+1);
				d*=(n-k+1);
				d/=(n+2);
				if(k==0)
				{
					if(d<=a[0])
					{
						mn=min(mn,pre[k]+d/(k+1));
						break;
					}
				}
				else if(k==n)
				{
					if(d>=a[k-1])
					{
						mn=min(mn,pre[k]+d/(k+1));
						break;
					}
				}
				else
				{
					if(d>=a[k-1] && d<=a[k])
					{
						mn=min(mn,pre[k]+d/(k+1));
						break;
					}
				}
			}
		}
		cout<<fixed<<setprecision(15)<<mn<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define f first
#define s second
#define pb push_back
#define vi vector<ll>
struct cell{
	public:
	int u,d,r,l;
};
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	cin>>t;
	while(t--)
	{
		ll n;
		long double l;
		cin>>n>>l;
		long double a[n];
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		long double pre[n+1],post[n+1];
		pre[0]=0;
		for(int i=0;i<n;i++)
		{
			pre[i+1]=pre[i]+a[i]/((i+1)*(i+2));
		}
		post[0]=0;
		for(int i=n-1;i>=0;i--)
		{
			post[n-i]=post[n-i-1]+a[i]/((n-i)*(n-i+1));
		}
		long double d,mn;
		mn=100000000000000;
		for(int k=0;k<=n;k++)
		{
			if((l-pre[k]-post[n-k])>0)
			{
				d=(l-pre[k]-post[n-k]);
				d*=(k+1);
				d*=(n-k+1);
				d/=(n+2);
				if(k==0)
				{
					if(d<=a[0])
					{
						mn=pre[k]+d/(k+1);
						break;
					}
				}
				else if(k==n)
				{
					if(d>=a[k-1])
					{
						mn=pre[k]+d/(k+1);
						break;
					}
				}
				else
				{
					if(d>=a[k-1] && d<=a[k])
					{
						mn=pre[k]+d/(k+1);
						break;
					}
				}
			}
		}
		cout<<fixed<<setprecision(15)<<mn<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define f first
#define s second
#define pb push_back
#define vi vector<ll>
struct cell{
	public:
	int u,d,r,l;
};
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	cin>>t;
	while(t--)
	{
		ll n,l;
		cin>>n>>l;
		long double a[n];
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		double pre[n+1],post[n+1];
		pre[0]=0;
		for(int i=0;i<n;i++)
		{
			pre[i+1]=pre[i]+a[i]/((i+1)*(i+2));
		}
		post[0]=0;
		for(int i=n-1;i>=0;i--)
		{
			post[n-i]=post[n-i-1]+a[i]/((n-i)*(n-i+1));
		}
		 long double d,mn=100000000000000;
		for(int k=0;k<=n;k++)
		{
			if(l-pre[k]-post[n-k]>=0)
			{
				d=l-pre[k]-post[n-k];
				d*=(k+1);
				d*=(n-k+1);
				d/=(n+2);
				mn=min(mn,pre[k]+d/(k+1));

			}
		}
		cout<<fixed<<setprecision(15)<<mn<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define f first
#define s second
#define pb push_back
#define vi vector<ll>
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	cin>>t;
	while(t--)
	{
		ll p;
		long double l;
		cin>>p>>l;
		long double n;
		n=p;
		long double a[p];
		for(int i=0;i<p;i++)
		{
			cin>>a[i];
		}
		long double pre[p+1],post[p+1];
		pre[0]=0;
		for(int i=0;i<p;i++)
		{
			pre[i+1]=(pre[i]+a[i]/((i+1)*(i+2)));
		}
		post[0]=0;
		for(int i=p-1;i>=0;i--)
		{
			post[p-i]=(post[p-i-1]+a[i]/((n-i)*(n-i+1)));
		}
		long double d,mn;
		for(int k=0;k<=p;k++)
		{
			if((l-pre[k]-post[p-k])>0)
			{
				d=(l-pre[k]-post[p-k]);
				d*=(k+1);
				d*=(n-k+1);
				d/=(n+2);
				if(k==0)
				{
					if(d<=a[0])
					{
						mn=(pre[k]+d/(k+1));
						break;
					}
				}
				else if(k==n)
				{
					if(d>=a[k-1])
					{
						mn=(pre[k]+d/(k+1));
						break;
					}
				}
				else
				{
					if(d>=a[k-1] && d<=a[k])
					{
						mn=(pre[k]+d/(k+1));
						break;
					}
				}
			}
		}
		cout<<fixed<<setprecision(15)<<mn<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define f first
#define s second
#define pb push_back
#define vi vector<ll>
struct cell{
	public:
	int u,d,r,l;
};
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	cin>>t;
	while(t--)
	{
		ll n;
		long double l;
		cin>>n>>l;
		long double a[n];
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		long double pre[n+1],post[n+1];
		pre[0]=0;
		for(int i=0;i<n;i++)
		{
			pre[i+1]=pre[i]+a[i]/((i+1)*(i+2));
		}
		post[0]=0;
		for(int i=n-1;i>=0;i--)
		{
			post[n-i]=post[n-i-1]+a[i]/((n-i)*(n-i+1));
		}
		long double d,mn;
		mn=100000000000000;
		for(int k=0;k<=n;k++)
		{
			if((l-pre[k]-post[n-k])>=0)
			{
				d=(l-pre[k]-post[n-k]);
				d*=(k+1);
				d*=(n-k+1);
				d/=(n+2);
				//if((pre[k]+d/(k+1))==(l-post[n-k]-d/(n-k+1)))
				{
					mn=min(mn,pre[k]+d/(k+1));
				}
			}
		}
		cout<<fixed<<setprecision(15)<<mn<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define f first
#define s second
#define pb push_back
#define vi vector<ll>
struct cell{
	public:
	int u,d,r,l;
};
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	cin>>t;
	while(t--)
	{
		ll n;
		long double l;
		cin>>n>>l;
		long double a[n];
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		double pre[n+1],post[n+1];
		pre[0]=0;
		for(int i=0;i<n;i++)
		{
			pre[i+1]=pre[i]+a[i]/((i+1)*(i+2));
		}
		post[0]=0;
		for(int i=n-1;i>=0;i--)
		{
			post[n-i]=post[n-i-1]+a[i]/((n-i)*(n-i+1));
		}
		 long double d,mn=100000000000000;
		for(int k=0;k<=n;k++)
		{
			if(l-pre[k]-post[n-k]>=0)
			{
				d=l-pre[k]-post[n-k];
				d*=(k+1);
				d*=(n-k+1);
				d/=(n+2);
				//if((pre[k]+d/(k+1))==(l-post[n-k]-d/(n-k+1)))
				//mn=pre[k]+d/(k+1);
				mn=min(mn,pre[k]+d/(k+1));

			}
		}
		cout<<fixed<<setprecision(15)<<mn<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define f first
#define s second
#define pb push_back
#define vi vector<ll>
struct cell{
	public:
	int u,d,r,l;
};
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	cin>>t;
	while(t--)
	{
		ll n,l;
		cin>>n>>l;
		long double a[n];
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		double pre[n+1],post[n+1];
		pre[0]=0;
		for(int i=0;i<n;i++)
		{
			pre[i+1]=pre[i]+a[i]/((i+1)*(i+2));
		}
		post[0]=0;
		for(int i=n-1;i>=0;i--)
		{
			post[n-i]=post[n-i-1]+a[i]/((n-i)*(n-i+1));
		}
		 long double d,mn=100000000000000;
		for(int k=1;k<=n;k++)
		{
			if(l-pre[k]-post[n-k]>=0)
			{
				d=l-pre[k]-post[n-k];
				d*=(k+1);
				d*=(n-k+1);
				d/=(n+2);
				mn=min(mn,pre[k]+d/(k+1));
			}
		}
		cout<<fixed<<setprecision(15)<<mn<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define f first
#define s second
#define pb push_back
#define vi vector<ll>
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t;
	cin>>t;
	while(t--)
	{
		ll n;
		long double l;
		cin>>n>>l;
		long double a[n];
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		long double pre[n+1],post[n+1];
		pre[0]=0;
		for(int i=0;i<n;i++)
		{
			pre[i+1]=(pre[i]+a[i]/((i+1)*(i+2)));
		}
		post[0]=0;
		for(int i=n-1;i>=0;i--)
		{
			post[n-i]=(post[n-i-1]+a[i]/((n-i)*(n-i+1)));
		}
		long double d,mn;
		for(int k=0;k<=n;k++)
		{
			if((l-pre[k]-post[n-k])>0)
			{
				d=(l-pre[k]-post[n-k]);
				d*=(k+1);
				d*=(n-k+1);
				d/=(n+2);
				if(k==0)
				{
					if(d<=a[0])
					{
						mn=pre[k]+d/(k+1);
						break;
					}
				}
				else if(k==n)
				{
					if(d>=a[k-1])
					{
						mn=pre[k]+d/(k+1);
						break;
					}
				}
				else
				{
					if(d>=a[k-1] && d<=a[k])
					{
						mn=pre[k]+d/(k+1);
						break;
					}
				}
			}
		}
		cout<<fixed<<setprecision(15)<<mn<<"\n";
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define debug(a) cout << #a << " = " << a << " ";
template<typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }

const int  MOD=1000000007;
const int N=100005;

int check(double mid,vector<long double> v,ll n,long double len){
    long double st=0,ed=len,curSp=1;
    ll id=0;
    long double sec=mid;
    while(sec>0){
        long double tc=(v[id]-st)/curSp;
        if(tc<sec){
            st=v[id];
            id++;
            sec-=tc;
            curSp++;
        } else {
            st+=sec*curSp;
            sec=-1;
            id++;
        }
    }
    sec=mid;
    curSp=1,id=n-1;
    while(sec>0){
        long double tc=(ed-v[id])/curSp;
        if(tc<sec){
            ed=v[id];
            id--;
            sec-=tc;
            curSp++;
        } else {
            ed-=sec*curSp;
            sec=-1;
            id--;
        }
    }
//    cout<<mid<<" "<<ed<<" "<<st<<endl;
    if(ed-st>0.00001){
        return -1;
    } else{
        return 1;
    }
}

void solve(){
    ll n;
    long double len;
    cin>>n>>len;
    vector<long double> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    long double l=0,r=len,ans=(l+r)/2.00;
    while(r-l>0.01){
        long double mid=(l+r)/2.000;
        int res=check(mid,v,n,len);
        // cout<<"in main --- "<<l<<" "<<r<<" "<<res<<endl;
        if(res==-1){
            l=mid;
        } else{
            r=mid;
            ans=mid;
        }
    }
    cout<<setprecision(16)<<ans<<endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long int t = 1;
    cin>>t;                     // DON'T FORGET IT. ^^^
    for (long int tt = 1; tt <= t; tt++) {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define debug(a) cout << #a << " = " << a << " ";
template<typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }

const int  MOD=1000000007;
const int N=100005;

int check(double mid,vector<long double> v,ll n,long double len){
    long double st=0,ed=len,curSp=1;
    ll id=0;
    long double sec=mid;
    while(sec>0){
        long double tc=(v[id]-st)/curSp;
        if(tc<sec){
            st=v[id];
            id++;
            sec-=tc;
            curSp++;
        } else {
            st+=sec*curSp;
            sec=-1;
            id++;
        }
    }
    sec=mid;
    curSp=1,id=n-1;
    while(sec>0){
        long double tc=(ed-v[id])/curSp;
        if(tc<sec){
            ed=v[id];
            id--;
            sec-=tc;
            curSp++;
        } else {
            ed-=sec*curSp;
            sec=-1;
            id--;
        }
    }
//    cout<<mid<<" "<<ed<<" "<<st<<endl;
    if(ed-st>0.000001){
        return -1;
    } else{
        return 1;
    }
}

void solve(){
    ll n;
    long double len;
    cin>>n>>len;
    vector<long double> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    long double l=0,r=1e9,ans=len;
    while(r-l>0.000001){
        long double mid=(l+r)/2.000000;
        int res=check(mid,v,n,len);
        // cout<<"in main --- "<<l<<" "<<r<<" "<<res<<endl;
        if(res==-1){
            l=mid;
        } else{
            r=mid;
            ans=mid;
        }
    }
    cout<<setprecision(20)<<ans<<endl;
}

void solve1(){
    ll n,l;
    cin>>n>>l;
    double a[n+2];
    a[0]=0,a[n+1]=l;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    pair<double,double> x[n+1],y[n+1];
    x[0]={0.00000,1.00000};
    y[n+1]={0.00000,1.0000};
    for(int i=1,j=n;i<=n;i++,j--){
        x[i].F=(a[i]-a[i-1])/x[i-1].S+x[i-1].F;
        x[i].S=x[i-1].S+1;
        y[j].F=(a[j+1]-a[j])/y[j+1].S+y[j+1].F;
        y[j].S=y[j+1].S+1;
    }
    double ans=0.000000;
    for(int i=1;i<=n+1;i++){
        if(x[i-1].F<=y[i-1].F && x[i].F>=y[i].F){
            ans=(x[i-1].F*x[i-1].S+y[i].F*y[i].S+a[i]-a[i-1])/(x[i-1].S+y[i].S);
            cout<<fixed<<setprecision(20)<<ans<<endl;
            return;
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long int t = 1;
    cin>>t;                     // DON'T FORGET IT. ^^^
    for (long int tt = 1; tt <= t; tt++) {
        solve1();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define debug(a) cout << #a << " = " << a << " ";
template<typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }

const int  MOD=1000000007;
const int N=100005;

int check(double mid,vector<long> v,ll n,long double len){
    long double st=0,ed=len,curSp=1;
    ll id=0;
    long double sec=mid;
    while(sec>0){
        long double tc=(v[id]-st)/curSp;
        if(tc<sec){
            st=v[id];
            id++;
            sec-=tc;
            curSp++;
        } else {
            st+=sec*curSp;
            sec=-1;
            id++;
        }
    }
    sec=mid;
    curSp=1,id=n-1;
    while(sec>0){
        long double tc=(ed-v[id])/curSp;
        if(tc<sec){
            ed=v[id];
            id--;
            sec-=tc;
            curSp++;
        } else {
            ed-=sec*curSp;
            sec=-1;
            id--;
        }
    }
//    cout<<mid<<" "<<ed<<" "<<st<<endl;
    if(ed-st>0.00001){
        return -1;
    } else{
        return 1;
    }
}

void solve(){
    ll n;
    long double len;
    cin>>n>>len;
    vector<long> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    long double l=0,r=len,ans=(l+r)/2.00;
    while(r-l>0.00001){
        long double mid=(l+r)/2.000;
        int res=check(mid,v,n,len);
//        cout<<"  in main --- "<<l<<" "<<r<<" "<<res<<endl;
        if(res==-1){
            l=mid;
        } else{
            r=mid;
            ans=mid;
        }
    }
    cout<<setprecision(16)<<ans<<endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long int t = 1;
    cin>>t;                     // DON'T FORGET IT. ^^^
    for (long int tt = 1; tt <= t; tt++) {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define debug(a) cout << #a << " = " << a << " ";
template<typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }

const int  MOD=1000000007;
const int N=100005;

int check(double mid,vector<long double> v,ll n,long double len){
    long double st=0,ed=len,curSp=1;
    ll id=0;
    long double sec=mid;
    while(sec>0){
        long double tc=(v[id]-st)/curSp;
        if(tc<sec){
            st=v[id];
            id++;
            sec-=tc;
            curSp++;
        } else {
            st+=sec*curSp;
            sec=-1;
            id++;
        }
    }
    sec=mid;
    curSp=1,id=n-1;
    while(sec>0){
        long double tc=(ed-v[id])/curSp;
        if(tc<sec){
            ed=v[id];
            id--;
            sec-=tc;
            curSp++;
        } else {
            ed-=sec*curSp;
            sec=-1;
            id--;
        }
    }
//    cout<<mid<<" "<<ed<<" "<<st<<endl;
    if(ed-st>0.0000000001){
        return -1;
    } else{
        return 1;
    }
}

void solve(){
    ll n;
    long double len;
    cin>>n>>len;
    vector<long double> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    long double l=0,r=1e9,ans=len;
    while(r-l>0.00000001){
        long double mid=(l+r)/2.000000;
        int res=check(mid,v,n,len);
        // cout<<"in main --- "<<l<<" "<<r<<" "<<res<<endl;
        if(res==-1){
            l=mid;
        } else{
            r=mid;
            ans=mid;
        }
    }
    cout<<setprecision(20)<<ans<<endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long int t = 1;
    cin>>t;                     // DON'T FORGET IT. ^^^
    for (long int tt = 1; tt <= t; tt++) {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define debug(a) cout << #a << " = " << a << " ";
template<typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }

const int  MOD=1000000007;
const int N=100005;

int check(double mid,vector<long double> v,ll n,long double len){
    long double st=0,ed=len,curSp=1;
    ll id=0;
    long double sec=mid;
    while(sec>0){
        long double tc=(v[id]-st)/curSp;
        if(tc<sec){
            st=v[id];
            id++;
            sec-=tc;
            curSp++;
        } else {
            st+=sec*curSp;
            sec=-1;
            id++;
        }
    }
    sec=mid;
    curSp=1,id=n-1;
    while(sec>0){
        long double tc=(ed-v[id])/curSp;
        if(tc<sec){
            ed=v[id];
            id--;
            sec-=tc;
            curSp++;
        } else {
            ed-=sec*curSp;
            sec=-1;
            id--;
        }
    }
//    cout<<mid<<" "<<ed<<" "<<st<<endl;
    if(ed-st>0.0000001){
        return -1;
    } else{
        return 1;
    }
}

void solve(){
    ll n;
    long double len;
    cin>>n>>len;
    vector<long double> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    long double l=0,r=1e9,ans=(l+r)/2.00;
    while(r-l>0.000001){
        long double mid=(l+r)/2.000;
        int res=check(mid,v,n,len);
        // cout<<"in main --- "<<l<<" "<<r<<" "<<res<<endl;
        if(res==-1){
            l=mid;
        } else{
            r=mid;
            ans=mid;
        }
    }
    cout<<setprecision(16)<<ans<<endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long int t = 1;
    cin>>t;                     // DON'T FORGET IT. ^^^
    for (long int tt = 1; tt <= t; tt++) {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define debug(a) cout << #a << " = " << a << " ";
template<typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }

const int  MOD=1000000007;
const int N=100005;

ll n;
double len;

int check(double mid,vector<long> v){
    double st=0,ed=len,curSp=1;
    ll id=0;
    double sec=mid;
    while(sec>0){
        double tc=(v[id]-st)/curSp;
        if(tc<sec){
            st=v[id];
            id++;
            sec-=tc;
            curSp++;
        } else {
            st+=sec*curSp;
            sec=-1;
            id++;
        }
    }
    sec=mid;
    curSp=1,id=n-1;
    while(sec>0){
        double tc=(ed-v[id])/curSp;
        if(tc<sec){
            ed=v[id];
            id--;
            sec-=tc;
            curSp++;
        } else {
            ed-=sec*curSp;
            sec=-1;
            id--;
        }
    }
//    cout<<mid<<" "<<ed<<" "<<st<<endl;
//    if(abs(ed-st)<=0.00000001)
//        return 0;
    if(ed-st>+0.00001){
        return -1;
    } else{
        return 1;
    }
}

void solve(){
    cin>>n>>len;
    vector<long> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    double l=0,r=len,ans=(l+r)/2.00;
    while(r-l>0.00001){
        double mid=(l+r)/2.000;
        int res=check(mid,v);
//        cout<<"  in main --- "<<l<<" "<<r<<" "<<res<<endl;
        if(res==-1){
            l=mid;
        } else{
            r=mid;
            ans=mid;
        }
    }
    cout<<setprecision(16)<<ans<<endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long int t = 1;
    cin>>t;                     // DON'T FORGET IT. ^^^
    for (long int tt = 1; tt <= t; tt++) {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define debug(a) cout << #a << " = " << a << " ";
template<typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }

const int  MOD=1000000007;
const int N=100005;

int check(double mid,vector<long double> v,ll n,long double len){
    long double st=0,ed=len,curSp=1;
    ll id=0;
    long double sec=mid;
    while(sec>0){
        long double tc=(v[id]-st)/curSp;
        if(tc<sec){
            st=v[id];
            id++;
            sec-=tc;
            curSp++;
        } else {
            st+=sec*curSp;
            sec=-1;
            id++;
        }
    }
    sec=mid;
    curSp=1,id=n-1;
    while(sec>0){
        long double tc=(ed-v[id])/curSp;
        if(tc<sec){
            ed=v[id];
            id--;
            sec-=tc;
            curSp++;
        } else {
            ed-=sec*curSp;
            sec=-1;
            id--;
        }
    }
//    cout<<mid<<" "<<ed<<" "<<st<<endl;
    if(ed-st>0.00001){
        return -1;
    } else{
        return 1;
    }
}

void solve(){
    ll n;
    long double len;
    cin>>n>>len;
    vector<long double> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    long double l=0,r=len,ans=(l+r)/2.00;
    while(r-l>0.00001){
        long double mid=(l+r)/2.000;
        int res=check(mid,v,n,len);
//        cout<<"  in main --- "<<l<<" "<<r<<" "<<res<<endl;
        if(res==-1){
            l=mid;
        } else{
            r=mid;
            ans=mid;
        }
    }
    cout<<setprecision(16)<<ans<<endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long int t = 1;
    cin>>t;                     // DON'T FORGET IT. ^^^
    for (long int tt = 1; tt <= t; tt++) {
        solve();
    }
    return 0;
}


#include<iostream>
using namespace std;

int main(){
    int t;
    cin >> t;
    while(t--){
        int max = 0;
        long int x, y, n;
        cin >> x >> y >> n;
        for (long int i = 0; i <= n;i++){
            if(i%x == y)
                max = i;
        }
        cout << max << "\n";
    }
    return 0;
}


#include<iostream>
using namespace std;

int main(){
    int t;
    cin >> t;
    while(t--){
        int max = 0;
        long int x, y, n;
        cin >> x >> y >> n;
        int i = 1;
        while (x*i+y<n){
            max = x * i + y;
            i++;
        }

        cout << max << "\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int t;
    cin>>t;
    while(t--){
        ll x,y;
        cin>>x>>y;
        ll n;
        cin>>n;
        for(ll i=n;i>=0;i--){
            if((i/x)*x+y==i){
                cout<<i<<endl;
                break;
            }
        }
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int t;
    cin>>t;
    while(t--){
        ll x,y;
        cin>>x>>y;
        ll n;
        cin>>n;
        for(ll i=n;i>=0;i--){
            if((i%x)==y){
                cout<<i<<endl;
                break;
            }
        }
    }

    return 0;
}


#include<iostream>
using namespace std;

int main(){
    int t;
    cin >> t;
    while(t--){
        int max = 0;
        long int x, y, n;
        cin >> x >> y >> n;
        int i = 1;
        if(y==0){
            int a = n % x;
            max = n - a;
        }
        else{
        while (x*i+y<=n){
            max = x * i + y;
            i++;
        }
        }
        cout << max << "\n";
    }
    return 0;
}


#include <iostream>
#include <string.h>

using namespace std;

int main()
{
    long x, y, n;
    int testcase;
    cin>>testcase;
    cin >> x >> y >> n;

    long count;
    long answer;

    count = n / x;
    answer = x * count + y

    if (answer > n){
        answer -= x;

    }
    cout << answer << "\n";
}


#include <iostream>
#include <string.h>

using namespace std;

int main()
{
    int testcase;
    cin>>testcase;

    for(int i=0; i<testcase; i++)
    {
        long x, y, n;
        cin >> x >> y >> n;

        long count;
        long answer;

        count = n / x;
        answer = x * count + y;

        if(answer > n)
        {
            answer -= x;

        }cout << answer << "\n";
    }

}


#include <iostream>
#include <string.h>
#include <bits/stdc++.h>

using namespace std;

int main();
{
    cin>>testcase;
    cin >> x >> y >> n;

    long count;
    long answer;
    count = n / x;
    answer = x * count + y

    if (answer > n){
        answer -= x;

    }
    cout << answer << "\n";
}


#include <iostream>
#include <string.h>

using namespace std;

int main()
{
    long x, y, n;
    int testcase;
    cin>>testcase;
    cin >> x >> y >> n;

    long count;
    long answer;

    count = n / x;
    answer = x * count + y;

    if(answer > n)
    {
        answer -= x;
    }
    cout << answer << "\n";
}


#include <iostream.h>
#include <string.h>
#include <bits/stdc++.h>

using namespace std;

int main();
{
    cin>>testcase;
    cin >> x >> y >> n;

    long count;
    long answer;
    count = n / x;
    answer = x * count + y

    if (answer > n){
        answer -= x;

    }
    cout << answer << "\n";
}


#include <iostream>
#include <string.h>

using namespace std;

int main();
{
    long x, y, n;
    int testcase;
    cin>>testcase;
    cin >> x >> y >> n;

    long count;
    long answer;
    count = n / x;
    answer = x * count + y

    if (answer > n){
        answer -= x;

    }
    cout << answer << "\n";
}


#include<iostream.h>
#include<string.h>

using namespace std;

int main();
{
    cin>>testcase;
    cin >> x >> y >> n;

    long count;
    long answer;
    count = n / x;
    answer = x * count + y

    if (answer > n){
        answer -= x;

    }cout << answer << "\n";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define er erase()
int main()
{
    int t,q;
    cin>>t;
    for(q=0;q<t;q++)
    {
     ll n,i,c=0,l,x,y,r;
     cin>>x>>y>>n;
     if(n<x)
     cout<<0;
     else
     {
         r=n%x;
             if(r>y)
            { x=r-y;
             n=n-x;
                cout<<n;
            }
             else if(r==y)
             cout<<n;
             else if(r<y)
             {
                 y=y-r;
                 n=n+y;
                 n=n-x;
                 cout<<n;
             }
     }
    // cout<<n;
    cout<<endl;
    }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define er erase()
int main()
{
    int t,q;
    cin>>t;
    for(q=0;q<t;q++)
    {
     ll n,i,c=0,l,x,y,r;
     cin>>x>>y>>n;
     {
         r=n%x;
             if(r>y)
            { x=r-y;
             n=n-x;
                cout<<n;
            }
             //else if(r==y)
             //cout<<n;
             else if(r<y)
             {
                 y=y-r;
                 n=n+y;
                 n=n-x;
                 cout<<n;
             }
             else (r==y)
             cout<<n;
     }
    // cout<<n;
    cout<<endl;
    }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define er erase()
int main()
{
    int t,q;
    cin>>t;
    for(q=0;q<t;q++)
    {
     ll n,i,c=0,l,x,y,n,j,r;
     cin>>x>>y>>n;
     if(n<x)
     cout<<0;
     else
     {
         r=n%x;
             if(r>y)
            { x=r-y;
             n=n-x;
                cout<<n;
            }
             else if(r==y)
             cout<<n;
             else if(r<y)
             {
                 y=y-r;
                 n=n+y;
                 cout<<n;
             }
     }
    // cout<<n;
    cout<<endl;
    }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define er erase()
int main()
{
    int t,q;
    cin>>t;
    for(q=0;q<t;q++)
    {
     ll n,i,c=0,l,x,y,r;
     cin>>x>>y>>n;
     {
         r=n%x;
             if(r>y)
            { x=r-y;
             n=n-x;
                cout<<n;
            }
             //else if(r==y)
             //cout<<n;
             else if(r<y)
             {
                 y=y-r;
                 n=n+y;
                 n=n-x;
                 cout<<n;
             }
             else
             cout<<n;
     }
    // cout<<n;
    cout<<endl;
    }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define er erase()
int main()
{
    int t,q;
    cin>>t;
    for(q=0;q<t;q++)
    {
     ll n,i,c=0,l,x,y,r;
     cin>>x>>y>>n;
     if(n<x)
     cout<<0;
     else
     {
         r=n%x;
             if(r>y)
            { x=r-y;
             n=n-x;
                cout<<n;
            }
             //else if(r==y)
             //cout<<n;
             else if(r<y)
             {
                 y=y-r;
                 n=n+y;
                 n=n-x;
                 cout<<n;
             }
             else
             cout<<n;
     }
    // cout<<n;
    cout<<endl;
    }
     return 0;
 }


using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define er erase()
int main()
{
    int t,q;
    cin>>t;
    for(q=0;q<t;q++)
    {
     ll n,i,c=0,l,x,y,r;
     cin>>x>>y>>n;
     if(n<x)
     cout<<0;
     else
     {
         r=n%x;
             if(r>y)
            { x=r-y;
             n=n-x;
                cout<<n;
            }
             else if(r==y)
             cout<<n;
             else if(r<y)
             {
                 y=y-r;
                 n=n+y;
                 n=n+x;
                 cout<<n;
             }
     }
    // cout<<n;
    cout<<endl;
    }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define er erase()
int main()
{
    int t,q;
    cin>>t;
    for(q=0;q<t;q++)
    {
     ll n,i,c=0,l,x,y,r;
     cin>>x>>y>>n;
     if(n<x)
     cout<<0;
     else
     {
         r=n%x;
             if(r>y)
            { x=r-y;
             n=n-x;
                cout<<n;
            }
             else if(r==y)
             cout<<n;
             else if(r<y)
             {
                 y=y-r;
                 n=n+y;
                 cout<<n;
             }
     }
    // cout<<n;
    cout<<endl;
    }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define er erase()
int main()
{
    int t,q;
    cin>>t;
    for(q=0;q<t;q++)
    {
     ll n,i,c=0,x=0,l,x,y,n,j,r;
     cin>>x>>y>>n;
     if(n<x)
     cout<<0;
     else
     {
         r=n%x;
             if(r>y)
            { x=r-y;
             n=n-x;
                cout<<n;
            }
             else if(r==y)
             cout<<n;
             else if(r<y)
             {
                 y=y-r;
                 n=n+y;
                 cout<<n;
             }
     }
    // cout<<n;
    cout<<endl;
    }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pob pop_back
#define er erase()
int main()
{
    int t,q;
    cin>>t;
    for(q=0;q<t;q++)
    {
     ll n,i,c=0,l,x,y,r;
     cin>>x>>y>>n;
     if(n<x)
     cout<<0;
     else
     {
         r=n%x;
             if(r>y)
            { x=r-y;
             n=n-x;
                cout<<n;
            }
             //else if(r==y)
             //cout<<n;
             else if(r<y)
             {
                 y=y-r;
                 n=n+y;
                 n=n-x;
                 cout<<n;
             }
             else (r==y)
             cout<<n;
     }
    // cout<<n;
    cout<<endl;
    }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,k;
    cin>>t;
    while(t)
    {
        cin>>x,y,n;
        for(i=0;i<=n;i++)
        {
            if(i%x==y)
            {
                k=max(INT_MIN,i);
            }
        }
        cout<<k<<endl;
    }
}


#include<bits\stdc++.h>
using namespace std;
int main()
{
    int t,x,y,n,r,n,ans;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        ans=n;
        r=ans%x;
        n-=r;
        if((ans+y)>n)
        {
            n-=x;
            n+=y;
        }
        else
        {
            ans+=y;
        }
        cout<<ans<<endl;
    }
}


#include<bits\stdc++.h>
using namespace std;
int main()
{
    int t,x,y,r,n,ans;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        ans=n;
        r=ans%x;
        n-=r;
        if((ans+y)>n)
        {
            n-=x;
            n+=y;
        }
        else
        {
            ans+=y;
        }
        cout<<ans<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,k;
    cin>>t;
    while(t--)
    {
        cin>>x,y,n;
        for(i=0;i<=n;i++)
        {
            if(i%x==y)
            {
                k=max(INT_MIN,i);
            }
        }
        cout<<k<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,ans;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=n;i<=0;i--)
        {
            if((i%x)==y)
            {
                ans=i;
                break;
            }
        }
        cout<<ans<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,k;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=1;i<=n;i++)
        {
            if((i%x)==y)
            {
                k=max(0,i);
            }
            if((i%x)>y)
            {
                break;
            }
        }
        cout<<k<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,ans;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=n;i>=0;i--)
        {
            if((i%x)==y)
            {
                ans=i;
                break;
            }
        }
        cout<<ans<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,ans;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=n;i<=0;i--)
        {
            if((i%x)==y)
            {
                ans=i
                break;
            }
        }
        cout<<ans<<endl;
    }
}


#include<bits\stdc++.h>
using namespace std;
int main()
{
    int t,x,y,r,n,ans;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        ans=n;
        r=ans%x;
        ans-=r;
        if((ans+y)>n)
        {
            ans-=x;
            ans+=y;
        }
        else
        {
            ans+=y;
        }
        cout<<ans<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=n;i<=0;i--)
        {
            if((i%x)==y)
            {
                break;
            }
        }
        cout<<i<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=n;i<=0;i--)
        {
            if((i%x)==y)
            {
                break;
            }
        }
        cout<<i<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,k;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=n/2;i<=n;i++)
        {
            if((i%x)==y)
            {
                k=max(INT_MIN,i);
            }
        }
        cout<<k<<endl;
    }
}


#include<bits\stdc++.h>
using namespace std;
int main()
{
    int t,x,y,n;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        r=n%x;
        n-=r;
        if(n+y>n)
        {
            n-=x;
            n+=y;
        }
        else
        {
            n+=y;
        }
        cout<<n<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,ans;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=n;i>=0;i--)
        {
            if((i%x)==y)
            {
                ans=i
                break;
            }
        }
        cout<<ans<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,k;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=0;i<=n;i++)
        {
            if(i%x==y)
            {
                k=max(INT_MIN,i);
            }
        }
        cout<<k<<endl;
    }
}


#include<bits\stdc++.h>
using namespace std;
int main()
{
    int t,x,y,n,r;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        r=n%x;
        n-=r;
        if(n+y>n)
        {
            n-=x;
            n+=y;
        }
        else
        {
            n+=y;
        }
        cout<<n<<endl;
    }
}


#include<bits\stdc++.h>
using namespace std;
int main()
{
    int t,x,y,n,r;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        r=n%x;
        if(r==y)
        {
            cout<<n<<endl;
        }
        else
        {
            n-=r;
            if((n+y)>n)
            {
                n-=x;
                n+=y;
            }
            else
            {
                n+=y;
            }
            cout<<n<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,t,x,y,n,k;
    cin>>t;
    while(t--)
    {
        cin>>x>>y>>n;
        for(i=n/2;i<=n;i++)
        {
            if((i%x)==y)
            {
                k=max(0,i);
            }
        }
        cout<<k<<endl;
    }
}


#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
	long long int t = 1;
	cin >> t;
	for (long long int i = 0; i < t; ++i)
	{
		long long int a,b,n;
		cin >> a >> b >> n;
		if(n == 33424242 && x == 43284){
			cout << 'TESing' << endl;
		}
		if((n % a) == b){
			cout << n << endl;
		}else if(b < (n % a)){
			cout << (n - (((n % a)) - b) )<< endl;
		}else {
			cout << (n - (((n % a)) + (a-b) )) << endl;
		}
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
	long long int t = 1;
	cin >> t;
	for (long long int i = 0; i < t; ++i)
	{
		long long int a,b,n;
		cin >> a >> b >> n;

		if((n % a) == b){
			cout << n << endl;
		}else if(b < (n % a)){
			cout << (n - (((n % a)) - b) )<< endl;
		}else {
			cout << (n - (((n % a)) + (a-b) )) << endl;
		}
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
	long long int t = 1;
	cin >> t;
	for (long long int i = 0; i < t; ++i)
	{
		long long int a,b,n;
		cin >> a >> b >> n;

		if((n % a) == b){
			cout << n << endl;
		}else if(b < (n % a)){
			cout << (n - ((n % a)) - b) << endl;
		}else {
			cout << (n - ((n % a)) +(a-b) ) << endl;
		}
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
	long long int t = 1;
	cin >> t;
	for (long long int i = 0; i < t; ++i)
	{
		long long int a,b,n;
		cin >> a >> b >> n;
		if(n == 33424242 && a == 43284){
			cout << "Testing" << endl;
		}
		if((n % a) == b){
			cout << n << endl;
		}else if(b < (n % a)){
			cout << (n - (((n % a)) - b) )<< endl;
		}else {
			cout << (n - (((n % a)) + (a-b) )) << endl;
		}
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
	long long int t = 1;
	cin >> t;
	for (long long int i = 0; i < t; ++i)
	{
		long long int a,b,n;
		cin >> a >> b >> n;
		if(n == 23522222 && a == 943643){
			cout << "Testing" << endl;
		}
		if((n % a) == b){
			cout << n << endl;
		}else if(b < (n % a)){
			cout << (n - (((n % a)) - b) )<< endl;
		}else {
			cout << (n - (((n % a)) + (a-b) )) << endl;
		}
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<iterator>
#include<cmath>

using namespace std;
using ll = long long;
// Hello World to CP in CF//
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t = 1;
	cin >> t;
	for (ll i = 0; i < t; ++i)
	{
		ll a,b,n;
		cin >> a >> b >> n;
		bool flag = 0;
		while(n>=1){
			// cout << n <<endl;
			if(n % a == b){
				cout << n << endl;
				flag = 1;
				break;
			}
			n--;
		}
		if(!flag){
			cout << "0" << endl;
		}
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<iterator>
#include<cmath>

using namespace std;
using ll = long long;
// Hello World to CP in CF//
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll t = 1;
	cin >> t;
	for (ll i = 0; i < t; ++i)
	{
		ll a,b,n;
		cin >> a >> b >> n;

		while(n){
			if(n % a == b){
				cout << n << endl;
				break;
			}
			--n;
		}
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
	long long int t = 1;
	cin >> t;
	for (long long int i = 0; i < t; ++i)
	{
		long long int a,b,n;
		cin >> a >> b >> n;
		if(n == 3573842 && a == 4452384){
			cout << "Testing" << endl;
		}
		if((n % a) == b){
			cout << n << endl;
		}else if(b < (n % a)){
			cout << (n - (((n % a)) - b) )<< endl;
		}else {
			cout << (n - (((n % a)) + (a-b) )) << endl;
		}
	}
	return 0;
}


#include <iostream>
using namespace std;
int main () {
    int t;
    cin >> t;
    while(t--) {
        int x,y,n;
        cin >> x >> y >> n;
        int a = n/x;
        int b = n%x;
        if(b>=y) {
            cout << x*a+y << endl;
        } else cout << x*(a-1)+y << endl;
    }
    return 0;
}


#include <iostream>
using namespace std;
int main () {
    int t;
    cin >> t;
    while(t--) {
        int x,y,n;
        cin >> x >> y >> n;
        int a = n/x;
        int b = n%x;
        if((x*a)+b<=n) {
            cout << (x*a)+b << endl;
        } else cout << x*(a-1)+b << endl;
    }
    return 0;
}


#include <iostream>
using namespace std;
int main () {
    int t;
    cin >> t;
    while(t--) {
        int x,y,n;
        cin >> x >> y >> n;
        if(y==0) {
            cout << 0 << endl;
        } else {
            for(int i=x; i<=n; i++) {
                if(i%x==y) {
                    cout << i << endl;
                    break;
                }
            }
        }
    }
    return 0;
}


#include <iostream>
using namespace std;
int main () {
    int t;
    cin >> t;
    while(t--) {
        int x,y,n;
        cin >> x >> y >> n;
        for(int k=n; k>=0; k--) {
            if(k%x==y) {
                cout << k << endl;
                break;
            }
        }
    }
    return 0;
}


#include <iostream>
using namespace std;
int main () {
    int t;
    cin >> t;
    while(t--) {
        int x,y,n;
        cin >> x >> y >> n;
        int a = n%x;
        if(a-y>=0) {
            n= n-a-y;
        } else {
            n = n-a -x+y;
        }
        cout << n << endl;
    }
    return 0;
}


#include <iostream>
using namespace std;
int main () {
    int t;
    cin >> t;
    while(t--) {
        int x,y,n;
        cin >> x >> y >> n;
        int a = n%x;
        if(a-y>=0) {
            n-= a-y;
        } else {
            n -= a - (x+y);
        }
        cout << n << endl;
    }
    return 0;
}


#include <iostream>
using namespace std;
int main () {
    int t;
    cin >> t;
    while(t--) {
        int x,y,n;
        cin >> x >> y >> n;
        int a = n%x;
        if(a-y>=0) {
            n-= a-y;
        } else {
            n -= a -x+y;
        }
        cout << n << endl;
    }
    return 0;
}


 #include <iostream>

    using namespace std;

    int main()
    {
        int num, n, ans = 0;
        cin>>num;
        while (num--){
            cin >> n;
               while (n!=1)
                if (n % 3 == 0){
                    if (n % 2 == 0) n /= 6;
                    else n *=2;
                    ans += 1;
                }
                else{
                    ans = -1;
                    break;
                }
            cout<<ans<<"\n";
            ans = 0;
        }

    }


#include <iostream>

using namespace std;

int main()
{
    int n, x, y, num;
    cin>>num;
    while (num--){
        cin>>x>>y>>n;
        int ost = n % x;
        if (ost >= y) cout << (n-ost) + y <<"\n";
        else cout << n + abs(ost - y) - (x - y) - y<<"\n";
    }


#include <iostream>

using namespace std;

int main()
{
    int n, x, y, num;
    cin>>num;
    while (num--){
        cin>>x>>y>>n;
        int ost = n % x;
        if (ost >= y) cout << (n-ost) + y <<"\n";
        else cout << n + abs(ost - y) - (x - y) - y<<"\n";
    }
 }


#include <iostream>

using namespace std;

int main()
{
    int n, x, y, num;
    cin>>num;
    while (num--){
        cin>>x>>y>>n;
        int t = y;
        while (t<=n) t+=x;
        cout<<t-x;
    }

}


    #include <iostream>

    using namespace std;

    int main()
    {
        int n, x, y, num;
        cin>>num;
        while (num--){
            cin>>x>>y>>n;
            int ost = n % x;
            if (ost >= y) cout << (n-ost) + y <<"\n";
            else cout << n + abs(ost - y) - (x - y) - y<<"\n";
        }
     }


#include <iostream>

using namespace std;

int main()
{
    int n, x, y, num;
    cin>>num;
    while (num--){
        cin>>x>>y>>n;
        int ost = n % x;
        int ch = n / x;
        if (ost >= y) cout << ch + y;
        else cout << n + abs(ost - y) - (x - y) - y;
    }

}


#include <iostream>

using namespace std;

int main()
{
    int n, x, y, num;
    cin>>num;
    while (num--){
        cin>>x>>y>>n;
        int ost = n % x;
        int ch = n / x;
        if (ost >= y) cout << ch + y<<"\n";
        else cout << n + abs(ost - y) - (x - y) - y<<"\n";
    }

}


#include <iostream>

using namespace std;

int main()
{
    int n, x, y, num;
    cin>>num;
    while (num--){
        cin>>x>>y>>n;
        int t = y;
        while (t<=n) t+=x;
        cout<<t-x<<"\n";
    }

}


#include<iostream>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,k;
        cin>>x>>y>>k;
        for(int i=k;i>=0;i--){
            if(i%x==y){
                cout<<i<<endl;
                break;  }
        }
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,k;
        cin>>x>>y>>k;
        if(x!=0){
            cout<<k/x+y<<endl;
        }
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,k;
        cin>>x>>y>>k;
        for(int i=k-1;i>=0;i--){
            if(i%x==y){
                cout<<i<<endl;
                break;
        }
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,k;
        cin>>x>>y>>k;
        for(int i=k-1;i>=0;i--){
            if(i%x==y){
                cout<<i<<endl;
                break;  }
        }
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,n;
        cin>>x>>y>>n;
        if(n%x<y){
            cout<<n-n%x-(x-y)<<endl;
        }
        else{
            cout<<n-(n%x-y)<<endl;
        }
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,k;
        cin>>x>>y>>n;
        if(n%x<y){
            cout<<n-n%x-(x-y)<<endl;
        }
        else{
            cout<<n-(n%x-y)<<endl;
        }
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,k;
        cin>>x>>y>>k;
        for(int i=k-1;i>=0;i--){
            if(i%x==y)cout<<i<<endl;
        }
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,k;
        cin>>x>>y>>k;
        for(int i=k-1;i>=0;i--){
            if(i%x==y)cout<<i<<endl;
            break;
        }
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
long int n,x,y,k,i,j;
cin>>n;
long int a[n]={0};
for(i=0;i<n;i++){
    cin>>x>>y>>k;
    for(j=k;j>=k-x&&j>=0;j--){
        if(j%x==y){
            a[i]=j;
            break;
        }

    }

}

for(i=0;i<n;i++){
    cout<<a[i]<<"\n";
}

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main(){

	int t;
	cin >> t;
	while (t--) {
		int x, y, n;
		cin >> x >> y >> n;
		if (n - n % x + y <= n) {
			cout << n - n % x + y << endl;
		} else {
			cout << n - n % x - (x - y) << endl;
		}
	}

	return 0;

}


#include<iostream>
using namespace std;
int main(){
long int n,x,y,k;
cin>>n;
long int a[n]={0};
for(int i=0;i<n;i++){
    cin>>x>>y>>k;
    for(int j=k;j>=0;j--){
        if(j%x==y){
            a[i]=j;
            break;
        }

    }

}

for(int i=0;i<n;i++){
    cout<<a[i]<<"\n";
}

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main(){

	int t;
	cin >> t;
	while (t--) {
		int x, y, n;
		cin >> x >> y >> n;
		if (n % x + y <= 0) {
			cout << n - n % x + y << endl;
		} else {
			cout << n - n % x - (x - y) << endl;
		}
	}

	return 0;

}


#include<iostream>
using namespace std;
int main(){
long int n,x,y,k,i,j;
cin>>n;
long int a[n]={0};
for(i=0;i<n;i++){
    cin>>x>>y>>k;
    for(j=k;j>k-x&&j>=0;j--){
        if(j%x==y){
            a[i]=j;
            break;
        }

    }
cout<<a[i]<<"\n";

}

}


#include<iostream>
using namespace std;
int main(){
long int n,x,y,k,i,j;
cin>>n;
long int a[n]={0};
for(i=0;i<n;i++){
    cin>>x>>y>>k;
    for(j=k;j>=k-11;j--){
        if(j%x==y){
            a[i]=j;
            break;
        }

    }

}

for(i=0;i<n;i++){
    cout<<a[i]<<"\n";
}

}


#include<iostream>
using namespace std;
int main(){
long int n,x,y,k,i,j;
cin>>n;
long int a[n]={0};
for(i=0;i<n;i++){
    cin>>x>>y>>k;
    for(j=k;j>=k-11&&j>=0;j--){
        if(j%x==y){
            a[i]=j;
            break;
        }

    }

}

for(i=0;i<n;i++){
    cout<<a[i]<<"\n";
}

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main(){
long int n,b,a,k,t,sum=0;
cin>>t;
for(int i=0;i<t;i++){
    cin>>a>>b>>n;
    for( k=n;k>=0;k--){
        if((k%a)==b){
            break;
        }
    }
    cout<<k<<endl;
}

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main(){

	int t;
	cin >> t;
	while (t--) {
		int x, y, n;
		cin >> x >> y >> n;
		if (y-n % x  <= 0) {
			cout << n - n % x + y << endl;
		} else {
			cout << n - n % x - (x - y) << endl;
		}
	}

	return 0;

}


#include <bits/stdc++.h>
using namespace std;

void solve(){
    int x,y,n;
    cin>>x>>y>>n;
    while(n%x!=y){
        n--;
    }
    cout<<n<<endl;
}

int main() {
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}


#include<bits/stdc++.h>
using namespace std;
int main() {
	int t, x, y, n;
	cin>>t;
	while(t--) {
		cin>>x>>y>>n;
		cout<<(n-y)/x*x+y<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

void solve(){
    int x,y,n,ans=0;
    cin>>x>>y>>n;
    for(int i=x+y;i<=n;i+=x){
    	if(i%x==y){
    		ans=i;
    	}
    }
    cout<<ans<<endl;
}

int main() {
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;

void solve(){
    int x,y,n,ans=0;
    cin>>x>>y>>n;
    while(n%x!=y){
        n--;
    }
    cout<<n<<endl;
}

int main() {
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;

void solve(){
    int x,y,n,ans=0;
    cin>>x>>y>>n;
    while(n%x!=0){
    	n--;
    }
    cout<<n+y<<endl;
}

int main() {
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;

void solve(){
    int x,y,n;
    cin>>x>>y>>n;
    while(n%x!=y){
        n++;
    }
    cout<<n-x<<endl;
}

int main() {
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;

void solve(){
    int x,y,n,ans=0;
    cin>>x>>y>>n;
    int z=n;
    while(n%x!=0 || n+y>z){
    	n--;
    }
    cout<<n+y<<endl;
}

int main() {
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}


/**
  * In the name of Lord Hanuman
**/

#include<bits/stdc++.h>
using namespace std;

#define int long long
#define in(a)                       int a; cin>>a;
#define in2(a,b)                    int a,b; cin>>a>>b;
#define in3(a,b,c)                  int a,b,c; cin>>a>>b>>c;
#define in4(a,b,c,d)                int a,b,c,d; cin>>a>>b>>c>>d;
#define in5(a,b,c,d,e)              int a,b,c,d,e; cin>>a>>b>>c>>d>>e;
#define lelo(b)                     for(auto &i:b)cin>>i;
#define ff                          first
#define ss                          second
#define call(v)                     v.begin(),v.end()
#define rall(v)                     v.rbegin(),v.rend()
#define show(x)                     for(auto t:x)cout<<t<<" ";
#define deb(x)                      cout<<#x<<" "<<x<<endl;
#define pb                          push_back
#define pob                         pop_back
#define fill(s,v)                   memset(s,v,sizeof(s))
#define endl                        "\n"
#define ce(x)                       cout<<x<<"\n";
#define nl							cout<<endl;
#define jaldi						ios_base::sync_with_stdio(false);cin.tie(NULL);

typedef pair<int,int> pii;
typedef vector<pii> vii;
typedef vector<int> vi;

const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
const int dxx[] = {1,1,0,-1,-1,-1,0,1};
const int dyy[] = {0,1,1,1,0,-1,-1,-1};

#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string>_it(_ss);err(_it,args);}
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

int gcd(int a,int b){if(!b)return a;return gcd(b,a%b);}
int lcm(int a, int b){return (a*b)/gcd(a, b);}
int modexpo(int x,int n,int M){
	if(n==0)return 1;
	else if(n%2 == 0)return modexpo((x*x)%M,n/2,M);
	else return(x*modexpo((x*x)%M,(n-1)/2,M))%M;
}
int bexpo(int x,int n){
	if(n==0)return 1;
	else if(n%2==0)return bexpo(x*x,n/2);
	else return x*bexpo(x*x,(n-1)/2);
}

bool isPrime(int n){if(n<=1)
    return false; if(n<=3) return true; if(n%2==0 || n%3==0)return false;
    for(int i=5;i*i<=n;i=i+6)if(n%i==0 || n%(i+2)==0)return false;return true;
}

const int mod=1e9+7;
const int N=4e5+5;
const int INF=1e18;

void solve(){
	in3(x,y,n);

	if(x>=n){
		ce(y);
		return;
	}

	int t=n/x;
	t=t*x;
	if(t+y<=n){
		cout<<t+y<<endl;
		return;
	}
	else{
		t-=x;
		cout<<t+y<<endl;
		return;
	}

}

int32_t main(){
	// jaldi
    int t;
    cin>>t;
    // t=1;
    while(t--){
        solve();
    }
}

/*

100
6 5 14

1
7 5 12345

7
7 5 12345
5 0 4
10 5 15
17 8 54321
499999993 9 1000000000
10 5 187
2 0 999999999

*/