There is a road with length $l$ meters. The start of the road has coordinate $0$, the end of the road has coordinate $l$.

There are two cars, the first standing at the start of the road and the second standing at the end of the road. They will start driving simultaneously. The first car will drive from the start to the end and the second car will drive from the end to the start.

Initially, they will drive with a speed of $1$ meter per second. There are $n$ flags at different coordinates $a_1, a_2, \ldots, a_n$. Each time when any of two cars drives through a flag, the speed of that car increases by $1$ meter per second.

Find how long will it take for cars to meet (to reach the same coordinate). 


-----Input-----

The first line contains one integer $t$ ($1 \leq t \leq 10^4$): the number of test cases.

The first line of each test case contains two integers $n$, $l$ ($1 \leq n \leq 10^5$, $1 \leq l \leq 10^9$): the number of flags and the length of the road.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ in the increasing order ($1 \leq a_1 < a_2 < \ldots < a_n < l$).

It is guaranteed that the sum of $n$ among all test cases does not exceed $10^5$.


-----Output-----

For each test case print a single real number: the time required for cars to meet.

Your answer will be considered correct, if its absolute or relative error does not exceed $10^{-6}$. More formally, if your answer is $a$ and jury's answer is $b$, your answer will be considered correct if $\frac{|a-b|}{\max{(1, b)}} \leq 10^{-6}$.


-----Example-----
Input
5
2 10
1 9
1 10
1
5 7
1 2 3 4 6
2 1000000000
413470354 982876160
9 478
1 10 25 33 239 445 453 468 477

Output
3.000000000000000
3.666666666666667
2.047619047619048
329737645.750000000000000
53.700000000000000



-----Note-----

In the first test case cars will meet in the coordinate $5$.

The first car will be in the coordinate $1$ in $1$ second and after that its speed will increase by $1$ and will be equal to $2$ meters per second. After $2$ more seconds it will be in the coordinate $5$. So, it will be in the coordinate $5$ in $3$ seconds.

The second car will be in the coordinate $9$ in $1$ second and after that its speed will increase by $1$ and will be equal to $2$ meters per second. After $2$ more seconds it will be in the coordinate $5$. So, it will be in the coordinate $5$ in $3$ seconds.

In the second test case after $1$ second the first car will be in the coordinate $1$ and will have the speed equal to $2$ meters per second, the second car will be in the coordinate $9$ and will have the speed equal to $1$ meter per second. So, they will meet after $\frac{9-1}{2+1} = \frac{8}{3}$ seconds. So, the answer is equal to $1 + \frac{8}{3} = \frac{11}{3}$.

Difficulty: MEDIUM
Tags: Sorting

Amortized analysis

Implementation

Dynamic programming

Mathematics
Skill types: Dynamic programming

Sorting

Amortized analysis

Starter code:

Solutions:
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	flags = list(map(int, input().split()))
	left = 0
	right = n - 1
	lspeed = 1
	rspeed = 1
	cleft = 0
	cright = l
	total = 0
	while left <= right:
		if (flags[left] - cleft) / lspeed == abs(flags[right] - cright) / rspeed:
			total += (flags[left] - cleft) / lspeed
			left += 1
			right -= 1
			cleft = flags[left - 1]
			cright = flags[right + 1]
			lspeed += 1
			rspeed += 1
		elif (flags[left] - cleft) / lspeed < abs(flags[right] - cright) / rspeed:
			timeTaken = (flags[left] - cleft) / lspeed
			lspeed += 1
			cleft = flags[left]
			cright -= timeTaken * rspeed
			left += 1
			total += timeTaken
		else:
			timeTaken = abs(flags[right] - cright) / rspeed
			rspeed += 1
			cright = flags[right]
			cleft += timeTaken * lspeed
			right -= 1
			total += timeTaken
	total += (cright - cleft) / (rspeed + lspeed)
	print(total)


for _ in range(int(input())):
	[n, l] = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	first_car = []
	second_car = []
	speed_first = 1
	speed_second = 1
	a = 0
	b = l
	t_one = 0
	t_two = 0
	for i in range(n):
		t_one += (arr[i] - a) / speed_first
		speed_first += 1
		a = arr[i]
		first_car.append(t_one)
		t_two += (b - arr[n - i - 1]) / speed_second
		speed_second += 1
		second_car.append(t_two)
		b = arr[n - i - 1]
	second_car.reverse()
	q = 0
	a = 0
	b = l
	while q < len(first_car) and first_car[q] < second_car[q]:
		t = first_car[q]
		q += 1
	flag = 0
	g = 0
	if q == 0:
		t = second_car[q]
		a = t
		b = arr[q]
	elif q == n:
		b = l - t
		a = arr[q - 1]
	elif first_car[q] == second_car[q]:
		print('%.10f' % first_car[q])
		flag = 1
	else:
		g = second_car[q] - t
		a = arr[q - 1] + g * (q + 1)
		b = arr[q]
	extra = abs(a - b)
	extra = extra / (n + 2)
	overall = t + extra + g
	if flag == 0:
		print('%.10f' % overall)


for _ in range(int(input())):
	(n, le) = map(int, input().split())
	a = [0] + [*map(int, input().split())] + [le]
	s = [y - x for (x, y) in zip(a[:-1], a[1:])]
	(l, r) = (0, n)
	(tl, tr) = (0, 0)
	while r - l > 0:
		ttl = s[l] / (l + 1)
		ttr = s[r] / (n - r + 1)
		if tl + ttl > tr + ttr:
			tr += ttr
			r -= 1
		else:
			tl += ttl
			l += 1
	(fsl, fsr) = (l + 1, n - r + 1)
	if tl > tr:
		(fsl, fsr) = (fsr, fsl)
		(tl, tr) = (tr, tl)
	print(tr + (s[r] - (tr - tl) * fsl) / (fsl + fsr))


import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def solve():
	(N, L) = map(int, input().split())
	A = [int(x) for x in input().split()]
	A = [0] + A + [L]
	t1 = [0] * len(A)
	v1 = [1] * len(A)
	for i in range(1, len(A)):
		distance = A[i] - A[i - 1]
		t1[i] = t1[i - 1] + distance / v1[i - 1]
		v1[i] = v1[i - 1] + 1
	t2 = [0] * len(A)
	v2 = [1] * len(A)
	for i in range(len(A) - 2, -1, -1):
		distance = A[i + 1] - A[i]
		t2[i] = t2[i + 1] + distance / v2[i + 1]
		v2[i] = v2[i + 1] + 1
	for i in range(len(A) - 1):
		if t1[i] <= t2[i] and t1[i + 1] >= t2[i + 1]:
			denom = v1[i] + v2[i + 1]
			nomin = A[i + 1] - A[i] + t1[i] * v1[i] + t2[i + 1] * v2[i + 1]
			return nomin / denom
TC = int(input())
for _ in range(TC):
	print('{:.8f}'.format(solve()))


import sys
import math
import heapq
input = sys.stdin.readline
YES = 'YES'
NO = 'NO'
modulo = 10 ** 9 + 7

def solve():
	(n, l) = map(int, input().split())
	flags = list(map(int, input().split()))
	flags.append(l)
	dp_left = [(0, 0)] * (n + 2)
	dp_right = [(0, 0)] * (n + 2)
	dp_right[0] = (l, 0)
	for i in range(1, n + 2):
		(x, y) = dp_left[i - 1]
		f = flags[i - 1]
		speed = i
		distance = abs(x - f)
		dp_left[i] = (f, y + distance / speed)
		(x, y) = dp_right[i - 1]
		f = flags[n - i]
		distance = abs(x - f)
		dp_right[i] = (f, y + distance / speed)
	for i in range(1, n + 2):
		(x, y) = dp_left[i]
		(xx, yy) = dp_right[n - i + 1]
		if yy <= y:
			(x, y) = dp_left[i - 1]
			speed_right = i
			speed_left = n - (i - 1) + 1
			start_distance_right = (yy - y) * speed_right + x
			rel_speed = abs(speed_right + speed_left)
			return yy + (xx - start_distance_right) / rel_speed
for _ in range(int(input())):
	print(solve())


from math import *
from bisect import *
from collections import *
from random import *
from decimal import *
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())
t = inp()
while t:
	t -= 1
	(n, l) = ma()
	a = lis()
	(i, j) = (0, n - 1)
	fc = 0
	lc = l
	spfc = 1
	splc = 1
	tot = 0
	while i <= j:
		t1 = (a[i] - fc) / spfc
		t2 = (lc - a[j]) / splc
		if t1 > t2:
			tot += t2
			lc = a[j]
			splc += 1
			j -= 1
			fc += t2 * spfc
		elif t1 < t2:
			fc = a[i]
			i += 1
			lc -= t1 * splc
			tot += t1
			spfc += 1
		else:
			tot += t1
			fc = a[i]
			lc = a[j]
			i += 1
			j -= 1
			spfc += 1
			splc += 1
	tot += (lc - fc) / (splc + spfc)
	print(tot)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	array = list(map(int, input().split()))
	i = 0
	j = n - 1
	posl = 0
	posr = l
	speedl = 1
	speedr = 1
	ans = 0
	while i <= j:
		distancel = array[i] - posl
		timel = distancel / speedl
		distancer = posr - array[j]
		timer = distancer / speedr
		if timel < timer:
			ans += timel
			i += 1
			speedl += 1
			posl = array[i - 1]
			posr = posr - timel * speedr
		elif timer < timel:
			ans += timer
			j -= 1
			speedr += 1
			posr = array[j + 1]
			posl = posl + timer * speedl
		else:
			ans += timer
			j -= 1
			i += 1
			posr = array[j + 1]
			posl = array[i - 1]
			speedr += 1
			speedl += 1
	ans += (posr - posl) / (speedl + speedr)
	print(ans)


def fun(x1, arr, d):
	x = x1
	d1 = 0
	v1 = 1
	for i in arr:
		if x <= 0 or d1 > d:
			break
		if (i - d1) / v1 <= x:
			x -= (i - d1) / v1
			d1 = i
			v1 += 1
		else:
			d1 += v1 * x
			x = 0
			break
	if x > 0:
		d1 += v1 * x
	x = x1
	d2 = d
	v2 = 1
	for i in arr[::-1]:
		if x <= 0 or d2 < 0:
			break
		if abs(d2 - i) / v2 <= x:
			x -= abs(d2 - i) / v2
			d2 = i
			v2 += 1
		else:
			d2 -= v2 * x
			x = 0
			break
	if x > 0:
		d2 -= v2 * x
	if d2 <= d1:
		return True
	return False

def proC(d, arr):
	l = 0
	h = 1000000000.0
	for i in range(100):
		mid = (l + h) / 2
		if fun(mid, arr, d):
			h = mid
		else:
			l = mid
	return h
t = int(input())
for i in range(t):
	arr1 = list(map(int, input().split()))
	(n, d) = arr1
	arr = list(map(int, input().split()))
	print(proC(d, arr))


import sys
import bisect
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(N, L) = [int(x) for x in input().split()]
		A = [0] + [int(x) for x in input().split()] + [L]
		LA = [0] * (N + 2)
		sokudo = 0
		for i in range(N + 2):
			if i == 0:
				LA[i] = 0
			else:
				LA[i] = LA[i - 1] + (A[i] - A[i - 1]) / sokudo
			sokudo += 1
		RA = [0] * (N + 2)
		sokudo = 0
		for i in range(N + 1, -1, -1):
			if i == N + 1:
				RA[i] = 0
			else:
				RA[i] = RA[i + 1] + (A[i + 1] - A[i]) / sokudo
			sokudo += 1
		ans = 0
		for i in range(N + 2):
			if RA[i] == LA[i]:
				ans = RA[i]
				break
			if LA[i] > RA[i]:
				distance = A[i] - A[i - 1]
				if LA[i - 1] > RA[i]:
					distance -= (LA[i - 1] - RA[i]) * (N - i + 2)
					ans = LA[i - 1] + distance / (i + N - i + 2)
				else:
					distance -= (RA[i] - LA[i - 1]) * i
					ans = RA[i] + distance / (i + N - i + 2)
				break
		print(ans)
main()


T = int(input())
for t in range(T):
	st = input().split()
	l = int(st[1])
	a = input().split()
	w = [0]
	for i in range(len(a)):
		w.append(int(a[i]))
	w.append(l)
	d1 = []
	p1 = 0
	t1 = 0
	v1 = 1
	for i in range(len(w)):
		d = w[i] - p1
		t1 += d / v1
		if i != 0 and i != len(w) - 1:
			v1 += 1
		p1 = w[i]
		d1.append([p1, t1, v1])
	d2 = []
	p2 = l
	t2 = 0
	v2 = 1
	for i in range(len(w) - 1, -1, -1):
		d = abs(w[i] - p2)
		t2 += d / v2
		if i != 0 and i != len(w) - 1:
			v2 += 1
		p2 = w[i]
		d2.append([p2, t2, v2])
	move = 0
	i1 = 0
	i2 = 0
	contact = False
	while True:
		if d1[i1][0] >= d2[i2][0]:
			if d1[i1][0] == d2[i2][0]:
				contact = True
			break
		if d1[i1][1] <= d2[i2][1]:
			move = 1
			i1 += 1
		else:
			move = 2
			i2 += 1
	ok = False
	if not contact:
		if move == 1:
			i1 -= 1
		else:
			i2 -= 1
	if contact:
		if d1[i1][1] > d2[i2][1]:
			i1 -= 1
		elif d1[i1][1] < d2[i2][1]:
			i2 -= 1
		else:
			ok = True
			print(d1[i1][1])
	if not ok:
		dd1 = d1[i1][0]
		dd2 = d2[i2][0]
		v1 = d1[i1][2]
		v2 = d2[i2][2]
		if d1[i1][1] < d2[i2][1]:
			dd1 += abs(d2[i2][1] - d1[i1][1]) * v1
		elif d1[i1][1] > d2[i2][1]:
			dd2 -= abs(d1[i1][1] - d2[i2][1]) * v2
		d = dd2 - dd1
		tt = d / (v1 + v2)
		print(max(d1[i1][1], d2[i2][1]) + tt)


from sys import stdin, stdout
input = stdin.readline
print = lambda x: stdout.write(str(x) + '\n')
from itertools import accumulate
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	(i, j) = (1, n - 1)
	time = 0
	tf = [0]
	s = 1
	for i in range(1, n + 2):
		tf.append((a[i] - a[i - 1]) / s)
		s += 1
	tf1 = list(accumulate(tf))
	tb = [0]
	s = 1
	for i in range(n + 1, 0, -1):
		tb.append((a[i] - a[i - 1]) / s)
		s += 1
	tb1 = list(accumulate(tb))
	tb = tb[::-1]
	tb1 = tb1[::-1]
	i = 0
	while i < n + 1:
		if tf1[i] >= tb1[i]:
			break
		i += 1
	if tf1[i] == tb1[i]:
		ans = tf1[i]
	else:
		if tf1[i - 1] == tb1[i]:
			ans = tf[i - 1] + (a[i] - a[i - 1]) / (i + n + 2 - i)
		if tf1[i - 1] < tb1[i]:
			dis = a[i - 1] + i * (tb1[i] - tf1[i - 1])
			ans = tb1[i] + (a[i] - dis) / (i + n + 2 - i)
		if tf1[i - 1] > tb1[i]:
			dis = a[i] - (n + 2 - i) * (tf1[i - 1] - tb1[i])
			ans = tf1[i - 1] + (dis - a[i - 1]) / (i + n + 2 - i)
	print(ans)


t = int(input())
while t:
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	(s1, s2) = (1, 1)
	(next1, next2) = (0, n - 1)
	(curr1, curr2) = (0, l)
	ans = 0
	while curr1 < curr2:
		if next1 > next2:
			ans += (curr2 - curr1) / (s1 + s2)
			break
		t1 = (a[next1] - curr1) / s1
		t2 = (curr2 - a[next2]) / s2
		if t1 < t2:
			curr1 += s1 * t1
			curr2 -= s2 * t1
			s1 += 1
			ans += t1
			next1 += 1
		elif t2 < t1:
			curr1 += s1 * t2
			curr2 -= s2 * t2
			s2 += 1
			ans += t2
			next2 -= 1
		else:
			curr1 += s1 * t2
			curr2 -= s2 * t2
			s2 += 1
			s1 += 1
			ans += t1
			next1 += 1
			next2 -= 1
	print('%.7f' % ans)
	t -= 1


for t in range(int(input())):
	(n, l) = list(map(int, input().split()))
	flag = list(map(int, input().split()))
	a = {}
	prvt = 0
	prvs = 1
	prvd = 0
	a[0] = [0, 1]
	for i in flag:
		tmpd = i - prvd
		tmpt = tmpd / prvs
		prvs += 1
		a[i] = [a[prvd][0] + tmpt, prvs]
		prvd = i
	if l not in flag:
		tmpd = l - prvd
		tmpt = tmpd / prvs
		a[l] = [a[prvd][0] + tmpt, prvs]
	b = {}
	prvt = 0
	prvs = 1
	prvd = l
	b[l] = [0, 1]
	flag.reverse()
	for i in flag:
		tmpd = prvd - i
		tmpt = tmpd / prvs
		prvs += 1
		b[i] = [b[prvd][0] + tmpt, prvs]
		prvd = i
	if 0 not in flag:
		tmpd = prvd - i
		tmpt = tmpd / prvs
		b[0] = [b[prvd][0] + tmpt, prvs]
	flag.reverse()
	if 0 not in flag:
		flag.insert(0, 0)
	if l not in flag:
		flag.append(l)
	for (idx, i) in enumerate(flag):
		if a[i][0] > b[i][0]:
			if idx - 1 < 0:
				prev = 0
			else:
				prev = flag[idx - 1]
			nxt = i
			speed = a[prev][1] + b[nxt][1]
			distance = a[prev][1] * (b[nxt][0] - a[prev][0])
			time = (nxt - prev - distance) / speed
			ans = b[nxt][0] + time
			break
	print(ans)


TC = int(input())
for tc in range(TC):
	(N, L) = map(int, input().split())
	A = [0]
	A.extend(map(int, input().split()))
	A.append(L)
	v = 0
	last = 0
	total = 0
	T = []
	for a in A:
		if v > 0:
			total += (a - last) / v
		T.append(total)
		v += 1
		last = a
	T2 = []
	v = 0
	last = L
	total = 0
	for a in reversed(A):
		if v > 0:
			total += (last - a) / v
		T2.append(total)
		v += 1
		last = a
	T2.reverse()
	for i in range(N + 2):
		if T[i] >= T2[i]:
			if T[i - 1] > T2[i]:
				result = (A[i] - A[i - 1] - (T[i - 1] - T2[i]) * (N + 2 - i)) / (N + 2) + T[i - 1]
			else:
				result = (A[i] - A[i - 1] - (T2[i] - T[i - 1]) * i) / (N + 2) + T2[i]
			print(result)
			break


for _ in range(0, int(input())):
	(n, l) = list(map(int, input().split(' ')))
	a = list(map(int, input().split(' ')))
	t = 0
	pos1 = 0
	pos2 = l
	v1 = 1
	v2 = 1
	i = 1
	j = 1
	a.append(l)
	a.insert(0, 0)
	n += 2
	while a[i] < a[n - j]:
		if (a[i] - pos1) / v1 < (pos2 - a[n - 1 - j]) / v2:
			t += (a[i] - pos1) / v1
			pos2 -= (a[i] - pos1) / v1 * v2
			pos1 = a[i]
			v1 += 1
			i += 1
		elif (a[i] - pos1) / v1 == (pos2 - a[n - 1 - j]) / v2:
			t += (a[i] - pos1) / v1
			pos1 = a[i]
			v1 += 1
			v2 += 1
			pos2 = a[n - 1 - j]
			i += 1
			j += 1
		else:
			t += (pos2 - a[n - 1 - j]) / v2
			pos1 += (pos2 - a[n - 1 - j]) / v2 * v1
			pos2 = a[n - 1 - j]
			v2 += 1
			j += 1
	t += (pos2 - pos1) / (v1 + v2)
	print(t)


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	A = list(map(int, input().split()))
	(left_pos, right_pos) = (0, l)
	(left_speed, right_speed) = (1, 1)
	(left_flag, right_flag) = (0, n - 1)
	time_elapsed = 0
	while left_flag <= right_flag:
		left_dist_to_flag = A[left_flag] - left_pos
		left_time = left_dist_to_flag / left_speed
		right_dist_to_flag = right_pos - A[right_flag]
		right_time = right_dist_to_flag / right_speed
		if left_time < right_time:
			time_elapsed += left_time
			left_pos += left_speed * left_time
			right_pos -= right_speed * left_time
			left_flag += 1
			left_speed += 1
		else:
			time_elapsed += right_time
			left_pos += left_speed * right_time
			right_pos -= right_speed * right_time
			right_flag -= 1
			right_speed += 1
			if left_time == right_time:
				left_flag += 1
				left_speed += 1
	dt = (right_pos - left_pos) / (left_speed + right_speed)
	time_elapsed += dt
	print(time_elapsed)


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	n += 2
	a = list(map(int, input().split()))
	a = [0] + a + [l]
	t1 = [0] * n
	t1[0] = a[0]
	for i in range(1, n):
		t1[i] = t1[i - 1] + (a[i] - a[i - 1]) / i
	t2 = [0] * n
	t2[-1] = l - a[-1]
	for i in range(n - 2, -1, -1):
		t2[i] = t2[i + 1] + (a[i + 1] - a[i]) / (n - i - 1)
	r = 0
	for i in range(n):
		if t1[i] == t2[i]:
			r = t1[i]
			break
		if t1[i] > t2[i]:
			d = a[i] - a[i - 1]
			x = (d * i + t2[i] * i * (n - i) - t1[i - 1] * i * (n - i)) / n
			r = t1[i - 1] + x / i
			break
	print(r)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	ar = list(map(int, input().split()))
	st = []
	pre = 0
	time = 0
	speed = 1
	for i in range(n):
		time += (ar[i] - pre) / speed
		pre = ar[i]
		speed += 1
		st.append(time)
	end = []
	pre = l
	time = 0
	speed = 1
	for i in range(1, n + 1):
		time += (pre - ar[-i]) / speed
		pre = ar[-i]
		speed += 1
		end.append(time)
	end = end[::-1]
	flag = True
	for i in range(n):
		t1 = round(st[i], 8)
		t2 = round(end[i], 8)
		if t1 == t2:
			print(t1)
			flag = False
			break
		elif t1 > t2:
			dis = (t1 - t2) * (i + 1)
			s1 = i + 1
			s2 = n - i + 1
			ext = dis / abs(s1 + s2)
			print(t2 + ext)
			flag = False
			break
	if flag:
		dis = l - ar[-1] - st[-1]
		print(st[-1] + dis / (2 + n))


import sys
t = int(input())
for _ in range(t):
	(n, l) = list(map(int, input().split()))
	a = list(map(int, input().split()))

	def pos(i):
		if i < 0:
			return 0
		if i >= n:
			return l
		return a[i]
	t = 0
	p1 = 0
	p2 = l
	v1 = 1
	v2 = 1
	i = 0
	j = n - 1
	while True:
		d1 = (pos(i) - p1) / v1
		d2 = (p2 - pos(j)) / v2
		d3 = (p2 - p1) / (v1 + v2)
		d = min(d1, d2, d3)
		print(p1, p2, file=sys.stderr)
		p1 += d * v1
		p2 -= d * v2
		t += d
		if d3 == d:
			break
		if d1 == d:
			v1 += 1
			i += 1
		if d2 == d:
			v2 += 1
			j -= 1
	print('{:.6f}'.format(t))


import sys, bisect as bi
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(n, l) = I()
	a = I()
	a += [l]
	tm = 0
	sp = 1
	st = 0
	an = []
	for i in range(n + 1):
		tm += (a[i] - st) / sp
		an.append(tm)
		st = a[i]
		sp += 1
	fi = l
	sp = 1
	rt = 0
	tr = tm
	rm = tm = 0
	if an[-2] <= l - a[-2]:
		x = l - an[-2]
		print(an[-2] + (x - a[-2]) / (n + 2))
		continue
	f = 0
	for i in range(n - 1, -1, -1):
		rt += (fi - a[i]) / sp
		fi = a[i]
		sp += 1
		if an[i - 1] <= rt:
			x = (rt - an[i - 1]) * (i + 1)
			if a[i - 1] + x <= a[i]:
				rm = rt + (a[i] - a[i - 1] - x) / (n + 2)
			else:
				rm = an[i - 1] + (a[i] - a[i - 1]) / (i + 1)
			f = 1
			break
		if i - 1 >= 0 and an[i] > rt and (an[i - 1] <= rt + (fi - a[i - 1]) / sp):
			x = (an[i - 1] - rt) * sp
			rm = an[i - 1] + (a[i] - a[i - 1] - x) / (n + 2)
			f = 1
			break
	if not f:
		x = rt
		print(rt + (a[0] - rt) / (n + 2))
		continue
	print(rm)


def bs(l, h):
	while h - l > 10 ** (-7):
		m = (l + h) / 2
		if gf(m):
			h = m
		else:
			l = m + 10 ** (-7)
	return l

def gf(t):
	t1 = t2 = t
	(s1, s2) = (0, l)
	v = 1
	i = 0
	while t1 > 0:
		if i < len(a) and (a[i] - s1) / v < t1:
			t1 -= (a[i] - s1) / v
			s1 = a[i]
			v += 1
			i += 1
		else:
			s1 += v * t1
			t1 = 0
	v = 1
	i = len(a) - 1
	while t2 > 0:
		if i >= 0 and (s2 - a[i]) / v < t2:
			t2 -= (s2 - a[i]) / v
			s2 = a[i]
			v += 1
			i -= 1
		else:
			s2 -= v * t2
			t2 = 0
	return s1 >= s2
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = tuple(map(int, input().split()))
	print(bs(0, l / 2))


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')

def ceil(a, b):
	return (a + b - 1) // b
file = 1

def f():
	sys.stdout.flush()

def solve():
	for _ in range(ii()):
		(n, l1) = mi()
		a = li()
		b = []
		for i in range(n - 1, -1, -1):
			b.append(a[i])

		def func(mid):
			(s1, v1, t1) = (0, 1, 0)
			for i in range(n):
				x = (a[i] - s1) / v1
				if t1 + x > mid:
					x1 = mid - t1
					s1 += v1 * x1
					t1 = mid
					break
				t1 += x
				s1 = a[i]
				v1 += 1
			if mid > t1:
				x1 = mid - t1
				s1 += v1 * x1
			(s2, v2, t2) = (l1, 1, 0)
			for i in range(n):
				x = (s2 - b[i]) / v2
				if t2 + x > mid:
					x1 = mid - t2
					s2 -= v2 * x1
					t2 = mid
					break
				t2 += x
				s2 = b[i]
				v2 += 1
			if mid > t2:
				x1 = mid - t2
				s2 -= v2 * x1
			(v1, v2) = (1, 1)
			for i in range(n):
				if a[i] > s1:
					break
				v1 += 1
			for i in range(n):
				if b[i] < s2:
					break
				v2 += 1
			return s1 >= s2
		l = 0
		r = 10 ** 9 + 5
		ans = -1
		while r - l > 10 ** (-6):
			mid = (l + r) / 2
			if func(mid):
				ans = mid
				r = mid
			else:
				l = mid
		print(ans)
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = sys.stdin.readline
solve()


import sys, io, os
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(io.IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
T = int(input())
for _ in range(T):
	(N, L) = map(int, input().split())
	A = [0] + list(map(int, input().split())) + [L]
	(ok, ng) = (500000000.0, 0)
	for iteration in range(60):
		left = 0
		c = (ok + ng) * 0.5
		t = c
		v = 1
		for (a1, a2) in zip(A, A[1:]):
			d = a2 - a1
			if t * v > d:
				left += d
				t -= d / v
				v += 1
			else:
				left += t * v
				break
		right = 0
		t = c
		v = 1
		for (a1, a2) in zip(A[::-1], A[-2::-1]):
			d = a1 - a2
			if t * v > d:
				right += d
				t -= d / v
				v += 1
			else:
				right += t * v
				break
		if left + right >= L:
			ok = c
		else:
			ng = c
	print(ok)


for __ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a.insert(0, 0)
	a.append(l)
	(i, j, va, vb, pra, prb, ta, tb) = (1, n, 1, 1, 0, l, 0, 0)
	(res, t) = (0, 0)
	while True:
		if abs(j - i) == 0:
			res = 1
		tempa = (a[i] - pra) / va
		tempb = (prb - a[j]) / vb
		ta += tempa
		tb += tempb
		if ta < tb:
			tb -= tempb
			va += 1
			pra = a[i]
			i += 1
		elif ta > tb:
			ta -= tempa
			vb += 1
			prb = a[j]
			j -= 1
		else:
			va += 1
			vb += 1
			pra = a[i]
			prb = a[j]
			i += 1
			j -= 1
			if i > j:
				res = 1
		if res:
			if ta > tb:
				prb -= (ta - tb) * vb
				print(ta + abs(pra - prb) / (va + vb))
			elif ta == tb:
				print(ta + abs(pra - prb) / (va + vb))
			else:
				pra += (tb - ta) * va
				print(tb + abs(pra - prb) / (va + vb))
			break


def solve(n, l, a):
	t = 0
	i1 = 0
	i2 = n + 1
	x1 = 0
	x2 = l
	u1 = 1
	u2 = 1
	while i1 + 1 < i2:
		if (a[i1 + 1] - x1) / u1 > (x2 - a[i2 - 1]) / u2:
			t += (x2 - a[i2 - 1]) / u2
			x1 += (x2 - a[i2 - 1]) / u2 * u1
			x2 = a[i2 - 1]
			i2 -= 1
			u2 += 1
		elif (a[i1 + 1] - x1) / u1 == (x2 - a[i2 - 1]) / u2:
			t += (x2 - a[i2 - 1]) / u2
			x2 = a[i2 - 1]
			i2 -= 1
			x1 = a[i1 + 1]
			i1 += 1
			u2 += 1
			u1 += 1
		else:
			t += (a[i1 + 1] - x1) / u1
			x2 -= (a[i1 + 1] - x1) / u1 * u2
			x1 = a[i1 + 1]
			i1 += 1
			u1 += 1
	t += (x2 - x1) / (u1 + u2)
	return t
t = int(input())
for i in range(t):
	(n, l) = map(int, input().split())
	a = [0]
	a.extend(list(map(int, input().split())))
	a.append(l)
	print(solve(n, l, a))


from bisect import *
from collections import *
from math import *
from heapq import *
from typing import List
from itertools import *
from operator import *
from functools import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

@lru_cache(None)
def fact(x):
	if x < 2:
		return 1
	return fact(x - 1) * x

@lru_cache(None)
def per(i, j):
	return fact(i) // fact(i - j)

@lru_cache(None)
def com(i, j):
	return per(i, j) // fact(j)

def linc(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t > f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rinc(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t < f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def ldec(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t < f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rdec(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t > f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def binfun(x):
	c = 1
	res = 0
	for w in arr:
		res += w
		if res > x:
			res = w
		c += 1
	return c

def lowbit(n):
	return n & -n

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class smt:

	def __init__(self, l, r, arr):
		self.l = l
		self.r = r
		self.value = (1 << 31) - 1 if l < r else arr[l]
		mid = (l + r) // 2
		if l < r:
			self.left = smt(l, mid, arr)
			self.right = smt(mid + 1, r, arr)
			self.value &= self.left.value & self.right.value

	def setvalue(self, x, val):
		if self.l == self.r:
			self.value = val
			return
		mid = (self.l + self.r) // 2
		if x <= mid:
			self.left.setvalue(x, val)
		else:
			self.right.setvalue(x, val)
		self.value = self.left.value & self.right.value

	def ask(self, l, r):
		if l <= self.l and r >= self.r:
			return self.value
		val = (1 << 31) - 1
		mid = (self.l + self.r) // 2
		if l <= mid:
			val &= self.left.ask(l, r)
		if r > mid:
			val &= self.right.ask(l, r)
		return val

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return prime

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		for v in graph[u]:
			if v not in d or d[v] > d[u] + graph[u][v]:
				d[v] = d[u] + graph[u][v]
				heappush(heap, (d[v], v))
	return d
t = N()
for i in range(t):
	(n, l) = RL()
	a = RLL()
	a1 = [0] * (n + 2)
	a2 = [0] * (n + 2)
	for i in range(1, n + 2):
		if i == 1:
			tmp = a[0]
		elif i == n + 1:
			tmp = (l - a[-1]) / (n + 1)
		else:
			tmp = (a[i - 1] - a[i - 2]) / i
		a1[i] = a1[i - 1] + tmp
	for i in range(n, -1, -1):
		if i == n:
			tmp = l - a[n - 1]
		elif i == 0:
			tmp = a[0] / (n + 1)
		else:
			tmp = (a[i] - a[i - 1]) / (n - i + 1)
		a2[i] = a2[i + 1] + tmp
	for i in range(1, n + 2):
		if a1[i] >= a2[i]:
			break
	if i == 1:
		(b, c) = (0, a[0])
	elif i == n + 1:
		(b, c) = (a[-1], l)
	else:
		(b, c) = (a[i - 2], a[i - 1])
	x = ((c - b) / (n - i + 2) + a2[i] - a1[i - 1]) / (1 / i + 1 / (n - i + 2))
	ans = a1[i - 1] + x / i
	print(ans)


T = int(input())
for t in range(T):
	(n, l) = [int(i) for i in input().split()]
	A = [0] + [int(i) for i in input().split()] + [l]
	ans = 0
	forward_speed = 1
	forward_loc = 0
	forward_next_flag = 1
	backward_speed = 1
	backward_loc = l
	backward_next_flag = len(A) - 2
	while backward_next_flag - forward_next_flag >= 0:
		forward_event = (A[forward_next_flag] - forward_loc) / forward_speed
		backward_event = (backward_loc - A[backward_next_flag]) / backward_speed
		if abs(forward_event - backward_event) < 1e-08:
			forward_loc += forward_speed * forward_event
			backward_loc -= backward_speed * backward_event
			forward_speed += 1
			backward_speed += 1
			forward_next_flag += 1
			backward_next_flag -= 1
			ans += forward_event
		elif forward_event > backward_event:
			forward_loc += forward_speed * backward_event
			backward_loc -= backward_speed * backward_event
			backward_speed += 1
			backward_next_flag -= 1
			ans += backward_event
		else:
			forward_loc += forward_speed * forward_event
			backward_loc -= backward_speed * forward_event
			forward_speed += 1
			forward_next_flag += 1
			ans += forward_event
	ans += (backward_loc - forward_loc) / (forward_speed + backward_speed)
	print(ans)


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	arr = list(map(int, input().split()))
	time = 0
	i = 0
	j = n - 1
	(p1, p2) = (0, l)
	(s1, s2) = (1, 1)
	while i <= j:
		a = (arr[i] - p1) / s1
		b = (p2 - arr[j]) / s2
		if a < b:
			time += (arr[i] - p1) / s1
			u = p1
			p1 = arr[i]
			p2 -= (arr[i] - u) / s1 * s2
			s1 += 1
			i += 1
		else:
			time += (p2 - arr[j]) / s2
			u = p2
			p2 = arr[j]
			p1 += (u - arr[j]) / s2 * s1
			s2 += 1
			j -= 1
	time += (p2 - p1) / (s2 + s1)
	print(round(time, 1000000))


import bisect

def time(loc, p):
	if loc == a[p]:
		return (dp1[int(loc)][0], dp2[int(loc)][0])
	else:
		t1 = dp1[a[p - 1]][0]
		t1 += (loc - a[p - 1]) / dp1[a[p - 1]][1]
		t2 = dp2[a[p]][0]
		t2 += (a[p] - loc) / dp2[a[p]][1]
		return (t1, t2)
for _ in range(int(input())):
	(k, l) = map(int, input().split())
	a = list(map(int, input().split()))
	dp1 = {0: (0, 1)}
	dp2 = {l: (0, 1)}
	s = 1
	temp = 0
	for i in a:
		dp1[i] = ((i - temp) / s + dp1[temp][0], s + 1)
		s += 1
		temp = i
	s = 1
	temp = l
	for i in a[::-1]:
		dp2[i] = ((temp - i) / s + dp2[temp][0], s + 1)
		s += 1
		temp = i
	low = 0
	high = l
	a.insert(0, 0)
	a.insert(k + 1, l)
	while high > low:
		mid = (high + low) / 2
		res = bisect.bisect_left(a, mid)
		(t1, t2) = time(mid, res)
		if abs(t1 - t2) < 10 ** (-6):
			break
		elif t1 > t2:
			high = mid
		else:
			low = mid
	print(t1)


from sys import stdin
input = stdin.readline

def A():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		b = list(map(int, input().split()))
		c = list(map(int, input().split()))
		p = [0] * n
		p[0] = a[0]
		for i in range(1, n - 1):
			if a[i] != p[i - 1]:
				p[i] = a[i]
			else:
				p[i] = b[i]
		if a[n - 1] != p[0] and a[n - 1] != p[n - 2]:
			p[n - 1] = a[n - 1]
		elif b[n - 1] != p[0] and b[n - 1] != p[n - 2]:
			p[n - 1] = b[n - 1]
		else:
			p[n - 1] = c[n - 1]
		print(*p)

def B():
	from math import ceil
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		a = list(map(int, input().split()))
		a = len(sorted(list(set(a))))
		if a <= k:
			print(1)
		else:
			a -= k
			if k == 1:
				print(-1)
			else:
				print(1 + ceil(a / (k - 1)))

def C():
	t = int(input())
	for _ in range(t):
		(n, l) = map(int, input().split())
		a = [0] + list(map(int, input().split())) + [l]
		t1 = [0] * (n + 2)
		v1 = [1] * (n + 2)
		t2 = [0] * (n + 2)
		v2 = [1] * (n + 2)
		for i in range(1, n + 2):
			t1[i] = (a[i] - a[i - 1]) / v1[i - 1] + t1[i - 1]
			v1[i] = v1[i - 1] + 1
		for i in range(n, -1, -1):
			t2[i] = (a[i + 1] - a[i]) / v2[i + 1] + t2[i + 1]
			v2[i] = v2[i + 1] + 1
		(A, B) = (0, 0)
		for i in range(n + 1):
			if t1[i] == t2[i]:
				(A, B) = (i, i)
				print(t1[i])
				break
			if not (t1[i + 1] < t2[i + 1] or t1[i] > t2[i]):
				(A, B) = (i, i + 1)
				break
		if A == B:
			continue
		t = (v1[A] * t1[A] + v2[B] * t2[B] + a[B] - a[A]) / (v1[A] + v2[B])
		print(t)

def D():
	t = int(input())
	for _ in range(t):
		__ = 0

def E():
	t = int(input())
	for _ in range(t):
		__ = 0

def F():
	t = int(input())
	for _ in range(t):
		__ = 0
C()


def func(l, flags: list):
	(v1, x1, v2, x2) = (1, 0, 1, l)
	t = 0
	while flags:
		if (flags[0] - x1) / v1 < (x2 - flags[-1]) / v2:
			current_t = (flags[0] - x1) / v1
			t += current_t
			x2 -= v2 * current_t
			x1 = flags.pop(0)
			v1 += 1
		else:
			current_t = (x2 - flags[-1]) / v2
			t += current_t
			x1 += v1 * current_t
			x2 = flags.pop()
			v2 += 1
	distance = x2 - x1
	v = v1 + v2
	return t + distance / v
t = int(input())
for i in range(t):
	inpt = list(map(int, input().rstrip().split()))
	flags = list(map(int, input().rstrip().split()))
	print(func(inpt[1], flags))


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	first_times = [0] * n
	first_times[0] = a[0]
	cur_speed = 2
	for i in range(1, n):
		first_times[i] = first_times[i - 1] + (a[i] - a[i - 1]) / cur_speed
		cur_speed += 1
	second_times = [0] * n
	second_times[-1] = l - a[-1]
	cur_speed = 2
	for i in range(n - 2, -1, -1):
		second_times[i] = second_times[i + 1] + abs(a[i] - a[i + 1]) / cur_speed
		cur_speed += 1
	first_times = [0] + first_times + [10 ** 12]
	second_times = [10 ** 12] + second_times + [0]
	a = [0] + a + [l]
	n += 2
	tol = 10 ** 7
	time = 0
	for i in range(n):
		if first_times[i] < second_times[i]:
			time = i
	cur_speed_1 = time + 1
	cur_speed_2 = n - time - 1
	dist1 = a[time]
	dist2 = a[time + 1]
	more_time = (dist2 - dist1 - cur_speed_2 * (first_times[time] - second_times[time + 1])) / (cur_speed_1 + cur_speed_2)
	print(first_times[time] + more_time)


P = 10 ** (-6)

def solve(A):
	low = 0.0
	high = float(L)
	d1 = 10
	d2 = 0
	while abs(d1 - d2) >= P:
		mid = (high + low) / 2.0
		d1 = distToTime1(mid)
		d2 = distToTime2(L - mid)
		if d1 < d2:
			low = mid
		else:
			high = mid
	print(d1)
t = int(input())

def distToTime1(d):
	s = 0.0
	i = 1
	prev_a = 0
	for a in A:
		if a <= d:
			s = s + float(a - prev_a) / float(i)
		else:
			break
		i = i + 1
		prev_a = a
	if prev_a < d:
		s = s + float(d - prev_a) / float(i)
	return s

def distToTime2(d):
	s = 0.0
	i = 1
	prev_a = L
	for a in reversed(A):
		if L - a <= d:
			s = s + float(prev_a - a) / float(i)
		else:
			break
		i = i + 1
		prev_a = a
	if L - prev_a < d:
		s = s + float(d - (L - prev_a)) / float(i)
	return s
for i in range(t):
	X = list(map(int, input().split()))
	n = X[0]
	L = X[1]
	A = list(map(int, input().split()))
	solve(A)


for w in range(int(input())):
	(n, l) = tuple(map(int, input().split()))
	a = list(map(int, input().split()))
	s1 = 0
	s2 = l
	c = 0
	ans = -1
	if n == 1:
		if a[0] == l / 2:
			print(a[0])
		else:
			print(abs(l - 2 * a[0]) / 3 + min(a[0], l - a[0]))
	else:
		l1 = [0] * n
		l2 = [0] * n
		for i in range(n):
			if i == 0:
				l1[i] = a[i]
			else:
				l1[i] = (a[i] - a[i - 1]) / (i + 1) + l1[i - 1]
		for i in reversed(range(n)):
			if i == n - 1:
				l2[i] = l - a[i]
			else:
				l2[i] = (a[i + 1] - a[i]) / (n - i) + l2[i + 1]
		for i in range(n):
			if l1[i] == l2[i]:
				c = 1
				ans = l1[i]
				break
		if c == 1:
			pass
			print(ans)
		else:
			for i in range(n - 1):
				if l2[i] > l1[i] and l1[i + 1] > l2[i + 1]:
					c = 1
					ans = l1[i] + ((l2[i + 1] - l1[i]) * (n - i) + a[i + 1] - a[i]) / (n + 2)
					break
			if c == 1:
				pass
				print(ans)
			elif l1[0] > l2[0]:
				print(((n + 1) * l2[0] + a[0]) / (n + 2))
			else:
				print((l - a[-1] + (n + 1) * l1[-1]) / (n + 2))


test = int(input())
for i in range(test):
	(n, l) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	c1 = 0
	c2 = l
	t = 0
	d1 = 0
	d2 = n - 1
	v1 = 1
	v2 = 1
	while True:
		if d1 >= n or d2 < 0:
			break
		t1 = abs(c1 - arr[d1]) / v1
		t2 = abs(c2 - arr[d2]) / v2
		if t1 == t2:
			if arr[d1] >= arr[d2]:
				break
			t = t + t1
			v1 = v1 + 1
			v2 = v2 + 1
			c1 = arr[d1]
			c2 = arr[d2]
			d1 = d1 + 1
			d2 = d2 - 1
		elif t1 < t2:
			if arr[d1] >= c2 - v2 * t1:
				break
			t = t + t1
			v1 = v1 + 1
			v2 = v2
			c1 = arr[d1]
			c2 = c2 - v2 * t1
			d1 = d1 + 1
			d2 = d2
		else:
			if c1 + v1 * t2 >= arr[d2]:
				break
			t = t + t2
			v1 = v1
			v2 = v2 + 1
			c2 = arr[d2]
			c1 = c1 + v1 * t2
			d1 = d1
			d2 = d2 - 1
	t = t + abs(c1 - c2) / (v1 + v2)
	print(t)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
from types import GeneratorType
mod = pow(10, 9) + 7

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	(n, L) = sp()
	arr = l()
	arr.append(L)
	arr.insert(0, 0)
	n += 2
	(a, b) = ([0.0] * n, [0.0] * n)
	a[0] = arr[0]
	b[0] = L - arr[-1]
	speed = 1
	for i in range(1, n):
		a[i] += a[i - 1] + (arr[i] - arr[i - 1]) / speed
		b[i] += b[i - 1] + (arr[-i] - arr[-(i + 1)]) / speed
		speed += 1
	answer = 0.0
	b = b[::-1]
	for i in range(n - 1):
		if a[i] <= b[i] and a[i + 1] >= b[i + 1]:
			present_pos = arr[i + 1]
			speed_b = n - i - 1
			speed_a = i + 1
			rel_speed = speed_a + speed_b
			if a[i] > b[i + 1]:
				time_diff = a[i] - b[i + 1]
				new_pos = present_pos - speed_b * time_diff
				answer = a[i] + (new_pos - arr[i]) / rel_speed
			else:
				time_diff = b[i + 1] - a[i]
				new_pos = arr[i] + speed_a * time_diff
				answer = b[i + 1] + (arr[i + 1] - new_pos) / rel_speed
			break
	out(answer)


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	A = [*map(int, input().split())]
	p1 = 0
	p2 = l
	v1 = 1
	v2 = 1
	f1 = 0
	f2 = len(A) - 1
	flags_passed = [0 for _ in range(n)]
	time = 0
	while True:
		if f1 > f2:
			break
		if all(flags_passed):
			break
		t1 = abs(A[f1] - p1) / v1
		t2 = abs(A[f2] - p2) / v2
		if t1 < t2:
			time += t1
			p1 = A[f1]
			p2 -= t1 * v2
			flags_passed[f1] = 1
			f1 += 1
			v1 += 1
		elif t1 > t2:
			time += t2
			p1 += t2 * v1
			p2 = A[f2]
			flags_passed[f2] = 1
			f2 -= 1
			v2 += 1
		else:
			time += t1
			flags_passed[f1] = 1
			flags_passed[f2] = 1
			p1 = A[f1]
			p2 = A[f2]
			f1 += 1
			f2 -= 1
			v1 += 1
			v2 += 1
	if abs(p2 - p1) > 0:
		remain_time = abs(p2 - p1) / (v1 + v2)
		time += remain_time
	print('%f' % time)


t = int(input())
for _ in range(t):
	(n, l) = [int(i) for i in input().split()]
	flags = [int(i) for i in input().split()]
	v1 = 1
	v2 = 1
	d1 = 0
	d2 = l
	t = 0
	i = 0
	j = n - 1
	while i <= j:
		x1 = flags[i] - d1
		x2 = d2 - flags[j]
		if x1 / v1 < x2 / v2:
			t += x1 / v1
			d1 = flags[i]
			d2 = d2 - v2 * x1 / v1
			v1 += 1
			i += 1
		elif x1 / v1 > x2 / v2:
			t += x2 / v2
			d2 = flags[j]
			d1 = d1 + v1 * x2 / v2
			v2 += 1
			j -= 1
		else:
			t += x1 / v1
			d1 = flags[i]
			d2 = flags[j]
			v1 += 1
			v2 += 1
			i += 1
			j -= 1
	print(t + (d2 - d1) / (v1 + v2))


t = int(input())

def f(mid):
	s = 1
	dis = 0
	for j in range(n):
		if a[j] - dis < mid * s:
			mid -= (a[j] - dis) / s
			dis = a[j]
			s = s + 1
		else:
			break
	return dis + s * mid

def f2(mid):
	s = 1
	dis = l
	for j in range(n):
		if dis - a[-j - 1] < mid * s:
			mid -= (dis - a[-j - 1]) / s
			dis = a[-j - 1]
			s = s + 1
		else:
			break
	return dis - s * mid
for j in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	low = 0
	h = l / 2
	ans = 0
	while True:
		mid = (low + h) / 2
		if abs(f(mid) - f2(mid)) < 10 ** (-6):
			ans = mid
			break
		elif f(mid) > f2(mid):
			h = mid - 1
		else:
			low = mid + 1
	print(ans)


import sys, math
input = lambda : sys.stdin.readline().rstrip()

def time1(m, cor):
	ans = 0
	last = 0
	c = 0
	speed = 1
	k = len(m)
	while True:
		if c == len(m):
			ans += (cor - last) / speed
			return ans
		elif m[c] <= cor:
			ans += (m[c] - last) / speed
			last = m[c]
			c += 1
			speed += 1
		else:
			ans += (cor - last) / speed
			return ans

def time2(m, cor, last):
	ans = 0
	speed = 1
	k = len(m) - 1
	while True:
		if k == -1:
			ans += (last - cor) / speed
			return ans
		elif m[k] >= cor:
			ans += (last - m[k]) / speed
			last = m[k]
			k -= 1
			speed += 1
		else:
			ans += (last - cor) / speed
			return ans
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	(L, R) = (0, l + 1)
	for j in range(100):
		mid = (L + R) / 2
		if time1(a, mid) > time2(a, mid, l):
			R = mid
		else:
			L = mid
	print(time1(a, L))


def solve(n, l, a):
	ca = 0
	cb = l
	i = 0
	j = n - 1
	sa = 1.0
	sb = 1.0
	ans = 0
	while i <= j:
		d1 = a[i] - ca
		d2 = cb - a[j]
		ta = d1 / sa
		tb = d2 / sb
		if ta <= tb:
			ans += ta
			ca += d1
			cb -= sb * 1.0 * ta
			sa += 1
			i += 1
		else:
			ans += tb
			cb -= d2
			ca += sa * 1.0 * tb
			sb += 1
			j -= 1
	d = cb - ca
	s = sa + sb
	ans += d / s
	return ans
t = int(input())
while t:
	(n, l) = map(int, input().split())
	res = []
	in_ = map(int, input().split(' '))
	for x in in_:
		res.append(int(x))
	print(solve(n, l, res))
	t -= 1


y = lambda : map(int, input().split())
for _ in range(int(input())):
	(n, t) = y()
	a = [0] + [*y()] + [t]
	(l, h) = (0, n + 1)
	b = c = 0
	while h - l > 1:
		d = (a[l + 1] - a[l]) / (l + 1)
		e = (a[h] - a[h - 1]) / (n + 2 - h)
		if b + d > c + e:
			c += e
			h -= 1
		else:
			b += d
			l += 1
	(f, g) = (l + 1, n + 2 - h)
	if b > c:
		(b, c, f, g) = (c, b, g, f)
	print(c + (a[h] - a[l] - (c - b) * f) / (f + g))


def acc(arr, k):
	x = 0
	y = len(arr) - 1
	(p1, p2) = (0, k)
	(v1, v2) = (1.0, 1.0)
	t = 0
	while x <= y:
		s1 = (arr[x] - p1) / v1
		s2 = (p2 - arr[y]) / v2
		if s1 < s2:
			t += s1
			v1 += 1
			p1 = arr[x]
			p2 -= v2 * s1
			x += 1
		else:
			t += s2
			v2 += 1
			p2 = arr[y]
			p1 += v1 * s2
			y -= 1
	return t + (p2 - p1) / (v1 + v2)
for i in range(int(input())):
	(a, b) = map(int, input().strip().split())
	lst = list(map(int, input().strip().split()))
	print(acc(lst, b))


lst = []
for i in range(int(input())):
	(n, l) = map(int, input().split())
	temp = list(map(int, input().split()))
	v1 = 1
	v2 = 1
	c1 = 0
	c2 = l
	c = 0
	while True:
		if temp:
			d1 = (temp[0] - c1) / v1
			d2 = (c2 - temp[-1]) / v2
			d3 = (c2 - c1) / (v1 + v2)
			if d3 < d2 and d3 < d1:
				print(c + (c2 - c1) / (v1 + v2))
				break
			if d1 < d2:
				s = d1
				c += s
				c1 += v1 * s
				c2 -= v2 * s
				v1 += 1
				del temp[0]
				if c2 > c1:
					continue
				else:
					print(c)
					break
			elif d1 == d2:
				s = d1
				c += s
				c1 += v1 * s
				c2 -= v2 * s
				v1 += 1
				v2 += 1
				del temp[0]
				if temp:
					del temp[-1]
				if c2 > c1:
					continue
				else:
					print(c)
					break
			else:
				s = d2
				c += s
				c1 += v1 * s
				c2 -= v2 * s
				v2 += 1
				del temp[-1]
				if c2 > c1:
					continue
				else:
					print(c)
					break
		else:
			print(c + (c2 - c1) / (v1 + v2))
			break


import os
import sys
from io import BytesIO, IOBase
DEBUG_MODE = False
from decimal import *
getcontext().prec = 20

def main():
	T = iin()
	while T:
		T -= 1
		(n, l) = lin()
		a = [0] + lin() + [l]
		a1 = [[1, Decimal(0)]]
		a2 = [[1, Decimal(0)]]
		for i in range(1, n + 2):
			df = Decimal(a[i] - a[i - 1])
			(speed, time) = a1[-1]
			a1.append([speed + 1, time + df / speed])
		a = a[::-1]
		for i in range(1, n + 2):
			df = Decimal(-a[i] + a[i - 1])
			(speed, time) = a2[-1]
			a2.append([speed + 1, time + df / speed])
		a = a[::-1]
		a2 = a2[::-1]
		ans = Decimal(l) / 2
		for i in range(1, n + 2):
			(l1, l2) = (a[i - 1], a[i])
			(s1, t1) = a1[i - 1]
			(s2, t2) = a2[i]
			df = l2 - l1
			if t1 <= t2:
				tdf = t2 - t1
				d1 = s1 * tdf
				if d1 > df:
					pass
				else:
					d2 = df - d1
					ans = min(ans, t2 + d2 / (s1 + s2))
			else:
				tdf = t1 - t2
				d1 = s2 * tdf
				if d1 > df:
					pass
				else:
					d2 = df - d1
					ans = min(ans, t1 + d2 / (s1 + s2))
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def iin():
	return int(input())

def lin():
	return list(map(int, input().split()))
if DEBUG_MODE == True:
	import cProfile
	cProfile.run('main()')
else:
	main()


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	A = list(map(int, input().split()))
	(ca, cb) = (0, l)
	(sa, sb) = (1, 1)
	(i, j) = (0, n - 1)
	ans = 0
	while i <= j:
		da = A[i] - ca
		db = cb - A[j]
		ta = da / sa
		tb = db / sb
		if ta <= tb:
			ans += ta
			ca += da
			cb -= sb * ta
			sa += 1
			i += 1
		else:
			ans += tb
			cb -= db
			ca += sa * tb
			sb += 1
			j -= 1
	d = cb - ca
	s = sa + sb
	t = d / s
	ans += t
	print('{:6f}'.format(ans))


def main(n, l, a):
	tf = [a[0]]
	tl = [l - a[n - 1]]
	for i in range(1, n):
		tf.append((a[i] - a[i - 1]) / (i + 1) + tf[-1])
	if tl[0] >= tf[-1]:
		if tl[0] == tf[-1]:
			return tl[0]
		return (l - a[-1] + tf[-1] * (n + 1)) / (n + 2)
	for i in range(1, n):
		tl.append(tl[-1] + (a[n - i] - a[n - i - 1]) / (i + 1))
		if tl[-1] == tf[n - i - 1]:
			return tl[-1]
		if tl[-1] > tf[n - i - 1]:
			return (a[n - i] - a[n - i - 1] + tl[i - 1] * (i + 1) + tf[n - i - 1] * (n - i + 1)) / (n + 2)
	return (a[0] + tl[-1] * (n + 1)) / (n + 2)
t = int(input())
op = []
for i in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	op.append([n, l, a])
for i in range(t):
	print(main(*op[i]))


for q in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	v1 = v2 = 1
	time = 0
	pos1 = 0
	pos2 = l
	ind1 = 0
	ind2 = n - 1
	while ind1 <= ind2:
		t1 = (a[ind1] - pos1) / v1
		t2 = (pos2 - a[ind2]) / v2
		if t1 < t2:
			time += t1
			pos1 = a[ind1]
			v1 += 1
			ind1 += 1
			pos2 -= v2 * t1
		elif t1 > t2:
			time += t2
			pos2 = a[ind2]
			v2 += 1
			ind2 -= 1
			pos1 += v1 * t2
		else:
			time += t1
			pos1 = a[ind1]
			v1 += 1
			ind1 += 1
			pos2 = a[ind2]
			v2 += 1
			ind2 -= 1
	time += (pos2 - pos1) / (v1 + v2)
	print(time)


for _ in range(int(input())):
	(n, l) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	a = [0] + a + [l]
	t1 = [0] * (n + 2)
	t2 = [0] * (n + 2)
	s1 = 1
	s2 = 1
	for i in range(1, n + 2):
		t1[i] = (a[i] - a[i - 1]) / s1
		t1[i] += t1[i - 1]
		s1 += 1
	for i in range(n, -1, -1):
		t2[i] = abs(a[i] - a[i + 1]) / s2
		t2[i] += t2[i + 1]
		s2 += 1
	pos = -1
	for i in range(0, n + 2):
		if t1[i] == t2[i]:
			print(t1[i])
			break
		elif t1[i] > t2[i]:
			pos = i
			break
	if pos == -1:
		continue
	s1 = pos
	s2 = n + 2 - pos
	time = 0
	if t1[pos - 1] <= t2[pos]:
		time += t2[pos]
		dist = a[pos] - a[pos - 1]
		rem_time = time - t1[pos - 1]
		dist -= rem_time * s1
		time += dist / (s1 + s2)
	else:
		time += t1[pos - 1]
		dist = a[pos] - a[pos - 1]
		rem_time = time - t2[pos]
		dist -= rem_time * s2
		time += dist / (s1 + s2)
	print('{:.10f}'.format(time))


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	ls = list(map(int, input().split()))
	i = 0
	j = n - 1
	pos1 = 0
	prevpos1 = None
	pos2 = l
	prevpos2 = None
	speed1 = 1
	prevspeed1 = None
	speed2 = 1
	prevspeed2 = None
	time = 0
	while i <= j:
		change1 = (ls[i] - pos1) / speed1
		change2 = (pos2 - ls[j]) / speed2
		if change1 < change2:
			prevpos1 = pos1
			prevpos2 = pos2
			prevspeed1 = speed1
			prevspeed2 = speed2
			time += change1
			pos1 = ls[i]
			i += 1
			pos2 -= speed2 * change1
			speed1 += 1
		elif change2 < change1:
			prevpos1 = pos1
			prevpos2 = pos2
			prevspeed1 = speed1
			prevspeed2 = speed2
			time += change2
			pos2 = ls[j]
			j -= 1
			speed2 += 1
			pos1 += change2 * speed1
		else:
			prevpos1 = pos1
			prevpos2 = pos2
			prevspeed1 = speed1
			prevspeed2 = speed2
			time += change1
			pos1 = ls[i]
			pos2 = ls[j]
			i += 1
			j -= 1
			speed1 += 1
			speed2 += 1
	if pos1 > pos2:
		extratime = (prevpos2 - prevpos1) / (prevspeed1 + prevspeed2)
		time -= extratime
	elif pos1 < pos2:
		lefttime = (pos2 - pos1) / (speed1 + speed2)
		time += lefttime
	print(time)


N = 100002
ta = [0] * N
tb = [0] * N
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	tb[n + 1] = 0
	i = 1
	j = n
	while i <= n:
		ta[i] = ta[i - 1] + (a[i] - a[i - 1]) / i
		tb[j] = tb[j + 1] + (a[j + 1] - a[j]) / i
		i += 1
		j -= 1
	i = 1
	j = n
	while i < j:
		if ta[i] < tb[j]:
			i += 1
		else:
			j -= 1
	if ta[i] < tb[i]:
		print(str(ta[i] + (a[i + 1] - a[i] - (n - i + 1) * (ta[i] - tb[i + 1])) / (n + 2)))
	elif ta[i] > tb[i]:
		print(str(tb[i] + (a[i] - a[i - 1] - i * (tb[i] - ta[i - 1])) / (n + 2)))
	else:
		print(str(ta[i]))


import bisect
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	tl = [0] * (n + 2)
	tr = [0] * (n + 2)
	(vl, vr) = (1, 1)
	for i in range(1, n + 2):
		tl[i] = tl[i - 1] + (a[i] - a[i - 1]) / vl
		vl += 1
	for i in range(0, n + 1)[::-1]:
		tr[i] = tr[i + 1] + (a[i + 1] - a[i]) / vr
		vr += 1
	ans = 10 ** 9
	for i in range(0, n + 1):
		if tl[i] <= tr[i] and tl[i + 1] >= tr[i + 1]:
			d = a[i + 1] - a[i]
			if tr[i + 1] > tl[i]:
				d -= (i + 1) * (tr[i + 1] - tl[i])
			else:
				d -= (n - i + 1) * (tl[i] - tr[i + 1])
			tt = max(tl[i], tr[i + 1]) + d / (n + 2)
			ans = min(ans, tt)
	print(ans)


for tc in range(int(input())):
	(n, l) = map(int, input().split())
	f = list(map(int, input().split()))
	t = 0
	s1 = 1
	s2 = 1
	p1 = 0
	p2 = n - 1
	d1 = 0
	d2 = l
	while p1 <= p2:
		step1 = (f[p1] - d1) / s1
		step2 = (d2 - f[p2]) / s2
		if step1 < step2:
			stept = step1
			p1 += 1
		else:
			stept = step2
			p2 -= 1
		t += stept
		d1 += s1 * stept
		d2 -= s2 * stept
		if step1 < step2:
			s1 += 1
		else:
			s2 += 1
	t += (d2 - d1) / (s2 + s1)
	print(t)


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	v0 = 1
	v1 = 1
	x0 = 0
	x1 = l
	t = 0
	i0 = 0
	i1 = n + 1
	while i0 + 1 != i1:
		move0 = (a[i0 + 1] - x0) / v0
		move1 = (x1 - a[i1 - 1]) / v1
		if move0 < move1:
			i0 += 1
			x0 = a[i0]
			v0 += 1
			x1 -= v1 * move0
			t += move0
		else:
			i1 -= 1
			x1 = a[i1]
			v1 += 1
			x0 += v0 * move1
			t += move1
	if x0 < x1:
		t += (x1 - x0) / (v0 + v1)
	print(t)


import sys, heapq
input = sys.stdin.readline
err = 1e-08

def solve():
	(n, l) = map(int, input().split())
	al = list(map(int, input().split()))
	va = vb = 1
	da = db = 0
	(a, b) = (-1, n)
	time = 0
	ta = 0
	tb = n
	while da < l - db:
		if b - a <= 1 or (abs(ta - tb) < err and a + 1 == n - b - 1):
			time += (l - db - da) / (va + vb)
			break
		ta = (al[a + 1] - da) / va
		tb = (l - al[b - 1] - db) / vb
		time += min(ta, tb)
		if abs(ta - tb) < err:
			a += 1
			b -= 1
			va += 1
			vb += 1
			da = al[a]
			db = l - al[b]
		elif ta < tb:
			a += 1
			da = al[a]
			va += 1
			db += ta * vb
		else:
			b -= 1
			db = l - al[b]
			vb += 1
			da += tb * va
	print(time)

def main():
	t = int(input())
	for _ in range(t):
		solve()
main()


import sys
import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
setrecursionlimit(2 ** 20)
M = 10 ** 9 + 7
T = int(stdin.readline())
for _ in range(T):
	(n, l) = list(map(int, stdin.readline().split()))
	a = [0] + list(map(int, stdin.readline().split())) + [l]
	h = len(a)
	pre = [0] * h
	suf = [0] * h
	for i in range(h - 1):
		pre[i + 1] = pre[i] + (a[i + 1] - a[i]) / (i + 1)
		suf[h - i - 2] = suf[h - i - 1] + (a[h - 1 - i] - a[h - 2 - i]) / (i + 1)
	for i in range(h):
		if pre[i] >= suf[i]:
			meet = i
			break
	gap = a[meet] - a[meet - 1]
	cons = pre[meet - 1] * meet + suf[meet] * (n + 2 - meet)
	ans = (gap + cons) / (n + 2)
	print(ans)


def find(d1, d2, s1, s2, t2_indx):
	(t1, t2) = (f[t2_indx - 1], r[n - t2_indx + 1])
	d1n = d1 + (t2 - t1) * s1
	del_d = d2 - d1n
	d1n += del_d / (s2 / s1 + 1)
	return t1 + (d1n - d1) / s1

def time(g, s):
	return g / s
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a.insert(0, 0)
	a.append(l)
	(f, r) = ([0], [0])
	s = 1
	N = n + 2
	for i in range(1, N):
		f.append(f[-1] + time(a[i] - a[i - 1], s))
		r.append(r[-1] + time(a[-i] - a[-1 - i], s))
		s += 1
	size = len(f)
	tmp = 0
	for i in range(size):
		if f[i] > r[size - 1 - i]:
			tmp = i
			break
	first = a[tmp - 1]
	sec = a[tmp]
	s1 = len(a[:tmp])
	s2 = n + 2 - s1
	print(find(first, sec, s1, s2, tmp))


from math import inf
T = int(input())
for _ in range(T):
	(N, L) = map(int, input().split())
	a = list(map(int, input().split()))
	(l, r) = (0, N - 1)
	(s1, s2) = (1, 1)
	(d1, d2) = (0, L)
	time = 0
	error = 10 ** (-8)
	while True:
		rb = (d2 - d1) / (s1 + s2)
		r1 = (a[l] - d1) / s1 if l <= r else inf
		r2 = (d2 - a[r]) / s2 if l <= r else inf
		small = min((rb, r1, r2))
		time += small
		d1 += small * s1
		d2 -= small * s2
		if rb - small < error:
			break
		if r1 - small < error:
			s1 += 1
			l += 1
		if r2 - small < error:
			s2 += 1
			r -= 1
	print(time)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	tim = 0.0
	pi = 0.0
	pj = float(k)
	ci = 1.0
	cj = 1.0
	i = 0
	j = n - 1
	while i <= j:
		ta = min((a[i] - pi) / ci, (pj - a[j]) / cj)
		tim += ta
		pi += ci * ta
		pj -= cj * ta
		if pi >= a[i]:
			i += 1
			ci += 1
		if pj <= a[j]:
			cj += 1
			j -= 1
	tim += (pj - pi) / (ci + cj)
	print(tim)


t = int(input())
while t:
	(f, n) = map(int, input().split())
	flag = [0]
	temp = list(map(int, input().split()))
	for i in temp:
		flag.append(i)
	flag.append(n)
	time1 = []
	time2 = []
	for i in range(f + 2):
		time1.append(0)
		time2.append(0)
	speed = 1
	for i in range(1, f + 2):
		time1[i] = time1[i - 1] + (flag[i] - flag[i - 1]) / speed
		speed += 1
	speed = 1
	for i in range(f, -1, -1):
		time2[i] = time2[i + 1] + (flag[i + 1] - flag[i]) / speed
		speed += 1
	for i in range(f + 2):
		if time1[i] > time2[i]:
			t1 = time1[i - 1]
			t2 = time2[i]
			d = flag[i] - flag[i - 1]
			s1 = i
			s2 = f - i + 2
			ans = (t1 * s1 + t2 * s2 + d) / (s1 + s2)
			print(ans)
			break
	t -= 1


def solve():
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	fl1 = 0
	fl2 = n - 1
	s = 0
	e = l
	v1 = 1
	v2 = 1
	total = 0
	while fl1 <= fl2:
		t1 = (a[fl1] - s) / v1
		t2 = (e - a[fl2]) / v2
		if t1 <= t2:
			s += t1 * v1
			e -= t1 * v2
			v1 += 1
			fl1 += 1
			total += t1
		else:
			s += t2 * v1
			e -= t2 * v2
			v2 += 1
			fl2 -= 1
			total += t2
	total += (e - s) / (v1 + v2)
	print(total)
	return

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()
main()


from collections import defaultdict

def solve():
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	start = 0
	end = l
	si = 0
	ei = n - 1
	ss = 1
	es = 1
	time = 0
	while start < end and si <= ei:
		diss = a[si] - start
		dise = end - a[ei]
		ts = diss / ss
		te = dise / es
		if ts < te:
			time += ts
			start = a[si]
			end = end - es * ts
			si += 1
			ss += 1
		elif ts > te:
			time += te
			end = a[ei]
			start = start + ss * te
			ei -= 1
			es += 1
		else:
			time += ts
			start = a[si]
			end = a[ei]
			si += 1
			ei -= 1
			ss += 1
			es += 1
	if si > ei:
		time += (end - start) / (ss + es)
	return time
for j in range(int(input())):
	print(solve())


import sys
input = sys.stdin.readline

def judge(x):
	total = 0
	speed = 1
	pre = 0
	t = x
	for i in range(1, n + 2):
		if (a[i] - pre) / speed <= t:
			t -= (a[i] - pre) / speed
			speed += 1
			pre = a[i]
		else:
			total += pre + speed * t
			break
	else:
		return True
	speed = 1
	pre = l
	t = x
	for i in range(n, -1, -1):
		if (pre - a[i]) / speed <= t:
			t -= (pre - a[i]) / speed
			speed += 1
			pre = a[i]
		else:
			total += l - pre + speed * t
			break
	else:
		return True
	return total >= l

def binary_search():
	(l, r) = (0, 10 ** 9)
	while r - l >= 1e-07:
		m = (l + r) / 2
		if judge(m):
			r = m
		else:
			l = m
	return l
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	print(binary_search())


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	tcount = 0
	sp = 0
	ss = 1
	ep = l
	es = 1
	t = 0
	while n > 0:
		k1 = (a[0] - sp) / ss
		k2 = (ep - a[-1]) / es
		if k1 < k2:
			tcount += k1
			a.pop(0)
			sp += ss * k1
			ep -= es * k1
			ss += 1
		elif k1 > k2:
			tcount += k2
			a.pop()
			sp += ss * k2
			ep -= es * k2
			es += 1
		elif n == 1:
			tcount += k1
			t = 1
			break
		else:
			tcount += k1
			a.pop(0)
			a.pop()
			sp += ss * k1
			ep -= es * k1
			ss += 1
			es += 1
			n -= 1
		n -= 1
	if t == 0:
		tcount += (ep - sp) / (es + ss)
	print(str(tcount) + '0' * 15)


from sys import stdin
stdin.readline

def mp():
	return list(map(int, stdin.readline().strip().split()))

def it():
	return int(stdin.readline().strip())
for _ in range(it()):
	(n, l) = mp()
	a = mp()
	(i, j, sp, ep, ss, es) = (0, n - 1, 0, l, 1, 1)
	t = 0
	while i <= j:
		d1 = a[i] - sp
		d2 = ep - a[j]
		t1 = d1 / ss
		t2 = d2 / es
		if t2 > t1:
			ss += 1
			sp = a[i]
			ep -= t1 * es
			i += 1
			t += t1
		elif t1 > t2:
			es += 1
			ep = a[j]
			sp += t2 * ss
			j -= 1
			t += t2
		else:
			es += 1
			ss += 1
			ep = a[j]
			sp = a[i]
			i += 1
			j -= 1
			t += t1
	t += (ep - sp) / (es + ss)
	print(t)


import os
from sys import stdin, stdout

class Input:

	def __init__(self):
		self.lines = stdin.readlines()
		self.idx = 0

	def line(self):
		try:
			return self.lines[self.idx].strip()
		finally:
			self.idx += 1

	def array(self, sep=' ', cast=int):
		return list(map(cast, self.line().split(sep=sep)))

	def known_tests(self):
		(num_of_cases,) = self.array()
		for case in range(num_of_cases):
			yield self

	def unknown_tests(self):
		while self.idx < len(self.lines):
			yield self

def problem_solver():

	def solver(inpt):
		(n, l) = inpt.array()
		a = [0] + inpt.array() + [l]
		tl = [0]
		m = len(a)
		v = 1
		for i in range(1, m):
			tl.append(tl[-1] + (a[i] - a[i - 1]) / v)
			v += 1
		tr = [0 for i in range(m)]
		v = 1
		for i in range(m - 2, -1, -1):
			tr[i] = tr[i + 1] + (a[i + 1] - a[i]) / v
			v += 1
		le = 0
		ri = m - 1
		while le + 1 < ri:
			if tl[le + 1] < tr[ri - 1]:
				le += 1
			else:
				ri -= 1
		d = a[ri] - a[le]
		vl = le + 1
		vr = m - ri
		t = max(tl[le], tr[ri])
		tmin = min(tl[le], tr[ri])
		if tl[le] < tr[ri]:
			d -= (t - tmin) * vl
		else:
			d -= (t - tmin) * vr
		t += d / (vl + vr)
		print('{:.15f}'.format(t))
	return solver
try:
	solver = problem_solver()
	for tc in Input().known_tests():
		solver(tc)
except Exception as e:
	import traceback
	traceback.print_exc(file=stdout)


import os, sys
from collections import defaultdict, Counter
from io import BytesIO, IOBase
from math import ceil

def main():
	for i in range(int(input())):
		(n, p) = map(int, input().split())
		a = [int(X) for X in input().split()]
		a = [0] + a + [p]
		if n == 1:
			z = min(a[1], p - a[1])
			print(z + (p - 2 * z) / 3)
		else:
			(x, y) = ([0, a[1]], [0, p - a[-2]])
			for j in range(1, n):
				x.append(x[-1] + (a[j + 1] - a[j]) / (j + 1))
				y.append(y[-1] + abs(a[n - j] - a[n - j + 1]) / (j + 1))
			x.append(x[-1] + (p - a[-2]) / (n + 1))
			y.append(y[-1] + a[1] / (n + 1))
			y = y[::-1]
			q = -1
			for j in range(n + 2):
				if y[j] < x[j]:
					q = j
					break
			if x[q - 1] < y[q]:
				t = (x[q - 1] - y[q]) * q
				print(y[q] + (abs(a[q - 1] - a[q]) - abs(t)) / (n + 2))
			else:
				t = abs(x[q - 1] - y[q]) * (n - q + 2)
				print(x[q - 1] + (abs(a[q - 1] - a[q]) - abs(t)) / (n + 2))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, l) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	n += 2
	arr = arr + [l]
	arr = [0] + arr
	v = 1
	ans1 = [0]
	total = 0
	for i in range(1, n):
		time = (arr[i] - arr[i - 1]) / v
		total += time
		ans1.append(total)
		v += 1
	v = 1
	ans2 = [0]
	total = 0
	for i in range(n - 1, 0, -1):
		time = (arr[i] - arr[i - 1]) / v
		total += time
		ans2.append(total)
		v += 1
	ans2 = ans2[::-1]
	b = 0
	ok = 0
	for i in range(len(ans1)):
		if ans1[i] == ans2[i]:
			print(ans1[i])
			ok = 1
		if ans1[i] > ans2[i]:
			b = i
			break
	if ok == 0:
		v1 = b
		v2 = n - b
		t1 = ans1[b - 1]
		t2 = ans2[b]
		dist = arr[b] - arr[b - 1]
		if t2 > t1:
			ev = (t2 - t1) * v1
			to_go = dist - ev
			to_go /= v1 + v2
			ans = max(t1, t2) + to_go
		else:
			ev = (t1 - t2) * v2
			to_go = dist - ev
			to_go /= v1 + v2
			ans = max(t1, t2) + to_go
		print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from bisect import bisect_left as bsl
for j in range(int(input())):
	(n, l) = map(int, input().split())
	vals = list(map(int, input().split()))
	right = [(0, 0, 1)]
	speed = 1
	last = l
	time = 0
	for s in range(n - 1, -1, -1):
		before = right[-1]
		dist = before[0]
		time = before[1]
		speed = before[2]
		dist += last - vals[s]
		time += (last - vals[s]) / speed
		speed += 1
		last = vals[s]
		right.append((dist, time, speed))
	right.reverse()
	tt = 0
	time = 0
	last = 0
	speed = 1
	for s in range(-1, n):
		if s == -1:
			timedif = right[s + 1][1]
			if speed * timedif + right[s + 1][0] <= l:
				tim = right[s + 1][1]
				tim += (vals[s + 1] - speed * timedif - 0) / (speed + right[s + 1][2])
				tt = tim
		else:
			time += (vals[s] - last) / speed
			speed += 1
			last = vals[s]
			if time <= right[s + 1][1]:
				timedif = right[s + 1][1] - time
				if last + speed * timedif + right[s + 1][0] <= l:
					tim = right[s + 1][1]
					if s < n - 1:
						tim += (vals[s + 1] - speed * timedif - vals[s]) / (speed + right[s + 1][2])
					else:
						tim += (l - speed * timedif - vals[s]) / (speed + right[s + 1][2])
					tt = tim
			else:
				timedif = time - right[s + 1][1]
				if last + right[s + 1][2] * timedif + right[s + 1][0] <= l:
					tim = time
					if s < n - 1:
						tim += (vals[s + 1] - right[s + 1][2] * timedif - vals[s]) / (speed + right[s + 1][2])
					else:
						tim += (l - right[s + 1][2] * timedif - vals[s]) / (speed + right[s + 1][2])
					tt = tim
	print(tt)


def solve(n, L, arr):
	time1 = [0, arr[0]]
	time2 = [0, L - arr[-1]]
	for i in range(1, n):
		time1.append((arr[i] - arr[i - 1]) / (i + 1) + time1[-1])
		time2.append((arr[n - i] - arr[n - i - 1]) / (i + 1) + time2[-1])
	time1.append((L - arr[-1]) / (n + 1) + time1[-1])
	time2.append(arr[0] / (n + 1) + time2[-1])
	time2.reverse()
	meet = 0
	while time1[meet] < time2[meet]:
		meet += 1
	(t1, t2) = (time1[meet - 1], time1[meet])
	(t3, t4) = (time2[meet], time2[meet - 1])
	if time1[meet] == time2[meet]:
		return time1[meet]
	return (t2 * t4 - t1 * t3) / (t4 + t2 - t3 - t1)
t = int(input())
for i in range(t):
	(n, L) = map(int, input().split())
	arr = list(map(int, input().split()))
	print(solve(n, L, arr))


y = lambda : [*map(int, input().split())]
for _ in range(int(input())):
	(n, t) = map(int, input().split())
	a = [0] + y() + [t]
	(l, h) = (0, n + 1)
	tl = th = 0
	while h - l > 1:
		dl = (a[l + 1] - a[l]) / (l + 1)
		dh = (a[h] - a[h - 1]) / (n + 2 - h)
		if tl + dl > th + dh:
			th += dh
			h -= 1
		else:
			tl += dl
			l += 1
	(sh, sl) = (n + 2 - h, l + 1)
	if tl > th:
		(tl, th) = (th, tl)
		(sh, sl) = (sl, sh)
	print(th + (a[h] - a[l] - (th - tl) * sl) / (sh + sl))


import sys
input = sys.stdin.readline
from bisect import bisect_right
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	A = list(map(int, input().split()))
	c1 = []
	speed = 1
	x = 0
	t = 0.0
	for a in A:
		t += (a - x) / speed
		c1.append(t)
		speed += 1
		x = a
	c2 = []
	speed = 1
	x = l
	t = 0.0
	for a in reversed(A):
		t += (x - a) / speed
		c2.append(t)
		speed += 1
		x = a
	lo = 0.0
	hi = float(l)
	while hi - lo > 1e-07:
		m = (lo + hi) / 2
		i1 = bisect_right(c1, m) - 1
		if i1 == -1:
			x1 = m
		else:
			tpass = c1[i1]
			textra = m - tpass
			x1 = A[i1] + textra * (i1 + 2)
		i2 = bisect_right(c2, m) - 1
		if i2 == -1:
			x2 = l - m
		else:
			tpass = c2[i2]
			textra = m - tpass
			x2 = A[-1 - i2] - textra * (i2 + 2)
		if x1 < x2:
			lo = m
		else:
			hi = m
	print((lo + hi) / 2)


from decimal import Decimal as dcm
from decimal import *
testCase = int(input())
for tc in range(testCase):
	(s, l) = map(int, input().split())
	(x1, x2, t) = map(dcm, [0, l, 0])
	(p1, p2, v1, v2) = (0, s, 1, 1)
	signs = list(map(dcm, input().split()))
	while p1 != p2:
		(t1, t2) = ((signs[p1] - x1) / v1, (x2 - signs[p2 - 1]) / v2)
		if t1 == t2:
			v1 += 1
			v2 += 1
			if p1 + 1 != p2:
				(x1, x2) = (signs[p1], signs[p2 - 1])
				t += t1
				p1 += 1
				p2 -= 1
			else:
				t += t1
				x1 = x2
				p1 += 1
		else:
			flag = t1 < t2
			t += min(t1, t2)
			if flag:
				x1 = signs[p1]
				x2 -= t1 * v2
				p1 += 1
				v1 += 1
			else:
				x2 = signs[p2 - 1]
				x1 += t2 * v1
				p2 -= 1
				v2 += 1
	x = dcm(x2 - x1)
	v = dcm(v1 + v2)
	t += x / v
	getcontext().prec = 16
	t = str(t)
	if '.' not in t:
		t += '.'
	print(t + '0' * (15 - len(t.split('.')[-1])))


t = int(input())
while t:
	(n, l) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	tm = 0
	(p1, p2) = (0, l)
	(v1, v2) = (1, 1)
	(m1, m2) = (0, n - 1)
	while m1 <= m2 and m1 < n and (m2 >= 0):
		k1 = (arr[m1] - p1) / v1
		k2 = (p2 - arr[m2]) / v2
		if k1 < k2:
			tm += k1
			p1 = arr[m1]
			v1 += 1
			p2 -= k1 * v2
			m1 += 1
		elif k1 > k2:
			tm += k2
			p2 = arr[m2]
			v2 += 1
			m2 -= 1
			p1 += k2 * v1
		else:
			tm += k1
			p1 = arr[m1]
			p2 = arr[m2]
			m1 += 1
			m2 -= 1
			v1 += 1
			v2 += 1
	print(tm + (p2 - p1) / (v1 + v2))
	t -= 1


def check():
	if False:
		print('check')

def solve():
	for _ in range(int(input())):
		(n, l) = list(map(int, input().split()))
		f = list(map(int, input().split()))
		(s, e, i, j) = (0, l, 0, n - 1)
		(s1, s2) = (1, 1)
		tstt = 0
		check()
		check()
		check()
		check()
		while not not j >= i:
			c = f[i] - s
			c /= s1
			d = e - f[j]
			d /= s2
			if not not c < d and True:
				tstt += c
				s = f[i]
				e -= c * s2
				s1 += 1
				i += 1
			elif not not d < c and True:
				tstt = tstt + d
				s = s + d * s1
				e = f[j]
				s2 = s2 + 1
				j = j - 1
			else:
				tstt = tstt + c
				s1 = s1 + 1
				s2 = s2 + 1
				s = f[i]
				e = f[j]
				i = i + 1
				j = j - 1
		tstt = tstt + (e - s) / (s1 + s2)
		check()
		check()
		print('%.8f' % tstt)
solve()


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	one = [(1, 0, 0), (2, a[0], a[0])]
	speed = 2
	time = a[0]
	onet = [0, a[0]]
	for i in range(1, n):
		time += (a[i] - a[i - 1]) / speed
		speed += 1
		one.append((speed, time, a[i]))
		onet.append(time)
	second = [(1, 0, 0), (2, l - a[-1], l - a[-1])]
	speed = 2
	time = l - a[-1]
	secondt = [0, l - a[-1]]
	for i in reversed(range(n - 1)):
		time += (a[i + 1] - a[i]) / speed
		speed += 1
		second.append((speed, time, l - a[i]))
		secondt.append(time)
	import bisect

	def f(time):
		i = bisect.bisect_right(onet, time) - 1
		j = bisect.bisect_right(secondt, time) - 1
		res = one[i][2] + second[j][2] + one[i][0] * (time - onet[i]) + second[j][0] * (time - secondt[j]) >= l
		return res
	(lb, ub) = (0, l)
	for i in range(100):
		mid = (lb + ub) / 2
		if f(mid):
			ub = mid
		else:
			lb = mid
	print(ub)


t = int(input())
for case in range(t):
	(n, l) = [int(x) for x in input().split(' ')]
	a = [int(x) for x in input().split(' ')]
	cars = [[[0, 0, 1]], [[l, 0, 1]]]
	while len(a) > 0:
		if cars[0][-1][1] + abs(a[-0] - cars[0][-1][0]) / cars[0][-1][-1] <= cars[1][-1][1] + abs(a[-1] - cars[1][-1][0]) / cars[-1][-1][-1]:
			i = 0
		else:
			i = 1
		cars[i].append([a[-i], cars[i][-1][1] + abs(a[-i] - cars[i][-1][0]) / cars[i][-1][-1], cars[i][-1][-1] + 1])
		del a[-i]
	ans = (cars[1][-1][0] - cars[0][-1][0] + cars[0][-1][1] * cars[0][-1][-1] + cars[1][-1][1] * cars[1][-1][-1]) / (cars[0][-1][-1] + cars[1][-1][-1])
	print(ans)


def bsearch(mn, mx, func):
	idx = (mx + mn) // 2
	while mx - mn > 1:
		if func(idx):
			(idx, mx) = ((idx + mn) // 2, idx)
			continue
		(idx, mn) = ((idx + mx) // 2, idx)
	return idx
(T,) = map(int, input().split())
for _ in range(T):
	(N, L) = map(int, input().split())
	X = [0] + list(map(int, input().split())) + [L]
	Y = [0] * (N + 2)
	Z = [0] * (N + 2)
	for i in range(1, N + 2):
		Y[i] = Y[i - 1] + (X[i] - X[i - 1]) / i
	for i in range(N, -1, -1):
		Z[i] = Z[i + 1] + (X[i + 1] - X[i]) / (N - i + 1)
	for i in range(N + 1):
		(a, b) = (Y[i], Y[i + 1])
		(c, d) = (Z[i + 1], Z[i])
		if not (d < a or b < c):
			(va, vb) = (i + 1, N - i + 1)
			(ta, tb) = (a, c)
			break
	ll = X[i + 1] - X[i]
	(mx, mn) = (ll, 0)
	idx = (mx + mn) / 2
	for _ in range(1000):
		tx = ta + idx / va
		ty = tb + (ll - idx) / vb
		if tx > ty:
			(idx, mx) = ((idx + mn) / 2, idx)
		else:
			(idx, mn) = ((idx + mx) / 2, idx)
	print(ta + idx / va)


for i in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	fr = 0
	en = l
	frc = 0
	enc = n - 1
	sumo = 0
	frs = 1
	ens = 1
	while enc >= frc:
		frx = (a[frc] - fr) / frs
		enx = (en - a[enc]) / ens
		btw = (en - fr) / (frs + ens)
		k = min(frx, enx, btw)
		if frx == k:
			sumo = sumo + k
			fr = a[frc]
			frs = frs + 1
			frc = frc + 1
			en = en - frx * ens
		elif enx == k:
			sumo = sumo + k
			en = a[enc]
			ens = ens + 1
			enc = enc - 1
			fr = fr + enx * frs
	sumo = sumo + (en - fr) / (ens + frs)
	print(sumo)


def solve(s, a):
	(s1, s2) = (0, s)
	(v1, v2) = (1, 1)
	t = 0
	(i, j) = (0, len(a) - 1)
	while s1 < s2:
		t1 = (a[i] - s1) / v1
		t2 = (s2 - a[j]) / v2
		if t1 < t2:
			t += t1
			s1 = a[i]
			v1 += 1
			i += 1
			s2 -= v2 * t1
		elif t2 < t1:
			t += t2
			s2 = a[j]
			v2 += 1
			j -= 1
			s1 += v1 * t2
		else:
			t += t1
			s1 = a[i]
			i += 1
			s2 = a[j]
			j -= 1
			v1 += 1
			v2 += 1
		if i - j == 1:
			t += (s2 - s1) / (v1 + v2)
			break
	return t

def main():
	t = int(input())
	for _ in range(t):
		(n, s) = (int(val) for val in input().split())
		a = [int(val) for val in input().split()]
		result = solve(s, a)
		print(result)
main()


from sys import stdin, stdout
from bisect import *

def calc(T, arr):
	M = {}
	(D, S, T) = ([0], [1], [0])
	M[0] = (0, 1)
	c = 0
	t = 0
	for i in range(1, len(arr)):
		d = arr[i] - arr[i - 1]
		c += 1
		t += d / c
		M[t] = (d, c)
		D.append(arr[i])
		T.append(t)
		S.append(c + 1)
	return [T, D, S]

def findT(M, T):
	ti = bisect_right(M[0], T) - 1
	t = M[0][ti]
	d = M[1][ti]
	s = M[2][ti]
	return d + (T - t) * s

def find(arr, N, L):
	arr.insert(0, 0)
	arr.append(L)
	arr2 = [L - i for i in arr[::-1]]
	A = calc(0, arr)
	B = calc(0, arr2)
	i = 0
	j = min(A[0][-1], B[0][-1])
	pres = 10 ** (-6)
	while 1:
		m = (j + i) / 2
		a = findT(A, m)
		b = findT(B, m)
		if abs(a + b - L) <= pres:
			return m
		if a + b > L:
			j = m - 10 ** (-10)
		else:
			i = m + 10 ** (-10)

def main():
	for _ in range(int(stdin.readline())):
		(N, L) = list(map(int, stdin.readline().split()))
		arr = list(map(int, stdin.readline().split()))
		print(find(arr, N, L))
main()


import os
import sys
from io import BytesIO, IOBase

def solution():
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	i = 0
	j = n - 1
	curr1 = 0
	curr2 = l
	speed1 = 1
	speed2 = 1
	time = 0
	while True:
		if i > j:
			time += (curr2 - curr1) / (speed1 + speed2)
			break
		t1 = (a[i] - curr1) / speed1
		t2 = (curr2 - a[j]) / speed2
		if t1 < t2:
			curr1 = a[i]
			speed1 += 1
			i += 1
			curr2 = curr2 - t1 * speed2
			time += t1
		elif t2 < t1:
			curr2 = a[j]
			speed2 += 1
			j -= 1
			curr1 = curr1 + t2 * speed1
			time += t2
		else:
			curr1 = a[i]
			curr2 = a[j]
			speed1 += 1
			speed2 += 1
			i += 1
			j -= 1
			time += t1
	print(time)

def main():
	testcases = 1
	testcases = int(input())
	for _ in range(testcases):
		solution()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


test = int(input())
for _ in range(test):
	(n, l) = map(int, input().split())
	arr = input().split()
	tim = 0
	a_cord = 0
	b_cord = l
	a_speed = 1
	b_speed = 1
	a_next = 0
	b_next = n - 1
	flag = 0
	while flag != 1:
		if a_next >= n or b_next < 0 or a_next > b_next:
			tim += (b_cord - a_cord) / (a_speed + b_speed)
			flag = 1
		if flag != 1:
			t1 = (int(arr[a_next]) - a_cord) / a_speed
			t2 = (b_cord - int(arr[b_next])) / b_speed
			if t1 < t2:
				tim += t1
				a_cord = int(arr[a_next])
				b_cord -= t1 * b_speed
				a_speed += 1
				a_next += 1
			elif t2 < t1:
				tim += t2
				b_cord = int(arr[b_next])
				a_cord += t2 * a_speed
				b_speed += 1
				b_next -= 1
			elif t1 == t2:
				tim += t1
				a_cord = int(arr[a_next])
				b_cord = int(arr[b_next])
				a_speed += 1
				b_speed += 1
				a_next += 1
				b_next -= 1
	print(round(tim, 15))


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	flag = list(map(int, input().split()))
	(car1, speed1) = (0, 1)
	(car2, speed2) = (l, 1)
	t = 0
	nextflag1 = 0
	nextflag2 = n - 1
	flags_between = n
	while flags_between > 0:
		if (car2 - flag[nextflag2]) / speed2 > (flag[nextflag1] - car1) / speed1:
			interval = (flag[nextflag1] - car1) / speed1
			t += interval
			car2 -= interval * speed2
			car1 += interval * speed1
			nextflag1 += 1
			speed1 += 1
		else:
			interval = (car2 - flag[nextflag2]) / speed2
			t += interval
			car2 -= interval * speed2
			car1 += interval * speed1
			nextflag2 -= 1
			speed2 += 1
		flags_between -= 1
	t += (car2 - car1) / (speed1 + speed2)
	print(t)


for iii in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0 for _ in range(n + 3)]
	a[0] = 0
	a[n + 1] = l
	left = [[0.0, 0.0] for _ in range(n + 3)]
	right = [[0.0, 0.0] for _ in range(n + 3)]
	left[0][0] = 1.0
	left[0][1] = 0
	right[n + 1][0] = 1.0
	right[n + 1][1] = 0
	a[1:n + 1] = list(map(int, input().split()))
	for i in range(1, n + 1):
		left[i][0] = left[i - 1][0] + 1
		left[i][1] = left[i - 1][1] + 1.0 * (a[i] - a[i - 1]) / left[i - 1][0]
	for i in range(n, 0, -1):
		right[i][0] = right[i + 1][0] + 1
		right[i][1] = right[i + 1][1] + 1.0 * (a[i + 1] - a[i]) / right[i + 1][0]
	ans = -1
	for i in range(1, n + 2):
		tl = left[i - 1][1]
		tr = right[i][1]
		sl = left[i - 1][0]
		sr = right[i][0]
		dl = a[i - 1]
		dr = a[i]
		if tl < tr:
			dl += sl * (tr - tl)
		if tr < tl:
			dr -= sr * (tl - tr)
		ans = max(tl, tr)
		if dl <= dr:
			cs = sl + sr
			dis = dr - dl
			ans = ans + 1.0 * dis / cs
			break
	print(ans)


import math
from collections import deque
from sys import stdin, stdout
from string import ascii_letters
import sys
letters = ascii_letters[:26]
input = stdin.readline

def calc(m):
	time = m
	fpos = 0
	speed = 1
	for i in range(n):
		delta = arr[i] - fpos
		tm = delta / speed
		if tm <= time:
			time -= tm
			fpos = arr[i]
			speed += 1
		else:
			fpos += speed * time
			time = 0
			break
	fpos += time * speed
	time = m
	spos = l
	speed = 1
	for i in range(n - 1, -1, -1):
		delta = abs(arr[i] - spos)
		tm = delta / speed
		if tm <= time:
			time -= tm
			spos = arr[i]
			speed += 1
		else:
			spos -= speed * time
			time = 0
			break
	spos -= time * speed
	if spos <= fpos:
		return False
	return True
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	arr = list(map(int, input().split()))
	left = 0
	right = l
	for i in range(100):
		m = left + (right - left) / 2
		if not calc(m):
			right = m
		else:
			left = m
	print(left)


t = int(input())
for _ in range(t):
	solved = False
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split()))
	a.append(l)
	n += 2
	first_times = [0]
	second_times = [0]
	first_time = 0
	second_time = 0
	for i in range(n - 1):
		first_time += (a[i + 1] - a[i]) / (i + 1)
		first_times.append(first_time)
		second_time += (a[n - i - 1] - a[n - i - 2]) / (i + 1)
		second_times.append(second_time)
	second_times = second_times[::-1]
	for i in range(n - 1):
		if first_times[i] == second_times[i]:
			print(first_times[i])
			solved = True
			break
		if first_times[i + 1] > second_times[i + 1]:
			break
	if solved:
		continue
	td = second_times[i + 1] - first_times[i]
	d = a[i + 1] - a[i]
	v1 = i + 1
	v2 = n - i - 1
	if td < 0:
		d -= v2 * -td
	elif td > 0:
		d -= v1 * td
	if td < 0:
		td = 0
	print(first_times[i] + td + d / (v1 + v2))


(lambda W: [(lambda N, L: (lambda n: (lambda l, r: (lambda ls, rs: ([ls(i, l[i] + l[i - 1]) for i in range(1, N + 2)], [rs(-i - 1, r[-i - 1] + r[-i]) for i in range(1, N + 2)], (lambda k: print((r[k] if l[k - 1] < r[k] else l[k - 1]) + (n[k] - n[k - 1] - ((r[k] - l[k - 1]) * k if l[k - 1] < r[k] else (l[k - 1] - r[k]) * (N + 2 - k))) / (N + 2)))(len(list(W(lambda i: l[i] <= r[i], (i for i in range(N + 1))))))))(l.__setitem__, r.__setitem__))([0] + [(n[i] - n[i - 1]) / i for i in range(1, N + 2)], [(n[-i] - n[-i - 1]) / i for i in range(1, N + 2)][::-1] + [0]))([0] + list(map(int, input().split())) + [L]))(*map(int, input().split())) for t in range(int(input()))])(__import__('itertools').takewhile)


import sys, math, cmath, time, collections
start_time = time.time()

def solve():
	(n, l) = invr()
	a = inlt()
	q = 0
	w = l
	qq = 0
	ww = len(a) - 1
	qw = 0
	qv = 1
	wv = 1
	while True:
		if abs(a[qq] - q) / qv < abs(a[ww] - w) / wv:
			qw = qw + abs(a[qq] - q) / qv
			w = w - abs(a[qq] - q) / qv * wv
			q = a[qq]
			qq = qq + 1
			qv = qv + 1
		elif abs(a[qq] - q) / qv > abs(a[ww] - w) / wv:
			qw = qw + abs(a[ww] - w) / wv
			q = q + abs(a[ww] - w) / wv * qv
			w = a[ww]
			ww = ww - 1
			wv = wv + 1
		else:
			qw = qw + abs(a[ww] - w) / wv
			q = a[qq]
			w = a[ww]
			qq = qq + 1
			ww = ww - 1
			qv = qv + 1
			wv = wv + 1
		if q == w or qq >= len(a) or ww < 0 or (ww < qq):
			qw = qw + abs(w - q) / (qv + wv)
			break
	print(qw)

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(1, t + 1):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def factorial(n, m=1000000007):
	q = 1
	for i in range(n):
		q = q * (i + 1) % m
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b

def ceil(a, b):
	return -(-a // b)
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = lambda : sys.stdin.buffer.readline().rstrip()
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	q = [0, a[0]]
	w = [0, l - a[n - 1]]
	for i in range(1, n):
		q.append((a[i] - a[i - 1]) / (i + 1) + q[-1])
	q.append((l - a[n - 1]) / (n + 1) + q[-1])
	for i in range(n - 1, 0, -1):
		w.append((a[i] - a[i - 1]) / (n - i + 1) + w[-1])
	w.append(a[0] / (n + 1) + w[-1])
	w = w[::-1]
	a = [0] + a + [l]
	for i in range(n + 2):
		if q[i] == w[i]:
			print(q[i])
			break
		elif q[i] > w[i]:
			r = a[i] - a[i - 1]
			t1 = q[i - 1]
			t2 = w[i]
			v1 = i
			v2 = len(q) - i
			x = (v1 * v2 * (t2 - t1) + v1 * r) / (v1 + v2)
			print(x / v1 + t1)
			break


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	(ca, cb) = (0, l)
	(sa, sb) = (1, 1)
	i = 0
	j = n - 1
	ans = 0
	while i <= j:
		da = a[i] - ca
		db = cb - a[j]
		ta = da * 1.0 / sa
		tb = db * 1.0 / sb
		if ta <= tb:
			ans += ta
			ca = a[i]
			cb -= sb * 1.0 * ta
			sa += 1
			i += 1
		elif ta > tb:
			ans += tb
			cb = a[j]
			ca += sa * tb * 1.0
			sb += 1
			j -= 1
	last_dis = cb - ca
	sa += sb
	ans += last_dis / sa
	print(ans)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from heapq import *
from math import gcd, factorial, floor, ceil
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 10 ** 9 + 7

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve(case):
	(n, l) = sep()
	a = lis()
	b = []
	for i in range(n - 1, -1, -1):
		b.append(l - a[i])
	curra = 0
	currb = 0
	ans = 0
	inda = 0
	indb = 0
	while inda + indb != n:
		t1 = (a[inda] - curra) / (inda + 1)
		t2 = (b[indb] - currb) / (indb + 1)
		if t1 < t2:
			ans += t1
			curra = a[inda]
			currb += (indb + 1) * t1
			inda += 1
		else:
			ans += t2
			currb = b[indb]
			curra += (inda + 1) * t2
			indb += 1
	print(ans + (l - curra - currb) / (inda + indb + 2))
testcase(int(inp()))


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c for j in range(b)] for i in range(a)]

def list3d(a, b, c, d):
	return [[[d for k in range(c)] for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e for l in range(d)] for k in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** (-10)

def bisearch_min(mn, mx, func, times):
	ok = mx
	ng = mn
	for _ in range(times):
		mid = (ok + ng) / 2
		if func(mid):
			ok = mid
		else:
			ng = mid
	return ok

def check(m):
	cur = 0
	sp = 1
	loc1 = INF
	for i in range(1, N + 2):
		dist = A[i] - A[i - 1]
		t = dist / sp
		if cur + t > m:
			loc1 = A[i - 1] + sp * (m - cur)
			break
		cur += t
		sp += 1
	cur = 0
	sp = 1
	loc2 = -INF
	for i in range(N, -1, -1):
		dist = A[i + 1] - A[i]
		t = dist / sp
		if cur + t > m:
			loc2 = A[i + 1] - sp * (m - cur)
			break
		cur += t
		sp += 1
	return loc1 >= loc2
for _ in range(INT()):
	(N, L) = MAP()
	A = [0] + LIST() + [L]
	res = bisearch_min(0, INF, check, 100)
	print(res)


import sys, os.path
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a.reverse()
	a.append(0)
	a.reverse()
	a.append(l)
	left = [0 for i in range(n + 2)]
	right = [0 for i in range(n + 2)]
	sl = 1
	sr = 1
	n = len(a)
	for i in range(len(a)):
		if i == 0:
			left[0] = 0
		else:
			d = a[i] - a[i - 1]
			tt = d / sl
			left[i] = left[i - 1] + tt
			sl += 1
	for i in range(n - 1, -1, -1):
		if i == n - 1:
			right[i] = 0
		else:
			d = a[i + 1] - a[i]
			tt = d / sr
			right[i] = right[i + 1] + tt
			sr += 1
	ind = 0
	for i in range(n):
		if right[i] < left[i]:
			ind = i
			break
	sl = 1 + ind - 1
	sr = 1 + (n - ind - 1)
	d = abs(a[ind] - a[ind - 1])
	temp = left[ind - 1] - right[ind] + d / sl
	temp = temp * (sl * sr) / (sl + sr)
	ans = right[ind] + temp / sr
	print(ans)


cases = int(input())
for i in range(cases):
	args = [float(x) for x in input().split(' ')]
	l = args[1]
	n_flags = args[0]
	flags = [float(x) for x in input().split(' ')]
	time = 0.0
	s1 = 1.0
	s2 = 1.0
	loc1 = 0.0
	loc2 = l
	while len(flags) > 0:
		f1 = flags[0]
		f2 = flags[-1]
		t1 = (f1 - loc1) / s1
		t2 = (loc2 - f2) / s2
		if t1 < t2:
			s1 += 1
			loc1 = flags.pop(0)
			time += t1
			loc2 -= s2 * t1
		elif t1 > t2:
			s2 += 1
			loc2 = flags.pop(-1)
			time += t2
			loc1 += s1 * t2
		elif f1 == f2:
			loc1 = f1
			loc2 = f2
			time += t1
			break
		else:
			loc1 = flags.pop(0)
			loc2 = flags.pop(-1)
			time += t1
			s1 += 1
			s2 += 1
	time += (loc2 - loc1) / (s1 + s2)
	print(time)


op = int(input())
while op != 0:
	op -= 1
	(n, k) = map(int, input().split())
	li = list(map(int, input().split()))
	ad = 0
	bd = k
	sa = 1
	sb = 1
	i = 0
	j = n - 1
	t = 0
	while i <= j:
		if (li[i] - ad) / sa < (bd - li[j]) / sb:
			x = (li[i] - ad) / sa
			t += x
			ad = li[i]
			sa += 1
			i += 1
			bd = bd - sb * x
		elif (li[i] - ad) / sa > (bd - li[j]) / sb:
			x = (bd - li[j]) / sb
			t += x
			bd = li[j]
			sb += 1
			j -= 1
			ad = ad + sa * x
		elif (li[i] - ad) / sa == (bd - li[j]) / sb:
			x = (li[i] - ad) / sa
			t += x
			sa += 1
			sb += 1
			ad = li[i]
			bd = li[j]
			i += 1
			j -= 1
	if ad < bd:
		t += (bd - ad) / (sa + sb)
	print(t)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, L) = map(int, input().split())
	flag = [int(item) for item in input().split()]
	rflag = list(reversed(flag))
	flag_a = [0] + flag + [10 ** 18]
	flag_b = [L] + rflag + [-10 ** 18]
	l = 0
	r = 10 ** 9 + 1
	for _ in range(100):
		mid = (l + r) / 2.0
		dist_a = 0.0
		time_a = 0.0
		for (i, (p1, p2)) in enumerate(zip(flag_a, flag_a[1:])):
			dt = (p2 - p1) / (i + 1)
			if time_a + dt >= mid:
				dist_a += (mid - time_a) * (i + 1)
				break
			else:
				dist_a += p2 - p1
				time_a += dt
		dist_b = 0.0
		time_b = 0.0
		for (i, (p1, p2)) in enumerate(zip(flag_b, flag_b[1:])):
			dt = (p1 - p2) / (i + 1)
			if time_b + dt >= mid:
				dist_b += (mid - time_b) * (i + 1)
				break
			else:
				dist_b += p1 - p2
				time_b += dt
		if dist_a < L - dist_b:
			l = mid
		else:
			r = mid
	print(mid)


import math
for _ in range(int(input())):
	(n, end) = map(int, input().split())
	a = [int(i) for i in input().split()]
	a.insert(0, 0)
	a.append(end)
	l = 0
	r = end
	(i, j) = (1, len(a) - 2)
	left = 0
	right = 0
	(v1, v2) = (1, 1)
	(left_time, right_time) = (0, 0)
	while a[i] <= a[j]:
		t1 = (a[i] - l) / v1
		t2 = (r - a[j]) / v2
		if left_time + t1 == right_time + t2:
			l = a[i]
			r = a[j]
			i += 1
			j -= 1
			v1 += 1
			v2 += 1
			left_time += t1
			right_time += t2
		elif left_time + t1 < right_time + t2:
			l = a[i]
			i += 1
			v1 += 1
			left_time += t1
		else:
			r = a[j]
			j -= 1
			right_time += t2
			v2 += 1
	k = right_time - left_time + (r / v2 + l / v1)
	p = v1 * v2 * k
	x = p / (v1 + v2)
	print(left_time + (x - l) / v1)


import sys, string
from collections import deque, defaultdict
from math import sqrt, factorial, gcd, ceil, atan, pi

def input():
	return sys.stdin.buffer.readline().strip()
from bisect import bisect_left, bisect_right
from operator import add
MOD = int(1000000000.0) + 7
INF = float('inf')

def solve():
	(n, L) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]

	def f(T):
		bT = T
		first = 0
		speed = 1
		for e in a:
			tt = (e - first) / speed
			if tt <= T:
				T -= tt
				speed += 1
				first = e
			else:
				break
		first += speed * T
		T = bT
		second = L
		speed = 1
		for e in reversed(a):
			tt = (second - e) / speed
			if tt <= T:
				T -= tt
				speed += 1
				second = e
			else:
				break
		second -= speed * T
		return second <= first
	left = 0
	right = 2000000000.0
	while right - left > 1e-06:
		mid = (left + right) / 2
		if f(mid):
			right = mid
		else:
			left = mid
	print(right)
T = 1
T = int(input())
for case in range(1, T + 1):
	ans = solve()


t = int(input())
for i in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	tmp1 = 0
	tmp2 = n - 1
	t = 0
	v1 = 1
	v2 = 1
	x1 = 0
	x2 = l
	while tmp2 - tmp1 > -1:
		t1 = (a[tmp1] - x1) / v1
		t2 = (x2 - a[tmp2]) / v2
		if t1 > t2:
			x1 += v1 * t2
			x2 -= v2 * t2
			v2 += 1
			t += t2
			tmp2 -= 1
		elif abs(t1 - t2) < 1e-09:
			x1 += v1 * t1
			x2 -= v2 * t2
			v1 += 1
			v2 += 1
			t += t1
			tmp2 -= 1
			tmp1 += 1
		else:
			x1 += v1 * t1
			x2 -= v2 * t1
			v1 += 1
			t += t1
			tmp1 += 1
	t += (x2 - x1) / (v1 + v2)
	print('{:.07f}'.format(t))


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	first = [0] * (n + 2)
	second = [0] * (n + 2)
	speed = 1
	for i in range(n + 1):
		if not i:
			first[i + 1] = a[i]
		elif i == n:
			first[i + 1] = first[i] + (l - a[i - 1]) / speed
		else:
			first[i + 1] = first[i] + (a[i] - a[i - 1]) / speed
		speed += 1
	speed = 1
	for i in range(n - 1, -2, -1):
		if i == n - 1:
			second[i + 1] = (l - a[i]) / speed
		elif i == -1:
			second[i + 1] = second[i + 2] + a[0] / speed
		else:
			second[i + 1] = second[i + 2] + (a[i + 1] - a[i]) / speed
		speed += 1
	index = 0
	for i in range(len(first)):
		if first[i] >= second[i]:
			index = i - 1
			break
	v1 = index + 1
	v2 = n + 2 - v1
	a.insert(0, 0)
	a.append(l)
	if second[index] <= first[index]:
		dx = (first[index] - second[index]) * v2
		print(first[index] + (a[index] - a[index] - dx) / (n + 2))
	else:
		dx = (second[index] - first[index]) * v1
		print(second[index] + (a[index] - a[index] - dx) / (n + 2))


T = int(input())
for _ in range(T):
	(n, l) = tuple(map(int, input().split()))
	flags = list(map(int, input().split()))
	(i, j, v1, v2, sp, ep, time) = (0, n - 1, 1, 1, 0, l, 0)
	while i <= j:
		d1 = flags[i] - sp
		d2 = ep - flags[j]
		t1 = d1 / v1
		t2 = d2 / v2
		if t1 > t2:
			v2 += 1
			sp += v1 * t2
			ep = flags[j]
			j -= 1
			time += t2
		else:
			v1 += 1
			ep -= v2 * t1
			sp = flags[i]
			i += 1
			time += t1
	time += (ep - sp) / (v1 + v2)
	print(time)


from collections import Counter
import math
import sys
from bisect import bisect, bisect_left, bisect_right

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
for i in range(INT()):
	(n, l) = MAP()
	arr = LIST()
	time = 0
	speed1 = 1
	speed2 = 1
	poa = 0
	pob = l
	while len(arr) > 0 and poa < pob:
		da = arr[0] - poa
		db = pob - arr[-1]
		ta = da / speed1
		tb = db / speed2
		if ta < tb:
			time += ta
			poa += da
			pob -= ta * speed2
			speed1 += 1
			del arr[0]
		elif tb < ta:
			time += tb
			poa += tb * speed1
			pob -= db
			speed2 += 1
			del arr[-1]
		else:
			time += ta
			poa += da
			pob -= db
			speed1 += 1
			speed2 += 1
			if len(arr) == 1:
				del arr[0]
			else:
				del arr[0]
				del arr[-1]
	if poa < pob:
		time += (pob - poa) / (speed1 + speed2)
	print(time)


for _ in range(int(input())):
	(n, l) = [int(_) for _ in input().split()]
	A = [int(_) for _ in input().split()]
	ans = 0
	i = 0
	j = n - 1
	(p1, p2) = (0, l)
	(s1, s2) = (1, 1)
	while i <= j:
		a = (A[i] - p1) / s1
		b = (p2 - A[j]) / s2
		if a < b:
			ans += (A[i] - p1) / s1
			u = p1
			p1 = A[i]
			p2 -= (A[i] - u) / s1 * s2
			s1 += 1
			i += 1
		else:
			ans += (p2 - A[j]) / s2
			u = p2
			p2 = A[j]
			p1 += (u - A[j]) / s2 * s1
			s2 += 1
			j -= 1
	ans += (p2 - p1) / (s1 + s2)
	print(round(ans, 1000000))


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz/'
M = 998244353
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]

def Time(x):
	t1 = 0
	t2 = 0
	last = 0
	speed = 1
	for i in a:
		if i < x:
			d = i - last
			t1 += d / speed
			speed += 1
			last = i
	t1 += abs(x - last) / speed
	last = l
	speed = 1
	for i in a[::-1]:
		if i > x:
			d = abs(i - last)
			t2 += d / speed
			speed += 1
			last = i
	t2 += abs(x - last) / speed
	return max(t1, t2)
for _ in range(Int()):
	(n, l) = value()
	a = array()
	low = 0
	high = l
	while low + EPS < high:
		mid1 = low + (high - low) / 3
		mid2 = high - (high - low) / 3
		if Time(mid1) >= Time(mid2):
			low = mid1
		else:
			high = mid2
	print(min(Time(low), Time(mid1), Time(mid2), Time(high)))


def solve():
	(n, l) = (int(x) for x in input().split())
	flags = [int(x) for x in input().split()]
	ac = 0
	bc = l
	asp = 1
	bsp = 1
	l_op = 0
	r_op = n - 1
	time = 0
	while r_op >= l_op:
		adist = flags[l_op] - ac
		atime = adist / asp
		bdist = bc - flags[r_op]
		btime = bdist / bsp
		if atime < btime:
			ac = flags[l_op]
			asp += 1
			bc -= bsp * atime
			time += atime
			l_op += 1
		elif btime < atime:
			bc = flags[r_op]
			bsp += 1
			ac += asp * btime
			time += btime
			r_op -= 1
		else:
			ac = flags[l_op]
			asp += 1
			l_op += 1
			bc = flags[r_op]
			bsp += 1
			r_op -= 1
			time += atime
	meet_coor = ac + (bc - ac) * (asp / (asp + bsp))
	meet_time = (meet_coor - ac) / asp
	print(time + meet_time)
for _ in range(int(input())):
	solve()


from os import path
import sys, time
from math import ceil, floor, gcd, log, log2, factorial, sqrt
from collections import defaultdict, Counter, OrderedDict, deque
from itertools import combinations, permutations
from bisect import *
from functools import reduce
from operator import mul
maxx = float('inf')
I = lambda : int(sys.stdin.buffer.readline())
lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
S = lambda : sys.stdin.readline().strip('\n')
grid = lambda r: [lint() for i in range(r)]
localsys = 0
start_time = time.time()
nCr = lambda n, r: reduce(mul, range(n - r + 1, n + 1), 1) // factorial(r)

def ceill(n, x):
	return (n + x - 1) // x
T = 1

def solve():
	(n, l) = lint()
	(i, j, cura, curb, ans, ja, jb, a) = (0, n - 1, 0, l, 0, 1, 1, lint())
	while True:
		if i > j:
			ans += (curb - cura) / (ja + jb)
			break
		(t1, t2) = ((a[i] - cura) / ja, (curb - a[j]) / jb)
		if t1 < t2:
			(cura, ja, i, ans, curb) = (a[i], ja + 1, i + 1, ans + t1, curb - t1 * jb)
		elif t1 > t2:
			(curb, j, jb, cura, ans) = (a[j], j - 1, jb + 1, cura + t2 * ja, ans + t2)
		else:
			(cura, curb, i, j, ja, jb, ans) = (a[i], a[j], i + 1, j - 1, ja + 1, jb + 1, ans + t1)
	print(ans)

def run():
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
run()
T = I() if T else 1
for _ in range(T):
	solve()
if localsys:
	print('\n\nTime Elased :', time.time() - start_time, 'seconds')


import sys as _sys

def main():
	t = int(input())
	for i_t in range(t):
		(n, l) = _read_ints()
		a = tuple(_read_ints())
		result = find_time_meet(l, a)
		print(result)

def _read_line():
	result = _sys.stdin.readline()
	assert result[-1] == '\n'
	return result[:-1]

def _read_ints():
	return map(int, _read_line().split())

def find_time_meet(road_length, flags_positions):
	a_state_by_flag_i = _compute_car_states_by_flags_indices(road_length, flags_positions)
	flags_positions_for_b = [road_length - flag_pos for flag_pos in flags_positions][::-1]
	b_state_by_flag_i = _compute_car_states_by_flags_indices(road_length, flags_positions_for_b)
	b_state_by_flag_i = [(time, speed, road_length - flag_pos) for (time, speed, flag_pos) in b_state_by_flag_i][::-1]
	curr_i_a = 0
	curr_i_b = len(b_state_by_flag_i) - 1
	while curr_i_b - curr_i_a >= 2:
		next_i_a = curr_i_a + 1
		next_i_b = curr_i_b - 1
		if a_state_by_flag_i[next_i_a][0] <= b_state_by_flag_i[next_i_b][0]:
			curr_i_a += 1
		else:
			curr_i_b -= 1
	assert curr_i_b - curr_i_a == 1
	(a_time, a_speed, a_pos) = a_state_by_flag_i[curr_i_a]
	(b_time, b_speed, b_pos) = b_state_by_flag_i[curr_i_b]
	meet_time = (b_pos - a_pos + a_time * a_speed + b_time * b_speed) / (a_speed + b_speed)
	return meet_time

def _compute_car_states_by_flags_indices(road_length, flags_positions):
	flags_positions = (0, *flags_positions, road_length)
	car_states_by_flags_indices = [(0, 1, flags_positions[0])]
	for flag_pos in flags_positions[1:]:
		(time, speed, prev_flag_pos) = car_states_by_flags_indices[-1]
		distance = flag_pos - prev_flag_pos
		time += distance / speed
		speed += 1
		car_states_by_flags_indices.append((time, speed, flag_pos))
	return car_states_by_flags_indices
main()


for _ in range(int(input())):
	(n, l) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	lo = 0
	hi = 2 * 10 ** 9
	ans = 0
	eps = 10 ** (-7)
	while hi - lo > eps:
		mid = (lo + hi) / 2
		x = 0
		t = mid
		pos = 0
		speed = 1
		while t > eps and pos < n:
			dist = arr[pos] - x
			req = dist / speed
			have = min(t, req)
			t -= have
			x += have * speed
			pos += 1
			speed += 1
		if t > eps:
			x += t * speed
		y = l
		t = mid
		pos = n - 1
		speed = 1
		while t > eps and pos >= 0:
			dist = y - arr[pos]
			need = dist / speed
			have = min(t, need)
			t -= have
			y -= have * speed
			pos -= 1
			speed += 1
		if t > eps:
			y -= t * speed
		if x > y:
			hi = mid
		else:
			ans = mid
			lo = mid
	print(ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a = [0] + a + [l]
	s = [0 for i in range(n + 2)]
	e = [0 for i in range(n + 2)]
	for i in range(1, n + 2):
		s[i] = (a[i] - a[i - 1]) / i
		s[i] += s[i - 1]
	a = a[::-1]
	for i in range(1, n + 2):
		e[i] = (a[i - 1] - a[i]) / i
		e[i] += e[i - 1]
	e = e[::-1]
	a = a[::-1]
	for i in range(1, n + 2):
		if s[i] >= e[i]:
			s_speed = i
			e_spped = n + 2 - i
			if s[i - 1] <= e[i]:
				L = a[i] - a[i - 1] - s_speed * (e[i] - s[i - 1])
				t = L / (n + 2)
				ans = e[i] + t
				print(ans)
				break
			else:
				L = a[i] - a[i - 1] - e_spped * (s[i - 1] - e[i])
				t = L / (n + 2)
				ans = s[i - 1] + t
				print(ans)
				break


from collections import defaultdict
from bisect import bisect_right

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
from sys import stdin

def solve():
	(n, l) = map(int, stdin.readline().split())
	la = list(map(int, stdin.readline().split()))
	(x, y) = (0, n - 1)
	(u, v) = (1, 1)
	(p, q) = (0, l)
	t = 0
	while y >= x:
		t1 = (la[x] - p) / u
		t2 = (q - la[y]) / v
		if t1 < t2:
			t += t1
			u += 1
			q -= t1 * v
			p = la[x]
			x += 1
		elif t2 <= t1:
			t += t2
			v += 1
			p += t2 * u
			q = la[y]
			y -= 1
		else:
			t += t1
			u += 1
			v += 1
			p = la[x]
			q = la[y]
			x += 1
			y -= 1
	t += (q - p) / (u + v)
	print(t)
t = int(stdin.readline())
for _ in range(t):
	solve()


import math
from bisect import bisect_left, bisect_right

def solve():
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a.insert(0, 0)
	a.append(l)
	b = []
	for i in range(n + 1, -1, -1):
		b.append(l - a[i])
	take_0 = [0] * (n + 2)
	take_l = [0] * (n + 2)
	fast = 1
	for i in range(n + 1):
		d = a[i + 1] - a[i]
		take_0[i + 1] = take_0[i] + d / fast
		fast += 1
	fast = 1
	for i in range(n + 1):
		d = a[-(i + 1)] - a[-(i + 2)]
		take_l[i + 1] = take_l[i] + d / fast
		fast += 1

	def time_cost_0(X):
		cnt = bisect_right(a, X)
		return take_0[cnt - 1] + (X - a[cnt - 1]) / cnt

	def time_cost_l(X):
		cnt = bisect_right(b, X)
		return take_l[cnt - 1] + (X - b[cnt - 1]) / cnt
	lb = 0
	rb = l
	for _ in range(50):
		m = (lb + rb) / 2
		if time_cost_0(m) < time_cost_l(l - m):
			lb = m
		else:
			rb = m
	print(time_cost_0(lb))

def main():
	t = int(input())
	for i in range(t):
		solve()
	return
main()


from sys import stdin, stdout
import math
input = stdin.readline

def dist(t, arr):
	s = 0
	sp = 1
	dist = 0
	fl = 0
	for d in arr:
		if (d - s) / sp < t:
			dist += d - s
			t -= (d - s) / sp
			s = d
			sp += 1
		else:
			fl = 1
			dist += t * sp
			t = 0
			break
	if fl == 0:
		dist += t * sp
	return dist
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr1 = []
	for d in arr:
		arr1.append(l - d)
	arr1.sort()
	start = 0
	end = l
	mid = (start + end) / 2
	while abs(l - (dist(mid, arr) + dist(mid, arr1))) > 1e-06:
		mid = (start + end) / 2
		if dist(mid, arr) + dist(mid, arr1) > l:
			end = mid
		elif dist(mid, arr) + dist(mid, arr1) < l:
			start = mid
	print(mid)


def good(l1, l2, t1, a, n):
	tk = 0.0
	ii = 0
	sp1 = 1
	sp2 = 1
	jj = n - 1
	tkj = 0.0
	d1 = 0.0
	d2 = 0.0
	fsk = l2
	while tk < t1 and ii < n:
		tp = (a[ii] - l1) / sp1
		tk += tp
		if tk >= t1:
			xx = tk - tp
			pp = t1 - xx
			d1 += pp * sp1
		elif tk < t1:
			sp1 += 1
			d1 += a[ii] - l1
			l1 = a[ii]
			ii += 1
	while tkj < t1 and jj >= 0:
		tp = (l2 - a[jj]) / sp2
		tkj += tp
		if tkj >= t1:
			xx = tkj - tp
			pp = t1 - xx
			d2 += pp * sp2
		elif tkj < t1:
			sp2 += 1
			d2 += l2 - a[jj]
			l2 = a[jj]
			jj -= 1
	if ii == n and tk < t1:
		xps = t1 - tk
		d1 += xps * sp1
	if jj == -1 and tkj < t1:
		xpd = t1 - tkj
		d2 += xpd * sp2
	if abs(d1 - (fsk - d2)) < 1e-06:
		return 1
	elif fsk - d2 - d1 >= 1e-06:
		return 0
	else:
		return 2
t = int(input())
for i in range(t):
	(n, l1) = input().strip().split(' ')
	(n, l1) = [int(n), int(l1)]
	a = list(map(int, input().strip().split(' ')))
	a.sort()
	l = 0
	r = l1
	for j in range(500):
		mid = (l + r) / 2
		if good(0, l1, mid, a, n) == 1:
			l = mid
			print(l)
			break
		elif good(0, l1, mid, a, n) == 2:
			r = mid
		else:
			l = mid


import sys
import heapq, functools, collections
import math, random
from collections import Counter, defaultdict

def solve(arr, end):
	console('----- solving ------')
	arr = [0] + arr + [end]
	brr = [end - x for x in arr[::-1]]
	xrr = [(b - a) / i for (i, (a, b)) in enumerate(zip(arr, arr[1:]), start=1)]
	yrr = [(b - a) / i for (i, (a, b)) in enumerate(zip(brr, brr[1:]), start=1)]
	cur = 0
	crr = [0]
	for x in xrr:
		cur += x
		crr.append(cur)
	dur = 0
	drr = [0]
	for y in yrr:
		dur += y
		drr.append(dur)
	drr = drr[::-1]
	del cur, dur
	console(arr)
	console(brr)
	console(xrr)
	console(yrr)
	console(crr)
	console(drr)
	for (i, (c, d)) in enumerate(zip(crr, drr)):
		if c == d or abs(c - d) < 10 ** (-7):
			return c
		if c > d:
			p = crr[i - 1]
			q = drr[i]
			x = i
			y = len(arr) - i
			a = arr[i - 1]
			b = arr[i]
			console(p, q, x, y, a, b)
			return (b - a + x * p + y * q) / (x + y)
	return ''

def console(*args):
	return
for case_num in range(int(input())):
	(_, end) = list(map(int, input().split()))
	lst = list(map(int, input().split()))
	res = solve(lst, end)
	print(res)


for _ in range(int(input())):
	(n, tt) = map(int, input().split())
	l = list(map(int, input().split()))
	k = tt
	l1 = []
	l2 = []
	c = 0
	v1 = 1
	v2 = 1
	t = 0
	d = l
	pos1 = 0
	pos2 = n - 1
	t1 = 0
	t2 = 0
	d1 = 0
	d2 = 0
	i = 0
	rr = 0
	while i < n:
		if (l[pos1] - d2) / v1 > (tt - (d1 + l[pos2])) / v2:
			t += (tt - (d1 + l[pos2])) / v2
			d2 += (tt - (d1 + l[pos2])) / v2 * v1
			d1 = tt - l[pos2]
			v2 += 1
			k = l[pos2]
			pos2 -= 1
			i += 1
			t1 = 1
			t2 = 0
		elif (l[pos1] - d2) / v1 < (tt - (d1 + l[pos2])) / v2:
			t += (l[pos1] - d2) / v1
			d1 += (l[pos1] - d2) / v1 * v2
			d2 = l[pos1]
			v1 += 1
			c = l[pos1]
			pos1 += 1
			i += 1
		else:
			t += (l[pos1] - d2) / v1
			d2 = l[pos1]
			d1 = tt - l[pos2]
			v2 += 1
			v1 += 1
			pos2 -= 1
			pos1 += 1
			if i == n - 1:
				rr = 1
			i += 2
	if rr == 1:
		print(t)
	else:
		dd = tt - (d1 + d2)
		t += dd / (v1 + v2)
		print(t)


import sys
t = int(sys.stdin.readline())

def AvanzaAoB(pa, va, pb, vb, a):
	TparaA = (a[0] - pa) / va
	TparaB = (pb - a[-1]) / vb
	if TparaA < TparaB:
		return 'A'
	elif TparaB < TparaA:
		return 'B'
	else:
		return 'Sim'
for i in range(0, t):
	(n, l) = sys.stdin.readline().split(' ')
	n = int(n)
	l = float(l)
	a = [float(x) for x in sys.stdin.readline().split()]
	time = 0.0
	va = 1.0
	vb = 1.0
	pa = 0.0
	pb = l
	while len(a) != 0:
		QuienAvanza = AvanzaAoB(pa, va, pb, vb, a)
		if QuienAvanza == 'A':
			time += (a[0] - pa) / va
			pb -= vb * (a[0] - pa) / va
			pa = a[0]
			va += 1
			del a[0]
		elif QuienAvanza == 'B':
			time += (pb - a[-1]) / vb
			pa += va * (pb - a[-1]) / vb
			pb = a[-1]
			vb += 1
			del a[-1]
		elif QuienAvanza == 'Sim':
			time += (pb - a[-1]) / vb
			if len(a) == 1:
				pb = pa
				break
			pa = a[0]
			pb = a[-1]
			va += 1
			vb += 1
			del a[0]
			del a[-1]
	if pa != pb:
		time += (pb - pa) / (va + vb)
	x = 3
	print(time)


for ad in range(int(input())):
	(n, k) = list(map(int, input().split()))
	l = list(map(int, input().split()))
	v1 = 1
	v2 = 1
	t1 = 0
	t2 = 0
	x1 = 0
	x2 = k
	i = 0
	j = n - 1
	xx = 0
	while xx == 0:
		tt1 = (l[i] - x1) / v1
		tt2 = (x2 - l[j]) / v2
		if tt1 > tt2:
			t1 += tt2
			t2 += tt2
			x2 = l[j]
			j -= 1
			x1 += v1 * tt2
			v2 += 1
		elif tt1 == tt2:
			if i == j:
				ans = t1 + tt1
				break
			t1 += tt1
			t2 += tt1
			x1 = l[i]
			x2 = l[j]
			i += 1
			j -= 1
			v1 += 1
			v2 += 1
		else:
			t1 += tt1
			t2 += tt1
			x1 = l[i]
			i += 1
			x2 -= v2 * tt1
			v1 += 1
		if i == j + 1:
			ans = (x2 - x1) / (v1 + v2) + t1
			break
	print(ans)


import os
import sys
import io
import functools
import copy
import math
GANS = []

def cmp(x, y):
	if x[1] == y[1]:
		return y[0] - x[0]
	return x[1] - y[1]
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	li = [int(i) for i in input().split()]
	s = 0
	e = n - 1
	s1 = 1
	s2 = 1
	p1 = 0
	p2 = l
	tspend = 0.0
	while s <= e:
		if (li[s] - p1) * s2 > s1 * (p2 - li[e]):
			delta = (p2 - li[e]) / s2
			tspend += delta
			p2 = li[e]
			p1 += delta * s1
			s2 += 1
			e -= 1
		else:
			delta = (li[s] - p1) / s1
			tspend += delta
			p1 = li[s]
			p2 -= delta * s2
			s1 += 1
			s += 1
	tspend += (p2 - p1) / (s2 + s1)
	print('%.15f' % tspend)


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
for _ in range(II()):
	(n, d) = MI()
	aa = [0] + LI() + [d]
	n += 2
	tt = [0] * n
	v = 1
	pa = 0
	now = 0
	for i in range(n - 1):
		now += (aa[i + 1] - aa[i]) / v
		tt[i + 1] = now
		v += 1
	ss = [0] * n
	v = 1
	pa = d
	now = 0
	for i in range(n - 2, -1, -1):
		now += (aa[i + 1] - aa[i]) / v
		ss[i] = now
		v += 1
	r = 0
	for i in range(n):
		if tt[i] >= ss[i]:
			r = i
			break
	if tt[r] == ss[r]:
		print(tt[r])
	else:
		v1 = r
		v2 = n - r
		ans = (aa[r] - aa[r - 1] + ss[r] * v2 - tt[r - 1] * v2) / (v1 + v2)
		print(ans + tt[r - 1])


import sys
import math, bisect
sys.setrecursionlimit(10 ** 5)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict

def I():
	return int(sys.stdin.readline())

def neo():
	return map(int, sys.stdin.readline().split())

def Neo():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(I()):
	(n, l) = neo()
	A = Neo()
	(pos1, pos2, i, j) = (0, l, 0, n - 1)
	(p, q) = (1, 1)
	time = 0
	while i <= j:
		if (A[i] - pos1) / p < (pos2 - A[j]) / q:
			t = (A[i] - pos1) / p
			time += t
			pos1 = A[i]
			pos2 -= t * q
			p += 1
			i += 1
		elif (A[i] - pos1) / p == (pos2 - A[j]) / q:
			t = (A[i] - pos1) / p
			time += t
			pos1 = A[i]
			pos2 -= t * q
			p += 1
			i += 1
			q += 1
			j -= 1
		else:
			t = (pos2 - A[j]) / q
			time += t
			pos2 = A[j]
			pos1 += t * p
			q += 1
			j -= 1
	time += (pos2 - pos1) / (p + q)
	print('%.6f' % time)


from sys import stdin, stdout
from math import gcd
input = stdin.buffer.readline
for i in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0] + [int(i) for i in input().split()] + [l]
	p = 0
	q = n + 1
	x = a[1]
	y = l - a[-2]
	cur = min(x, y)
	c = 0
	while q - p > 1:
		cur = min(x, y)
		if x < y:
			p += 1
			x += (a[p + 1] - a[p]) / (p + 1)
			c = 0
		else:
			q -= 1
			y += (a[q] - a[q - 1]) / (n - q + 2)
			c = 1
	if c == 0:
		a[q] -= (cur - y + (a[q] - a[q - 1]) / (n - q + 2)) * (n - q + 2)
	else:
		a[p] += (cur - x + (a[p + 1] - a[p]) / (p + 1)) * (p + 1)
	print(cur + (a[q] - a[p]) / (p + 1 + n - q + 2))


def f(t):
	curr1 = 0
	dist1 = 0
	t1 = t
	for i in range(n + 1):
		curr1 += 1
		if li[i + 1] - li[i] > curr1 * t1:
			dist1 += curr1 * t1
			break
		dist1 += li[i + 1] - li[i]
		t1 -= (li[i + 1] - li[i]) / curr1
	curr2 = 0
	dist2 = 0
	t2 = t
	for i in range(n + 1, 0, -1):
		curr2 += 1
		if li[i] - li[i - 1] > curr2 * t2:
			dist2 += curr2 * t2
			break
		dist2 += li[i] - li[i - 1]
		t2 -= (li[i] - li[i - 1]) / curr2
	if dist1 + dist2 < d:
		return -1
	if dist1 + dist2 > d:
		return 1
	return 0
dx = 10 ** (-7)

def binary_search(l, r):
	while r - l > dx:
		mid = (l + r) / 2
		if f(mid) == -1:
			l = mid + dx
		else:
			r = mid - dx
	return l
t = int(input())
for you in range(t):
	l = input().split()
	n = int(l[0])
	d = int(l[1])
	l = input().split()
	li = [int(i) for i in l]
	li.insert(0, 0)
	li.append(d)
	print(binary_search(0, 10 ** 10))


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	data = [int(x) for x in input().split()]
	ans = 0
	low = 0
	high = n - 1
	prev_start = 0
	end_start = l
	front_speed = 1
	end_speed = 1
	while low < high:
		front_distance = data[low] - prev_start
		end_distance = end_start - data[high]
		front_time = front_distance / front_speed
		end_time = end_distance / end_speed
		if front_time < end_time:
			ans += front_time
			prev_start = data[low]
			low += 1
			dist = end_speed * front_time
			front_speed += 1
			end_start -= dist
		else:
			ans += end_time
			end_start = data[high]
			high -= 1
			dist = front_speed * end_time
			end_speed += 1
			prev_start += dist
	front_distance = data[low] - prev_start
	end_distance = end_start - data[high]
	front_time = front_distance / front_speed
	end_time = end_distance / end_speed
	if front_time < end_time:
		ans += front_time
		front_speed += 1
		prev_start = data[low]
		dist = front_time * end_speed
		end_start -= dist
	else:
		ans += end_time
		end_speed += 1
		end_start = data[low]
		dist = end_time * front_speed
		prev_start += dist
	ans += (end_start - prev_start) / (front_speed + end_speed)
	print('%.7f' % ans)


import sys
import random
from fractions import Fraction
from math import *

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def finput():
	return float(input())

def tinput():
	return input().split()

def linput():
	return list(input())

def rinput():
	return map(int, tinput())

def fiinput():
	return map(float, tinput())

def rlinput():
	return list(map(int, input().split()))

def trinput():
	return tuple(rinput())

def srlinput():
	return sorted(list(map(int, input().split())))

def NOYES(fl):
	if fl:
		print('NO')
	else:
		print('YES')

def YESNO(fl):
	if fl:
		print('YES')
	else:
		print('NO')

def main():
	(n, l) = rinput()
	q = rlinput()
	q = [0] + q + [l]
	(w, e) = ([0] * (n + 2), [0] * (n + 2))
	for i in range(1, n + 2):
		e[n + 1 - i] = e[n + 2 - i] + (q[-i] - q[-1 - i]) / i
		w[i] = w[i - 1] + (q[i] - q[i - 1]) / i
	(left, right) = (0, n + 2)
	while right > left + 1:
		mid = (right + left) // 2
		if w[mid] >= e[mid]:
			right = mid
		else:
			left = mid
	print((q[right] - q[right - 1] - (max(0, w[right - 1] - e[right]) * (n - right + 2) + max(0, e[right] - w[right - 1]) * right)) / (n + 2) + max(w[right - 1], e[right]))
for i in range(iinput()):
	main()


import collections
T = int(input())
for _ in range(T):
	(n, l) = map(int, input().split())
	a = [0.0] * (n + 2)
	a[1:n + 1] = list(map(int, input().split()))
	a[n + 1] = l
	(lo, hi) = (1, n)
	(vl, vh) = (1.0, 1.0)
	t = 0.0
	(pl, pr) = (a[lo - 1], a[hi + 1])
	while lo <= hi:
		tmp1 = 1.0 * (a[lo] - pl) / (1.0 * vl)
		tmp2 = 1.0 * (pr - a[hi]) / (1.0 * vh)
		if t + tmp1 < t + tmp2:
			t += tmp1
			vl += 1.0
			pl = a[lo]
			lo += 1
			pr -= 1.0 * vh * tmp1
			if lo > hi:
				t += 1.0 * (pr - pl) / (1.0 * (vl + vh))
				break
		else:
			t += tmp2
			vh += 1.0
			pr = a[hi]
			hi -= 1
			pl += 1.0 * vl * tmp2
			if lo > hi:
				t += 1.0 * (pr - pl) / (1.0 * (vl + vh))
				break
		if abs(pl - pr) < 1e-06:
			break
	print(float('{:.7f}'.format(t)))


n = int(input())
i = 0
while i < n:
	(k, l) = [int(j) for j in input().split()]
	mas = [int(j) for j in input().split()]
	dl = l / 2.0
	koord1 = 0
	koord2 = l
	speed1 = 1
	speed2 = 1
	time_0 = 0
	fl1 = mas.pop(0)
	if len(mas) == 0:
		fl2 = fl1
	else:
		fl2 = mas.pop()
	rasst1 = fl1 - koord1
	rasst2 = koord2 - fl2
	while len(mas) > 0:
		if rasst1 / speed1 == rasst2 / speed2:
			time_0 += rasst1 / speed1
			koord1 = fl1
			koord2 = fl2
			speed1 += 1
			speed2 += 1
			fl1 = mas.pop(0)
			if len(mas) == 0:
				fl2 = fl1
			else:
				fl2 = mas.pop()
			rasst1 = fl1 - koord1
			rasst2 = koord2 - fl2
		elif rasst1 / speed1 < rasst2 / speed2:
			koord1 = fl1
			time_0 += rasst1 / speed1
			fl1 = mas.pop(0)
			koord2 -= rasst1 / speed1 * speed2
			speed1 += 1
			rasst1 = fl1 - koord1
			rasst2 = koord2 - fl2
		else:
			koord2 = fl2
			time_0 += rasst2 / speed2
			fl2 = mas.pop()
			koord1 += rasst2 / speed2 * speed1
			speed2 += 1
			rasst1 = fl1 - koord1
			rasst2 = koord2 - fl2
	flag = False
	while not flag:
		if rasst1 / speed1 == rasst2 / speed2:
			time_0 += rasst1 / speed1
			koord1 = fl1
			koord2 = fl2
			speed1 += 1
			speed2 += 1
			flag = True
		elif rasst1 / speed1 < rasst2 / speed2:
			koord1 = fl1
			time_0 += rasst1 / speed1
			if fl1 == fl2:
				flag = True
			fl1 = fl2
			koord2 -= rasst1 / speed1 * speed2
			speed1 += 1
			rasst1 = fl1 - koord1
			rasst2 = koord2 - fl2
		else:
			koord2 = fl2
			time_0 += rasst2 / speed2
			if fl1 == fl2:
				flag = True
			fl2 = fl1
			koord1 += rasst2 / speed2 * speed1
			speed2 += 1
			rasst1 = fl1 - koord1
			rasst2 = koord2 - fl2
	if len(mas) == 0:
		x = speed1 * (koord2 - koord1) / (speed1 + speed2)
		time_0 += x / speed1
	print(time_0)
	i += 1


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	L = list(map(int, input().split()))
	a = b = 1
	va = vb = e = 0
	A = [0]
	B = [0]
	va = va + L[0] / a
	A.append(va)
	a = a + 1
	vb = vb + (l - L[n - 1]) / b
	B.append(vb)
	b = b + 1
	for i in range(1, n):
		va = va + (L[i] - L[i - 1]) / a
		a = a + 1
		A.append(va)
	va = va + (l - L[n - 1]) / a
	A.append(va)
	for i in range(n - 2, -1, -1):
		vb = vb + (L[i + 1] - L[i]) / b
		b = b + 1
		B.append(vb)
	vb = vb + L[0] / b
	B.append(vb)
	B.reverse()
	for i in range(n + 2):
		if B[i] < A[i]:
			d = i - 1
			break
		elif B[i] == A[i]:
			print(B[i])
			e = 1
			break
	va = A[d]
	vb = B[d + 1]
	a = d + 1
	b = n - d + 1
	if d == 0:
		f1 = 0
		f2 = L[0]
	elif d == n:
		f1 = L[n - 1]
		f2 = l
	else:
		f1 = L[d - 1]
		f2 = L[d]
	if va > vb:
		f2 = f2 - b * (va - vb)
		vb = va
	else:
		f1 = f1 + a * (vb - va)
		va = vb
	h = f2 - f1
	g = a + b
	va = va + h / g
	if e == 0:
		print(va)


def is_good(a, mid):
	first = 0
	time1 = 0
	cur = 0
	cur_s = 0
	while cur < len(a) - 1 and time1 < mid:
		cur_s += 1
		cur += 1
		prev = time1
		time1 += (a[cur] - a[cur - 1]) / cur_s
		if time1 <= mid:
			first += a[cur] - a[cur - 1]
		else:
			first += (mid - prev) * cur_s
			break
	second = 0
	time2 = 0
	cur = len(a) - 1
	cur_s = 0
	while cur > 0 and time2 < mid:
		cur_s += 1
		cur -= 1
		prev = time2
		time2 += (a[cur + 1] - a[cur]) / cur_s
		if time2 <= mid:
			second += a[cur + 1] - a[cur]
		else:
			second += (mid - prev) * cur_s
	if first + second >= a[len(a) - 1]:
		return True
	return False
t = int(input())
while t > 0:
	t -= 1
	(n, l) = map(float, input().split())
	a = list(map(float, input().split()))
	a.insert(0, 0)
	a.insert(int(n + 1), l)
	left = 0
	right = l / 2
	for i in range(100):
		mid = (left + right) / 2
		if is_good(a, mid):
			right = mid
		else:
			left = mid
	print(right)


t = int(input())
while t > 0:
	lst = list(map(int, input().split()))
	n = lst[0]
	le = lst[1]
	a = list(map(int, input().split()))
	i = 0
	j = n - 1
	pos = 0
	l = 0
	r = le
	ans = 0
	ls = 1
	lr = 1
	while l < r and i <= j:
		if (a[i] - l) / ls < (r - a[j]) / lr:
			ans = ans + (a[i] - l) / ls
			r = r - lr * ((a[i] - l) / ls)
			l = a[i]
			ls += 1
			i = i + 1
		elif (a[i] - l) / ls == (r - a[j]) / lr:
			ans = ans + (a[i] - l) / ls
			ls += 1
			lr += 1
			l = a[i]
			r = a[j]
			i = i + 1
			j = j - 1
		else:
			ans = ans + (r - a[j]) / lr
			l = l + ls * ((r - a[j]) / lr)
			r = a[j]
			lr += 1
			j = j - 1
	if l != r:
		ans = ans + (r - l) / (ls + lr)
	print(format(ans, '.15f'))
	t = t - 1


def time_to_meet(a, l):
	first_car = [(0, 0, 1, 1)]
	for flag_pos in a:
		(prev_pos, prev_time, prev_speed, _) = first_car[-1]
		dist = flag_pos - prev_pos
		time = prev_time + dist / prev_speed
		first_car.append((flag_pos, time, prev_speed + 1, 1))
	second_car = [(l, 0, -1, 2)]
	for flag_pos in reversed(a):
		(prev_pos, prev_time, prev_speed, _) = second_car[-1]
		dist = flag_pos - prev_pos
		time = prev_time + dist / prev_speed
		second_car.append((flag_pos, time, prev_speed - 1, 2))
	both = sorted(first_car + second_car, key=lambda x: x[1])
	(f_pos, s_pos) = (0, l)
	(f_time, s_time) = (0, 0)
	(f_speed, s_speed) = (1, 1)
	for (idx, data) in enumerate(both):
		(pos, time, speed, car) = data
		if car == 1 and pos < s_pos:
			(f_pos, f_time, f_speed) = (pos, time, speed)
		elif car == 2 and pos > f_pos:
			(s_pos, s_time, s_speed) = (pos, time, speed)
		else:
			break
	t = (s_pos - f_pos - s_time * s_speed + f_time * f_speed) / (f_speed - s_speed)
	return t
t = int(input().rstrip())
for _ in range(t):
	(_, l) = map(int, input().rstrip().split())
	a = list(map(int, input().rstrip().split()))
	print(time_to_meet(a, l))


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
inp = lambda : int(input())
strng = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
strl = lambda : list(input().strip())
mul = lambda : map(int, input().strip().split())
mulf = lambda : map(float, input().strip().split())
seq = lambda : list(map(int, input().strip().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
stdarr = lambda : map(int, stdstr().split())
mod = 1000000007
for _ in range(stdint()):
	(n, l) = stdarr()
	flags = list(stdarr())
	(v1, v2) = (1, 1)
	time = 0
	(c1, c2) = (0, l)
	p1 = 0
	p2 = n - 1
	while 1:
		t1 = (flags[p1] - c1) / v1
		t2 = (c2 - flags[p2]) / v2
		l1 = c1
		l2 = c2
		if t1 < t2:
			c1 = flags[p1]
			d2 = v2 * t1
			c2 -= d2
			if c2 <= c1:
				time += (l2 - l1) / (v2 + v1)
				break
			p1 += 1
			time += t1
			v1 += 1
			if p1 > p2:
				time += (c2 - c1) / (v2 + v1)
				break
		elif t1 > t2:
			c2 = flags[p2]
			d1 = v1 * t2
			c1 += d1
			if c2 <= c1:
				time += (l2 - l1) / (v2 + v1)
				break
			p2 -= 1
			time += t2
			v2 += 1
			if p2 < p1:
				time += (c2 - c1) / (v2 + v1)
				break
		else:
			c1 = flags[p1]
			c2 = flags[p2]
			if c2 <= c1:
				time += (l2 - l1) / (v2 + v1)
				break
			p1 += 1
			p2 -= 1
			time += t1
			v1 += 1
			v2 += 1
			if p2 < p1:
				time += (c2 - c1) / (v2 + v1)
				break
	print(time)


for _ in range(int(input())):
	(n, lr) = map(int, input().split())
	an = list(map(int, input().split()))
	l = 0
	r = n - 1
	lx = 0
	rx = lr
	v1 = 1
	v2 = 1
	ans = 0.0
	while True:
		if l > r or r < l:
			ans += (rx - lx) / (v2 + v1)
			break
		t1 = (an[l] - lx) / v1
		t2 = (rx - an[r]) / v2
		if t1 == t2:
			ans += t1
			l += 1
			r -= 1
			lx += v1 * t1
			rx -= v2 * t2
			v1 += 1
			v2 += 1
		elif t1 < t2:
			ans += t1
			l += 1
			lx += v1 * t1
			rx -= v2 * t1
			v1 += 1
		else:
			ans += t2
			r -= 1
			lx += v1 * t2
			rx -= v2 * t2
			v2 += 1
	print('{0:.18f}'.format(ans))


for t in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	(d1, d2) = (0.0, float(l))
	(s1, s2) = (1.0, 1.0)
	(p1, p2) = (0, n - 1)
	time = 0.0
	while p1 <= p2:
		t = min((a[p1] - d1) / s1, (d2 - a[p2]) / s2)
		time += t
		d1 += t * s1
		d2 -= t * s2
		if d1 >= a[p1]:
			p1 += 1
			s1 += 1
		if d2 <= a[p2]:
			p2 -= 1
			s2 += 1
	time += (d2 - d1) / (s1 + s2)
	print(time)


def solve(n, l, stops):
	c1_l = 0
	c2_l = l
	c1_s = 1
	c2_s = 1
	sp1 = 0
	sp2 = n - 1
	time_taken = 0
	while sp1 < n and sp2 >= 0:
		t1 = (stops[sp1] - c1_l) / c1_s
		t2 = (c2_l - stops[sp2]) / c2_s
		dist_to_travel = 0
		cc2_l = 0
		cc1_l = 0
		if t1 < t2:
			cc1_l = stops[sp1]
			dist_to_travel = c2_s * t1
			cc2_l = c2_l - dist_to_travel
		else:
			cc2_l = stops[sp2]
			dist_to_travel = c1_s * t2
			cc1_l = c1_l + dist_to_travel
		if cc1_l > cc2_l:
			break
		else:
			if t1 < t2:
				c1_s += 1
				sp1 += 1
				time_taken += t1
			elif t2 < t1:
				c2_s += 1
				sp2 -= 1
				time_taken += t2
			else:
				time_taken += t1
				c1_s += 1
				c2_s += 1
				sp1 += 1
				sp2 -= 1
			c1_l = cc1_l
			c2_l = cc2_l
	time_taken += (c2_l - c1_l) / (c1_s + c2_s)
	print(time_taken)
t = int(input())
for i in range(t):
	(n, l) = map(int, input().split())
	stops = list(map(float, input().split()))
	solve(n, l, stops)


import sys
input = lambda : sys.stdin.readline().rstrip()
T = int(input())
for _ in range(T):
	(N, L) = list(map(int, input().split()))
	N += 2
	A = [0] + [int(a) for a in input().split()] + [L]
	x1 = 0
	x2 = N - 1
	(t1, t2) = (0, 0)
	while x2 - x1 > 1:
		a1 = t1 + (A[x1 + 1] - A[x1]) / (x1 + 1)
		a2 = t2 + (A[x2] - A[x2 - 1]) / (N - x2)
		if a1 < a2:
			t1 = a1
			x1 += 1
		else:
			t2 = a2
			x2 -= 1
	if t1 < t2:
		ans = t2 + (A[x2] - A[x1] - (x1 + 1) * (t2 - t1)) / (x1 + 1 + N - x2)
	else:
		ans = t1 + (A[x2] - A[x1] - (N - x2) * (t1 - t2)) / (x1 + 1 + N - x2)
	print(ans)


t = int(input(''))
for _ in range(t):
	(n, l) = map(int, input('').strip().split(' '))
	flags = [0] + list(map(int, input('').strip().split(' '))) + [l]
	schedule1 = [0.0] * (n + 2)
	schedule2 = [0.0] * (n + 2)
	schedule1[0] = float(0)
	speed = 0.0
	for i in range(1, n + 2):
		speed += 1.0
		schedule1[i] = schedule1[i - 1] + float(flags[i] - flags[i - 1]) / speed
	schedule2[-1] = float(0)
	speed = 0.0
	for i in range(n, -1, -1):
		speed += 1.0
		schedule2[i] = schedule2[i + 1] + float(flags[i + 1] - flags[i]) / speed
	arr = [(x - y, z) for (x, y, z) in zip(schedule1, schedule2, flags)]
	speed1 = None
	speed2 = None
	start1 = None
	start2 = None
	result = None
	for (idx, (x, y)) in enumerate(arr):
		if x == 0:
			result = schedule1[idx]
			break
		elif x > 0:
			start1 = schedule1[idx - 1]
			start2 = schedule2[idx]
			distance = flags[idx] - flags[idx - 1]
			speed1 = idx
			speed2 = len(flags) - idx
			if start1 > start2:
				distance -= (start1 - start2) * speed2
				time = start1
			else:
				distance -= (start2 - start1) * speed1
				time = start2
			result = time + distance / (speed1 + speed2)
			break
	print(result)


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from bisect import *
from math import sqrt
import math
from itertools import permutations

def main():
	for _ in range(int(input())):
		(n, l) = map(int, input().split())
		a = list(map(int, input().split()))
		if n == 1:
			if a[0] == l - a[0]:
				print(a[0])
			elif a[0] > l - a[0]:
				print(l - a[0] + (2 * a[0] - l) / (2 + 1))
			else:
				print(a[0] + (l - 2 * a[0]) / (2 + 1))
		else:
			b = [0, a[0]]
			c = [0, l - a[-1]]
			for i in range(n - 1):
				b.append(b[-1] + (a[i + 1] - a[i]) / (i + 2))
			b.append(b[-1] + (l - a[-1]) / (n + 1))
			for i in range(n - 1, 0, -1):
				c.append(c[-1] + (a[i] - a[i - 1]) / (n - i + 1))
			c.append(b[-1] + (c[-1] + a[0] / (n + 1)))
			c.reverse()
			ind = -1
			for i in range(n + 2):
				if b[i] > c[i]:
					ind = i
					break
			a.append(l)
			a = [0] + a
			if ind >= 1:
				d = (c[ind] - b[ind - 1]) * ind + a[ind - 1]
				print(c[ind] + (a[ind] - d) / (n + 2))
			else:
				print(c[ind + 1] + (a[0] - c[ind + 1]) / (n + 2))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a = [0] + a + [l]
	left = [0]
	for i in range(1, n + 2):
		left.append(left[-1] + (a[i] - a[i - 1]) / i)
	right = [0]
	for i in range(1, n + 2):
		right.append(right[-1] + (a[-i] - a[-i - 1]) / i)
	right = right[::-1]
	poss = []
	for i in range(n + 1):
		rs = n + 1 - i
		ls = i + 1
		if right[i + 1] <= left[i + 1] and left[i] <= right[i]:
			dist = a[i + 1] - a[i]
			if right[i + 1] < left[i]:
				dist -= (left[i] - right[i + 1]) * rs
				curr = left[i]
			else:
				dist -= (right[i + 1] - left[i]) * ls
				curr = right[i + 1]
			poss.append(curr + dist / (ls + rs))
	print(min(poss))


for _ in range(int(input())):
	(n, l) = list(map(int, input().split()))
	f = list(map(int, input().split()))
	(s, e, i, j) = (0, l, 0, n - 1)
	(s1, s2) = (1, 1)
	time = 0
	while j >= i:
		c = (f[i] - s) / s1
		d = (e - f[j]) / s2
		if c < d:
			time += c
			s = f[i]
			e -= c * s2
			s1 += 1
			i += 1
		elif d < c:
			time += d
			s += d * s1
			e = f[j]
			s2 += 1
			j -= 1
		else:
			time += c
			s = f[i]
			e = f[j]
			i += 1
			j -= 1
			s1 += 1
			s2 += 1
	time += (e - s) / (s1 + s2)
	print('%.8f' % time)


import bisect
mdd = 10 ** (-6)
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	a1 = [0]
	for i in range(len(a) - 2, -1, -1):
		a1.append(a1[-1] + a[i + 1] - a[i])
	time = [0]
	for i in range(1, len(a)):
		time.append(time[-1] + (a[i] - a[i - 1]) / i)
	time1 = [0]
	for i in range(1, len(a1)):
		time1.append(time1[-1] + (a1[i] - a1[i - 1]) / i)
	x = 0
	y = l
	while x < y:
		mid = (x + y) / 2
		s = bisect.bisect_right(a, mid)
		t1 = time[s - 1] + (mid - a[s - 1]) / s
		s = bisect.bisect_right(a1, l - mid)
		t2 = time1[s - 1] + (l - mid - a1[s - 1]) / s
		if abs(t1 - t2) <= mdd:
			t1 = min(t1, t2)
			break
		elif t1 < t2:
			x = mid
		else:
			y = mid
	print(t1)


import sys
import math
from collections import deque
from bisect import bisect_left, bisect_right
I = sys.stdin.readline
II = lambda : int(I())
IN = lambda x: map(int, x.split())
L = lambda x: list(IN(x))
M = 1000000007
P = print
T = True
F = False
for _ in range(II()):
	(n, l) = IN(I())
	a = L(I())
	if l < 3:
		P(l / 2)
		continue
	time1 = [a[0]]
	time2 = [l - a[n - 1]]
	i = 1
	j = n - 2
	si = sj = 2
	while i < n:
		time1.append(time1[-1] + (a[i] - a[i - 1]) / si)
		si += 1
		i += 1
		time2.append(time2[-1] + (a[j + 1] - a[j]) / sj)
		sj += 1
		j -= 1
	i = 0
	while i < n and time1[i] < time2[n - i - 1]:
		i += 1
	if i == n:
		i -= 1
		dis = time2[0] - time1[i]
	else:
		dis = (time1[i] - time2[n - i - 1]) * (i + 1)
	P(min(time1[i], time2[n - i - 1]) + dis / (n + 2))


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	b = [a[i + 1] - a[i] for i in range(n + 1)]
	ansl = 0
	le = 0
	lf = 1
	ansr = 0
	ri = n
	rf = 1
	while le != ri:
		if ansl + b[le] / lf < ansr + b[ri] / rf:
			ansl += b[le] / lf
			le += 1
			lf += 1
		else:
			ansr += b[ri] / rf
			ri -= 1
			rf += 1
	t = b[le]
	ans = max(ansl, ansr)
	if ansl < ansr:
		t -= (ansr - ansl) * lf
	if ansl > ansr:
		t -= (ansl - ansr) * rf
	print(ans + t / (lf + rf))


def put():
	return [int(x) for x in input().split()]
t = int(input())
for _ in range(t):
	(n, k) = put()
	l = list(put())
	l.append(k)
	l.insert(0, 0)
	speed = 0
	a = [0]
	b = [0]
	for i in range(1, n + 2):
		speed += 1
		a.append(a[-1] + (l[i] - l[i - 1]) / speed)
		b.append(b[-1] + (l[n - i + 2] - l[n - i + 1]) / speed)
	b.reverse()
	ans = 0
	for i in range(0, n + 1):
		if a[i] <= b[i] and a[i + 1] > b[i + 1]:
			ans = i
	i = ans
	res = a[i] + ((n + 1 - i) * (b[i + 1] - a[i]) + (l[i + 1] - l[i])) / (n + 2)
	print(res)


import os
import sys
from io import BytesIO, IOBase
import math

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)
for xyz in range(0, int(input())):
	(ll, n) = map(int, input().split())
	l = list(map(int, input().split()))
	t = 0
	posa = 0
	posb = n
	sa = 1
	sb = 1
	i = 0
	j = ll - 1
	while ll > 0:
		t1 = (l[i] - posa) / sa
		t2 = (posb - l[j]) / sb
		if t1 < t2:
			t += t1
			posa += sa * t1
			posb -= sb * t1
			sa += 1
			ll -= 1
			i += 1
		elif t2 < t1:
			t += t2
			posa += sa * t2
			posb -= sb * t2
			sb += 1
			ll -= 1
			j -= 1
		else:
			t += t1
			posa += sa * t1
			posb -= sb * t1
			sa += 1
			sb += 1
			ll -= 2
			i += 1
			j -= 1
	print(t + abs(posb - posa) / (sa + sb))


for test in range(int(input())):
	[n, l] = list(map(int, input().split(' ')))
	a = list(map(int, input().split(' ')))
	a.insert(0, 0)
	a.append(l)
	x = [0] * (n + 2)
	y = [0] * (n + 2)
	vx = 1
	vy = 1
	for i in range(1, n + 2):
		x[i] = x[i - 1] + (a[i] - a[i - 1]) / vx
		vx += 1
		y[n + 1 - i] = y[n + 2 - i] + (a[n + 2 - i] - a[n + 1 - i]) / vy
		vy += 1
	j = 0
	while x[j] < y[j]:
		j += 1
	if x[j - 1] <= y[j]:
		ax = a[j - 1] + (y[j] - x[j - 1]) * j
		res = y[j] + (a[j] - ax) / (n + 2)
	elif x[j - 1] > y[j]:
		ay = a[j] - (x[j - 1] - y[j]) * (n + 2 - j)
		res = x[j - 1] + (ay - a[j - 1]) / (n + 2)
	print(res)


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
INF = float('inf')
mod = int(1000000000.0) + 7
for t in range(int(data())):
	(n, l) = mdata()
	a = mdata()
	at = [0]
	bt = [0]
	for i in range(n):
		if i == 0:
			at.append(at[-1] + a[i] / (i + 1))
			bt.append(bt[-1] + (l - a[n - i - 1]) / (i + 1))
			continue
		at.append(at[-1] + (a[i] - a[i - 1]) / (i + 1))
		bt.append(bt[-1] + (a[n - i] - a[n - i - 1]) / (i + 1))
	(start, end) = (0, l)
	a = [0] + a + [l]
	while end - start > 10 ** (-6):
		mid = (start + end) / 2
		ak = br(at, mid) - 1
		bk = br(bt, mid) - 1
		if a[ak] + (ak + 1) * (mid - at[ak]) > a[n + 1 - bk] - (bk + 1) * (mid - bt[bk]):
			end = mid
		else:
			start = mid
	out(end)


t = int(input())
for _ in range(t):
	(n, l) = [int(p) for p in input().split()]
	arr = [int(p) for p in input().split()]
	arr.append(l)
	arr.insert(0, 0)
	t1 = []
	t2 = []
	for i in range(1, n + 2):
		t1.append((arr[i] - arr[i - 1]) / i)
	for i in range(n + 1, 0, -1):
		t2.append((arr[i] - arr[i - 1]) / (n + 2 - i))
	for i in range(1, n + 1):
		t1[i] += t1[i - 1]
		t2[i] += t2[i - 1]
	t1.insert(0, 0)
	t2.insert(0, 0)
	t2.reverse()
	for i in range(len(t1)):
		if t1[i] == t2[i]:
			print(t1[i])
			break
		elif t1[i] > t2[i]:
			v1 = i
			v2 = n + 2 - i
			print(t2[i] + (arr[i] - arr[i - 1] - v1 * (t2[i] - t1[i - 1])) / (v1 + v2))
			break


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	(x, y) = (0, l)
	(left, right) = (1, 1)
	(indleft, indright) = (0, n - 1)
	t = 0
	while indleft <= indright:
		(timeleft, timeright) = ((a[indleft] - x) / left, (y - a[indright]) / right)
		if timeleft < timeright:
			t += timeleft
			x = a[indleft]
			indleft += 1
			y -= timeleft * right
			left += 1
		elif timeleft > timeright:
			t += timeright
			y = a[indright]
			indright -= 1
			x += timeright * left
			right += 1
		else:
			t += timeright
			y = a[indright]
			x = a[indleft]
			indleft += 1
			indright -= 1
			left += 1
			right += 1
	t += (y - x) / (left + right)
	print(t)


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a.append(l)
	a.reverse()
	a.append(0)
	a.reverse()
	forwardtime = [0] * (n + 2)
	backwardtime = [0] * (n + 2)
	for i in range(n + 1):
		forwardtime[i + 1] = forwardtime[i] + (a[i + 1] - a[i]) / (i + 1)
		backwardtime[n - i] = backwardtime[n + 1 - i] + (a[n + 1 - i] - a[n - i]) / (i + 1)
	for i in range(n + 2):
		if forwardtime[i] > backwardtime[i]:
			pointer = i
			break
	if backwardtime[pointer] > forwardtime[pointer - 1]:
		ans = (backwardtime[pointer] - forwardtime[pointer - 1]) * pointer
		print(backwardtime[pointer] + (a[pointer] - a[pointer - 1] - ans) / (n + 2))
	else:
		ans = (backwardtime[pointer] - forwardtime[pointer - 1]) * (n + 2 - pointer)
		print(forwardtime[pointer - 1] + (a[pointer] - a[pointer - 1] + ans) / (n + 2))


tc = int(input())
while tc:
	tc -= 1
	(n, r) = map(int, input().split())
	l = list(map(int, input().split()))
	i = 0
	j = n - 1
	t = 0
	a = 0
	b = r
	av = 1
	bv = 1
	while i <= j:
		if (l[i] - a) / av < (b - l[j]) / bv:
			b -= bv * (l[i] - a) / av
			t += (l[i] - a) / av
			a = l[i]
			av += 1
			i += 1
		elif (l[i] - a) / av > (b - l[j]) / bv:
			t += (b - l[j]) / bv
			a += av * (b - l[j]) / bv
			b = l[j]
			bv += 1
			j -= 1
		else:
			t += (l[i] - a) / av
			a = l[i]
			b = l[j]
			av += 1
			bv += 1
			j -= 1
			i += 1
	av += bv
	t += (b - a) / av
	print(t)


def getStreckeOne(t):
	flagPos = 0
	carPos = 0
	carSpeed = 1
	roadCovered = 0
	while t > 0:
		if flagPos + 1 <= n:
			timeToNextFlag = (a[flagPos] - carPos) / carSpeed
		else:
			roadCovered += t * carSpeed
			break
		if t > timeToNextFlag:
			t -= timeToNextFlag
			carPos = a[flagPos]
			roadCovered = carPos
			carSpeed += 1
			flagPos += 1
		elif t == timeToNextFlag:
			roadCovered = a[flagPos]
			break
		else:
			roadCovered += t * carSpeed
			break
	return roadCovered

def getStreckeTwo(t):
	flagPos = -1
	carPos = l
	carSpeed = 1
	roadCovered = 0
	while t > 0:
		if -flagPos <= n:
			timeToNextFlag = (carPos - a[flagPos]) / carSpeed
		else:
			roadCovered += t * carSpeed
			break
		if t > timeToNextFlag:
			t -= timeToNextFlag
			carPos = a[flagPos]
			roadCovered = l - carPos
			carSpeed += 1
			flagPos -= 1
		elif t == timeToNextFlag:
			roadCovered = l - a[flagPos]
			break
		else:
			roadCovered += t * carSpeed
			break
	return roadCovered
t = int(input())
for _ in range(t):
	(n, l) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	(A, B) = (0, l)
	while True:
		AB = (A + B) / 2
		(s1, s2) = (getStreckeOne(AB), getStreckeTwo(AB))
		if B - A <= 10 ** (-6):
			break
		elif s1 + s2 > l:
			B = AB
		elif s1 + s2 < l:
			A = AB
		elif s1 + s2 == l:
			break
	print(AB)


for s in range(int(input())):
	(n, l) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	(i, j) = (0, n - 1)
	(x, y) = (0, l)
	(va, vb) = (1, 1)
	total_t = 0
	while i <= j:
		ta = (a[i] - x) / va
		tb = (y - a[j]) / vb
		if ta >= tb:
			y = a[j]
			x = x + va * tb
			j -= 1
			vb += 1
			total_t += tb
		else:
			x = a[i]
			y = y - vb * ta
			i += 1
			va += 1
			total_t += ta
	total_t += (y - x) / (va + vb)
	print(total_t)


import math
for _ in range(int(input())):
	(k, n) = map(int, input().split())
	arr = list(map(int, input().split()))
	ans = 0
	(p1, p2) = (0, k - 1)
	(pos1, pos2) = (0, n)
	(v1, v2) = (1, 1)
	flags = int(k)
	while flags:
		(val1, val2) = ((arr[p1] - pos1) / v1, (pos2 - arr[p2]) / v2)
		if val1 > val2:
			ans += val2
			v2 += 1
			pos2 = int(arr[p2])
			p2 -= 1
			pos1 += v1 * val2
			flags -= 1
		else:
			ans += val1
			v1 += 1
			pos1 = int(arr[p1])
			p1 += 1
			pos2 -= v2 * val1
			flags -= 1
	ans += abs(pos2 - pos1) / (v1 + v2)
	print(ans)


tc = int(input())
for _ in range(tc):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	di = 0.0
	dj = float(l)
	si = 1.0
	sj = 1.0
	i = 0
	j = n - 1
	tim = 0
	while i <= j:
		t = min((a[i] - di) / si, (dj - a[j]) / sj)
		tim += t
		di += t * si
		dj -= t * sj
		if di >= a[i]:
			i += 1
			si += 1
		if dj <= a[j]:
			j -= 1
			sj += 1
	tim += (dj - di) / (sj + si)
	print(tim)


t = int(input())
for _ in range(0, t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	x1 = 0
	x2 = k
	i = 0
	j = n - 1
	s1 = 1
	s2 = 1
	ans = 0
	while i <= j:
		if (a[i] - x1) / s1 == (x2 - a[j]) / s2:
			ans += (a[i] - x1) / s1
			s1 += 1
			s2 += 1
			x1 = a[i]
			x2 = a[j]
			i += 1
			j -= 1
		elif (a[i] - x1) / s1 < (x2 - a[j]) / s2:
			time = (a[i] - x1) / s1
			ans += time
			x1 = a[i]
			x2 -= time * s2
			s1 += 1
			i += 1
		elif (x2 - a[j]) / s2 < (a[i] - x1) / s1:
			time = (x2 - a[j]) / s2
			ans += time
			x2 = a[j]
			x1 += time * s1
			s2 += 1
			j -= 1
	ans += (x2 - x1) / (s1 + s2)
	print('%.15f' % ans)


import math
teststring = '5\n2 10\n1 9\n1 10\n1\n5 7\n1 2 3 4 6\n2 1000000000\n413470354 982876160\n9 478\n1 10 25 33 239 445 453 468 477\n'
online = __file__ != '/home/jhli/py/Grakn/Problem_B.py'
(true, false) = (True, False)
if True:

	def spitout():
		for c in teststring.splitlines():
			yield c
	_ito = spitout()
	if not online:

		def input():
			return next(_ito)

	def build_enum(*a):
		built = dict()
		for (i, c) in enumerate(a):
			built[c] = i
		return lambda x: built[x]
T = int(input())
for ti in range(1, T + 1):
	[n, l] = map(int, input().split(' '))
	a = [0]
	a.extend([int(e) for e in input().split(' ')])
	pos1 = 0
	pos2 = l
	flag1 = 0
	flag2 = n + 1
	speed1 = speed2 = 1
	tt = 0
	while flag2 - flag1 > 1:
		t1 = (a[flag1 + 1] - pos1) / speed1
		t2 = (pos2 - a[flag2 - 1]) / speed2
		if t1 < t2:
			pos1 = a[flag1 + 1]
			pos2 -= speed2 * t1
			flag1 += 1
			tt += t1
			speed1 += 1
		elif t2 < t1:
			pos1 += speed1 * t2
			pos2 = a[flag2 - 1]
			flag2 -= 1
			tt += t2
			speed2 += 1
		else:
			pos1 = a[flag1 + 1]
			pos2 = a[flag2 - 1]
			flag1 += 1
			flag2 -= 1
			tt += t1
			speed1 += 1
			speed2 += 1
	tt += (pos2 - pos1) / (speed1 + speed2)
	print(tt)


def its(l, r, x, y):
	return min(r, y) - max(l, x)
for t in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	(d1, d2) = ([0.0] * (n + 2), [0.0] * (n + 2))
	for i in range(1, n + 2):
		d1[i] = d1[i - 1] + (a[i] - a[i - 1]) / i
	for i in range(n, -1, -1):
		d2[i] = d2[i + 1] + (a[i + 1] - a[i]) / (n - i + 1)
	i = 0
	while i <= n + 1 and d1[i] != d2[i]:
		i += 1
	if i <= n + 1:
		print(d1[i])
	else:
		i = 0
		while i + 1 <= n + 1 and its(d1[i], d1[i + 1], d2[i + 1], d2[i]) < 0:
			i += 1
		(vx, tx) = (i + 1, d1[i])
		(vy, ty) = (n - i + 1, d2[i + 1])
		if tx < ty:
			dt = (a[i + 1] - a[i] - vx * (ty - tx)) / (vx + vy)
			print(ty + dt)
		else:
			dt = (a[i + 1] - a[i] - vy * (tx - ty)) / (vx + vy)
			print(tx + dt)


t = int(input(''))
for _ in range(t):
	[n, l] = list(map(int, input().split()))
	a = list(map(int, input().split()))
	dp = [0] * (n + 2)
	dp1 = [0] * (n + 2)
	dp[0] = 0
	dp[1] = a[0]
	dp1[n + 1] = 0
	dp1[n] = l - a[n - 1]
	cur = 2
	if n == 1:
		t = min(a[0], l - a[0])
		ans = (l - 2 * t) / 3
		print(ans + t)
		continue
	for i in range(1, n):
		dp[i + 1] = dp[i] + (a[i] - a[i - 1]) / cur
		cur += 1
	dp[n + 1] = dp[n] + (l - a[i]) / cur
	cur2 = 2
	for i in range(n - 1, 0, -1):
		dp1[i] = dp1[i + 1] + (a[i] - a[i - 1]) / cur2
		cur2 += 1
	dp1[0] = dp1[1] + a[0] / cur
	for j in range(n + 2):
		if dp[j] >= dp1[j]:
			break
	if dp[j] == dp1[j]:
		print(dp[j])
		break
	v1 = [0] * (n + 2)
	v2 = [0] * (n + 2)
	inc1 = 1
	for i in range(n + 2):
		v1[i] = inc1
		inc1 += 1
	v2 = v1.copy()
	v2.reverse()
	if j == 1:
		x = dp1[1]
		y = a[0]
		t = x
		print(t + (y - x) / (v2[1] + 1))
		continue
	if j == n + 1:
		t = dp[j - 1]
		x = a[n - 1]
		y = l - t
		print(t + (y - x) / (v1[n] + 1))
		continue
	ind = j - 2
	x = a[ind]
	y = a[ind + 1]
	t = dp1[j]
	if t > dp[j - 1]:
		x += (t - dp[j - 1]) * v1[j - 1]
		t += (y - x) / (v1[j - 1] + v2[j])
	else:
		t = dp[j - 1]
		y -= (t - dp1[j]) * v2[j]
		t += (y - x) / (v1[j - 1] + v2[j])
	print(t)


def solve():
	(N, L) = map(int, input().split())
	A = [int(x) for x in input().split()]
	A = [0] + A + [L]
	t1 = [0] * len(A)
	v1 = [1] * len(A)
	for i in range(1, len(A)):
		distance = A[i] - A[i - 1]
		t1[i] = t1[i - 1] + distance / v1[i - 1]
		v1[i] = v1[i - 1] + 1
	t2 = [0] * len(A)
	v2 = [1] * len(A)
	for i in range(len(A) - 2, -1, -1):
		distance = A[i + 1] - A[i]
		t2[i] = t2[i + 1] + distance / v2[i + 1]
		v2[i] = v2[i + 1] + 1
	for i in range(len(A) - 1):
		if t1[i] <= t2[i] and t1[i + 1] >= t2[i + 1]:
			denom = v1[i] + v2[i + 1]
			nomin = A[i + 1] - A[i] + t1[i] * v1[i] + t2[i + 1] * v2[i + 1]
			return nomin / denom
TC = int(input())
for _ in range(TC):
	print('{:.8f}'.format(solve()))


import math
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(100000)

def put():
	return map(int, stdin.readline().split())

def check(l, time, k):
	l = [0] + l + [k]
	t1 = 0
	d1 = 0
	s = 0
	ind = 0
	n = len(l)
	while ind < n - 1 and t1 < time:
		s += 1
		t1 += (l[ind + 1] - l[ind]) / s
		if t1 >= time:
			d1 = l[ind] + s * (time - t1 + (l[ind + 1] - l[ind]) / s)
			break
		else:
			d1 = l[ind + 1]
		ind += 1
	ind = len(l) - 1
	s = 0
	t2 = 0
	d2 = 0
	while ind > 0 and t2 < time:
		s += 1
		t2 += (l[ind] - l[ind - 1]) / s
		if t2 >= time:
			d2 = k - l[ind] + s * (time - t2 + (l[ind] - l[ind - 1]) / s)
			break
		else:
			d2 = k - l[ind - 1]
		ind -= 1
	if d1 + d2 > k:
		return 1
	return 0

def binarysearch(l, start, end, k):
	mid = (start + end) / 2
	if end - start < 10 ** (-6):
		return 10000000000
	elif check(l, mid, k):
		return min(mid, binarysearch(l, start, mid, k))
	else:
		return binarysearch(l, mid, end, k)
for _ in range(int(input())):
	(n, k) = put()
	l = list(map(int, input().split()))
	print(binarysearch(l, 0, 10 ** 9, k))


def solve(flags, n, k):
	(sa, sb) = (1, 1)
	(ca, cb) = (0, n)
	tim_tak = 0
	(i, j) = (0, k - 1)
	while ca != cb and i <= j:
		(fa, fb) = (flags[i], flags[j])
		(da, db) = (fa - ca, cb - fb)
		(ta, tb) = (da / sa, db / sb)
		if ta < tb:
			(ca, cb) = (fa, cb - sb * ta)
			tim_tak += ta
			(sa, i) = (sa + 1, i + 1)
		elif ta == tb:
			tim_tak += ta
			(i, j) = (i + 1, j - 1)
			(ca, cb) = (fa, fb)
			(sa, sb) = (sa + 1, sb + 1)
		else:
			(ca, cb) = (ca + tb * sa, fb)
			tim_tak += tb
			(sb, j) = (sb + 1, j - 1)
	if ca == cb:
		return tim_tak
	tim_tak += (cb - ca) / (sa + sb)
	return tim_tak
for case in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = solve(a, l, n)
	print('%.7f' % ans)


from sys import stdin, stdout, setrecursionlimit

class Tail_Recursion_Optimization:

	def __init__(self, RECURSION_LIMIT, STACK_SIZE):
		setrecursionlimit(RECURSION_LIMIT)
		threading.stack_size(STACK_SIZE)
		return None

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		ans = []
		for q in range(int(R())):
			(n, l) = [int(x) for x in R().split()]
			a = [int(x) for x in R().split()]
			left_car = {}
			right_car = {}
			for j in range(n):
				if j == 0:
					left_car[j] = a[j]
				else:
					left_car[j] = left_car[j - 1] + (a[j] - a[j - 1]) / (j + 1)
			for j in range(n - 1, -1, -1):
				if j == n - 1:
					right_car[n - 1] = l - a[j]
				else:
					right_car[j] = (a[j + 1] - a[j]) / (n - j) + right_car[j + 1]
			flg = 0
			for i in range(n):
				if left_car[i] >= right_car[i]:
					if i == 0:
						x = a[i]
						c = right_car[i]
					else:
						x = a[i] - a[i - 1]
						c = right_car[i] - left_car[i - 1]
					x1 = (i + 1) / (n + 2) * (c * (n - i + 1) + x)
					t1 = (0 if not i else left_car[i - 1]) + x1 / (i + 1)
					flg = 1
					break
			if flg:
				ans.append(str(t1))
				continue
			x = l - a[n - 1]
			c = 0 - left_car[n - 1]
			x1 = (n + 1) / (n + 2) * (c + x)
			t1 = left_car[n - 1] + x1 / (n + 1)
			ans.append(str(t1))
		W('\n'.join(ans))
		return 0

def main():
	s = SOLVE()
	s.solve()
main()


import os
import math
true = True
false = False
from functools import reduce
is_dev = 'vscode' in os.environ
if is_dev:
	inF = open('in.txt', 'r')
	outF = open('out.txt', 'w')

def ins():
	return list(map(int, input_().split(' ')))

def inss():
	return list(input_().split(' '))

def input_():
	if is_dev:
		return inF.readline()[:-1]
	else:
		return input()

def ranin():
	return range(int(input_()))

def print_(data):
	if is_dev:
		outF.write(str(data) + '\n')
	else:
		print(data)
epsilon = 1e-07
for _ in range(int(input_())):
	(n, l) = ins()
	a = ins()
	t = 0
	locA = 0
	locB = l
	speedA = speedB = 1
	time = 0
	ai = 0
	bi = len(a) - 1
	next_checkpoint_a = a[ai]
	next_checkpoint_b = a[bi]
	next_step_time = 0
	while True:
		next_checkpoint_a = a[ai] if ai < len(a) else l
		next_checkpoint_b = a[bi] if bi >= 0 else 0
		next_checkpoint_a_diff = next_checkpoint_a - locA
		next_checkpoint_b_diff = locB - next_checkpoint_b
		time_next_cp_a = next_checkpoint_a_diff / speedA
		time_next_cp_b = next_checkpoint_b_diff / speedB
		if abs(time_next_cp_a - time_next_cp_b) <= epsilon:
			next_step_time = time_next_cp_a
			if locB - speedB * next_step_time - (locA + speedA * next_step_time) > epsilon:
				locA += speedA * next_step_time
				locB -= speedB * next_step_time
			else:
				break
			speedA += 1
			speedB += 1
			ai += 1
			bi -= 1
		elif time_next_cp_a < time_next_cp_b:
			next_step_time = time_next_cp_a
			if locB - speedB * next_step_time - (locA + speedA * next_step_time) > epsilon:
				locA += speedA * next_step_time
				locB -= speedB * next_step_time
			else:
				break
			speedA += 1
			ai += 1
		else:
			next_step_time = time_next_cp_b
			if locB - speedB * next_step_time - (locA + speedA * next_step_time) > epsilon:
				locA += speedA * next_step_time
				locB -= speedB * next_step_time
			else:
				break
			speedB += 1
			bi -= 1
		time += next_step_time
	diff = locB - locA
	crash_time = diff / (speedA + speedB)
	next_checkpoint_a = a[ai] if ai < len(a) else l
	next_checkpoint_b = a[bi] if bi >= 0 else 0
	next_checkpoint_a_diff = next_checkpoint_a - locA
	next_checkpoint_b_diff = locB - next_checkpoint_b
	time_next_cp_a = next_checkpoint_a_diff / speedA
	time_next_cp_b = next_checkpoint_b_diff / speedB
	if abs(time_next_cp_a - time_next_cp_b) <= epsilon:
		next_step_time = time_next_cp_a
		speedA += 1
		speedB += 1
		ai += 1
		bi -= 1
	elif time_next_cp_a < time_next_cp_b:
		next_step_time = time_next_cp_a
		speedA += 1
		ai += 1
	else:
		next_step_time = time_next_cp_b
		speedB += 1
		bi -= 1
	while crash_time > next_step_time:
		locA += speedA * next_step_time
		locB -= speedB * next_step_time
		time += next_step_time
		print(time, locA, locB)
		next_checkpoint_a = a[ai] if ai < len(a) else l
		next_checkpoint_b = a[bi] if bi >= 0 else 0
		next_checkpoint_a_diff = next_checkpoint_a - locA
		next_checkpoint_b_diff = locB - next_checkpoint_b
		time_next_cp_a = next_checkpoint_a_diff / speedA
		time_next_cp_b = next_checkpoint_b_diff / speedB
		if abs(time_next_cp_a - time_next_cp_b) <= epsilon:
			next_step_time = time_next_cp_a
			speedA += 1
			speedB += 1
			ai += 1
			bi -= 1
		elif time_next_cp_a < time_next_cp_b:
			next_step_time = time_next_cp_a
			speedA += 1
			ai += 1
		else:
			next_step_time = time_next_cp_b
			speedB += 1
			bi -= 1
		diff = locB - locA
		crash_time = diff / (speedA + speedB)
	time += crash_time
	print_(time)
if is_dev:
	outF.close()

	def compare_file():
		print(open('out.txt', 'r').read() == open('outactual.txt', 'r').read())
	compare_file()


def main():
	for _ in range(int(input())):
		(n, l) = map(int, input().split())
		a = list(map(int, input().split()))
		ans = 0
		(df, ds) = (0, l)
		(vf, vs) = (1, 1)
		(i, j) = (0, n - 1)
		while i <= j:
			if a[i] - df == ds - a[j] and vf == vs:
				ans += (a[i] - df) / vf
				vf += 1
				vs += 1
				df = a[i]
				ds = a[j]
				i += 1
				j -= 1
			else:
				tf = (a[i] - df) / vf
				ts = (ds - a[j]) / vs
				if tf == ts:
					ans += ts
					vf += 1
					vs += 1
					df = a[i]
					ds = a[j]
					i += 1
					j -= 1
				else:
					t = min(tf, ts)
					ans += t
					df += t * vf
					ds -= t * vs
					if t == tf:
						vf += 1
						i += 1
					else:
						vs += 1
						j -= 1
		d = ds - df
		ans += d / (vf + vs)
		print(ans)
main()


T = int(input())
while T > 0:
	(n, l) = map(int, input().split())
	arr = list(map(int, input().split()))
	l_arrive = [0] * len(arr)
	cur_speed = 1
	cur_pos = 0
	t = 0.0
	index = 0
	while index < len(arr):
		dis = arr[index] - cur_pos
		t += dis / cur_speed
		l_arrive[index] = t
		cur_speed += 1
		cur_pos = arr[index]
		index += 1
	r_arrive = [0] * len(arr)
	cur_pos = l
	cur_speed = 1
	t = 0.0
	index = len(arr) - 1
	while index >= 0:
		dis = cur_pos - arr[index]
		t += dis / cur_speed
		r_arrive[index] = t
		cur_speed += 1
		cur_pos = arr[index]
		index -= 1
	l_pos = -1
	for i in range(len(arr)):
		if l_arrive[i] < r_arrive[i]:
			l_pos = i
		else:
			break
	l_speed = l_pos + 2
	r_pos = l_pos + 1
	r_speed = len(arr) - r_pos + 1
	total = 0
	if l_pos == -1:
		dis = arr[0] - r_arrive[0]
		total = dis / (1 + r_speed)
		total += r_arrive[0]
	elif r_pos == len(arr):
		dis = l - l_arrive[-1] - arr[-1]
		total = dis / (1 + l_speed)
		total += l_arrive[-1]
	elif l_arrive[l_pos] < r_arrive[r_pos]:
		time_diff = r_arrive[r_pos] - l_arrive[l_pos]
		dis = arr[r_pos] - arr[l_pos] - l_speed * time_diff
		total = dis / (l_speed + r_speed)
		total += r_arrive[r_pos]
	else:
		time_diff = l_arrive[l_pos] - r_arrive[r_pos]
		dis = arr[r_pos] - arr[l_pos] - r_speed * time_diff
		total = dis / (l_speed + r_speed)
		total += l_arrive[l_pos]
	print(total)
	T -= 1


t = int(input())
for _ in range(t):
	(n, l) = list(map(int, input().split()))
	c = list(map(int, input().split()))
	pa = 0
	pb = l
	sa = 1
	sb = 1
	t = 0
	i = 0
	j = n - 1
	while True:
		if i > j:
			t += (pb - pa) / (sa + sb)
			break
		if (c[i] - pa) / sa < (pb - c[j]) / sb:
			t += (c[i] - pa) / sa
			pb -= sb * (c[i] - pa) / sa
			pa = c[i]
			sa += 1
			i += 1
		else:
			t += (pb - c[j]) / sb
			pa += sa * (pb - c[j]) / sb
			pb = c[j]
			sb += 1
			j -= 1
	print(t)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	milestoneA = [0, A[0]]
	speed = 2
	for i in range(1, n):
		milestoneA.append(milestoneA[-1] + (A[i] - A[i - 1]) / speed)
		speed += 1
	milestoneA.append(milestoneA[-1] + (k - A[-1]) / speed)
	B = [k - A[i] for i in range(n - 1, -1, -1)]
	milestoneB = [0, B[0]]
	speed = 2
	for i in range(1, n):
		milestoneB.append(milestoneB[-1] + (B[i] - B[i - 1]) / speed)
		speed += 1
	milestoneB.append(milestoneB[-1] + (k - B[-1]) / speed)
	milestoneB.reverse()
	A = [0] + A + [k]
	for i in range(n + 2):
		if milestoneA[i] > milestoneB[i]:
			speedA = i
			speedB = n + 2 - i
			res = (milestoneA[i] + speedB / speedA * milestoneB[i]) / (1 + speedB / speedA)
			print(res)
			break


from sys import stdin
tt = int(stdin.readline())
for loop in range(tt):
	(n, l) = map(int, stdin.readline().split())
	a = list(map(int, stdin.readline().split()))
	a = [0] + a + [l]
	L = [0]
	now = 1
	for i in range(1, n + 2):
		L.append(L[-1] + (a[i] - a[i - 1]) / now)
		now += 1
	R = [0]
	now = 1
	for i in range(n + 1, 0, -1):
		R.append(R[-1] + (a[i] - a[i - 1]) / now)
		now += 1
	R.reverse()
	rside = None
	for i in range(n + 2):
		if L[i] > R[i]:
			rside = i
			break
	lside = rside - 1
	ll = a[lside]
	rr = a[rside]
	while abs(rr - ll) > 10 ** (-7) and abs(rr - ll) > ll * 10 ** (-7):
		mid = (ll + rr) / 2
		ltime = L[lside] + (mid - a[lside]) / (lside + 1)
		rtime = R[rside] + (a[rside] - mid) / (n + 2 - rside)
		if ltime < rtime:
			ll = mid
		else:
			rr = mid
	ltime = L[lside] + (ll - a[lside]) / (lside + 1)
	print(ltime)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		(n, l) = list(map(int, input().split()))
		flags = list(map(int, input().split()))
		(s, e) = (0, n)
		(lSpeed, rSpeed) = (1, 1)
		timeSpend = 0
		(lpos, rpos) = (0, l)
		while s <= e:
			if s == e:
				timeSpend += (rpos - lpos) / (lSpeed + rSpeed)
				rpos = lpos
				break
			leftTime = (flags[s] - lpos) / lSpeed
			rightTime = (rpos - flags[e - 1]) / rSpeed
			if leftTime > rightTime:
				lpos += rightTime * lSpeed
				rpos -= rightTime * rSpeed
				rSpeed += 1
				timeSpend += rightTime
				e -= 1
			elif leftTime < rightTime:
				lpos += leftTime * lSpeed
				rpos -= leftTime * rSpeed
				lSpeed += 1
				timeSpend += leftTime
				s += 1
			else:
				lpos += leftTime * lSpeed
				rpos -= leftTime * rSpeed
				lSpeed += 1
				rSpeed += 1
				timeSpend += leftTime
				s += 1
				e -= 1
		if lpos < rpos:
			timeSpend += (rpos - lpos) / (lSpeed + rSpeed)
		yield timeSpend
t = int(input())
ans = gift()
print(*ans, sep='\n')


import bisect
import collections
import copy
import functools
import heapq
import itertools
import math
import sys
import string
import random
from typing import List
sys.setrecursionlimit(99999)
for _ in range(int(input())):
	st = 0
	(n, l) = map(int, input().split())
	arr = list(map(int, input().split()))
	ai = 0
	aj = n - 1
	left = 0
	vleft = 1
	right = l
	vright = 1
	while right - left > 10 ** (-6):
		t1 = t2 = t3 = float('inf')
		t1 = min(t1, (right - left) / (vleft + vright))
		if ai <= aj:
			t2 = min(t2, (arr[ai] - left) / vleft)
			t3 = min(t3, (right - arr[aj]) / vright)
			if t2 < t3:
				left = arr[ai]
				right = right - t2 * vright
				ai += 1
				vleft += 1
			elif t3 < t2:
				right = arr[aj]
				left = left + t3 * vleft
				aj -= 1
				vright += 1
			elif t2 == t3:
				left = left + t3 * vleft
				right = right - t3 * vright
				ai += 1
				aj -= 1
				vleft += 1
				vright += 1
			st += min(t2, t3)
		else:
			st += t1
			left = right = (left + right) / 2
	print(st)


import sys

def swap(x, y, a):
	temp = a[x]
	a[x] = a[y]
	a[y] = temp
	return a

def solve():
	return None

def main():
	q = []
	for line in sys.stdin.readlines():
		q.append(line)
	for i in range(len(q)):
		q[i] = q[i].rstrip().split(' ')
		q[i] = [int(x) for x in q[i]]
	for i in range(1, len(q), 2):
		flags = q[i][0]
		road = q[i][1]
		a = q[i + 1]
		da = 0
		db = road
		time = 0
		ma = 1
		mb = 1
		ta = 0
		tb = 0
		i = 0
		j = len(a) - 1
		prev_i = 0
		prev_j = road
		temp = 0
		while i <= j:
			da = a[i] - prev_i
			db = prev_j - a[j]
			ta = da / ma
			tb = db / mb
			if ta == tb:
				time += 1 / ma * da
				ma += 1
				mb += 1
				prev_i = a[i]
				prev_j = a[j]
				i += 1
				j -= 1
				if prev_i > prev_j:
					prev_i -= da
					prev_j += db
					break
			elif ta < tb:
				temp = 1 / ma * da
				time += temp
				ma += 1
				prev_i = a[i]
				prev_j -= temp * mb
				i += 1
				if prev_i > prev_j:
					prev_i -= da
					prev_j -= temp * mb
					break
			else:
				temp = 1 / mb * db
				time += temp
				mb += 1
				prev_j = a[j]
				prev_i += temp * ma
				j -= 1
				if prev_i > prev_j:
					prev_i -= temp * ma
					prev_j -= db
					break
		time += (prev_j - prev_i) / (ma + mb)
		print(time)
main()


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, L, A):
	A = [0] + A + [L]
	gaps = [y - x for (x, y) in zip(A, A[1:])]
	gapsRev = gaps[::-1]

	def getPos(gaps, time):
		x = 0
		v = 1
		t = 0
		for gap in gaps:
			timeToCross = gap / v
			if t + timeToCross >= time:
				remainingTime = time - t
				x += remainingTime * v
				break
			v += 1
			x += gap
			t += timeToCross
		return x

	def metAlready(time):
		p1 = getPos(gaps, time)
		p2 = getPos(gapsRev, time)
		return p1 + p2 >= L
	EPS = 1e-07
	lo = 0
	hi = 2 * 10 ** 9
	while hi - lo > EPS:
		mid = (lo + hi) / 2
		if metAlready(mid):
			hi = mid
		else:
			lo = mid
	return hi
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(N, L) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	ans = solve(N, L, A)
	print(ans)


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	flags = [int(x) for x in input().split()]
	flags.insert(0, 0)
	flags.insert(n + 1, l)
	n = len(flags)
	times = [0] * n
	speed = 1
	time = 0
	for i in range(1, n):
		time += (flags[i] - flags[i - 1]) / speed
		times[i] = time
		speed += 1
	timesR = [0] * n
	time = 0
	speed = 1
	for i in range(n - 2, -1, -1):
		time += (flags[i + 1] - flags[i]) / speed
		timesR[i] = time
		speed += 1
	for i in range(1, n):
		if timesR[i] <= times[i]:
			f2 = flags[i]
			f1 = flags[i - 1]
			s1 = i
			s2 = n - i
			t1 = times[i - 1]
			t2 = timesR[i]
			t = (f2 - f1 + s1 * t1 + s2 * t2) / (s1 + s2)
			print(t)
			break


t = int(input())
for i in range(t):
	(n, l) = map(int, input().split())
	aa = list(map(int, input().split()))
	t1s = [0]
	v1 = 1
	t2s = [0]
	v2 = 1
	for j in range(n):
		t1s.append(aa[0] if len(t1s) == 1 else t1s[j] + (aa[j] - aa[j - 1]) / v1)
		t2s.append(l - aa[n - 1] if len(t2s) == 1 else t2s[j] + (aa[n - j] - aa[n - j - 1]) / v2)
		v1 += 1
		v2 += 1
	t1s.append(t1s[n] + (l - aa[n - 1]) / v1)
	t2s.append(t2s[n] + aa[0] / v2)
	t2s.reverse()
	for j in range(n + 2):
		if t2s[j] < t1s[j]:
			t11 = t1s[j - 1]
			t12 = t1s[j]
			t21 = t2s[j]
			t22 = t2s[j - 1]
			print((t12 * t22 - t11 * t21) / (t22 - t21 + t12 - t11))
			break


def mi():
	return map(int, input().split())
from bisect import bisect_right as br
eps = 1e-06
for _ in range(int(input())):
	(n, l) = mi()
	a = [0] + list(mi()) + [l]
	n += 2
	tt1 = [0] * n
	s1 = [1] * n
	tt1[0] = a[0]
	speed = 1
	for i in range(1, n):
		tt1[i] = tt1[i - 1] + (a[i] - a[i - 1]) / speed
		s1[i] = speed + 1
		speed += 1
	b = a.copy()[::-1]
	tt2 = [0] * n
	tt2[0] = b[0] = l - b[0]
	speed = 1
	for i in range(1, n):
		b[i] = l - b[i]
		tt2[i] = tt2[i - 1] + (b[i] - b[i - 1]) / speed
		speed += 1
	lo = 0
	hi = l
	while True:
		mid = (lo + hi) / 2
		i1 = br(tt1, mid) - 1
		pos1 = a[i1] + (mid - tt1[i1]) * s1[i1]
		i2 = br(tt2, mid) - 1
		pos2 = b[i2] + (mid - tt2[i2]) * s1[i2]
		pos2 = l - pos2
		if pos1 - pos2 > eps:
			hi = mid
		elif pos2 - pos1 > eps:
			lo = mid
		else:
			ans = mid
			print(ans)
			break


def read_nums():
	return [int(v) for v in input().split()]
t = int(input())
for _ in range(t):
	(n, l) = read_nums()
	f = read_nums()
	dx = 0
	dy = l
	vx = 1
	vy = 1
	sx = 0
	sy = n - 1
	t = 0
	tx = 0
	ty = 0
	while sx <= sy:
		tx = (f[sx] - dx) / vx
		ty = (dy - f[sy]) / vy
		if tx < ty:
			dx = f[sx]
			vx += 1
			sx += 1
			t += tx
			dy -= tx * vy
		elif tx > ty:
			dy = f[sy]
			vy += 1
			sy -= 1
			t += ty
			dx += ty * vx
		else:
			dx = f[sx]
			vx += 1
			sx += 1
			dy = f[sy]
			vy += 1
			sy -= 1
			t += tx
	if sy != sx:
		t += (dy - dx) / (vx + vy)
	print(t)


def check(m):
	if m < A[0]:
		return m - (C[-1] + (A[0] - m) / (n + 1))
	if m > A[-1]:
		return B[-1] + (m - A[-1]) / (n + 1) - (l - m)
	L = 0
	R = n
	while R - L > 1:
		m1 = (L + R) // 2
		if A[m1] > m:
			R = m1
		else:
			L = m1
	if A[L] <= m <= A[L + 1]:
		return B[L] + (m - A[L]) / (L + 2) - (C[n - L - 2] + (A[L + 1] - m) / (n - L))
t = int(input())
for __ in range(t):
	(n, l) = map(int, input().split())
	A = list(map(int, input().split()))
	L = 0
	R = l
	B = [A[0]]
	C = [l - A[n - 1]]
	for i in range(1, n):
		B.append(B[-1] + (A[i] - A[i - 1]) / (i + 1))
		C.append(C[-1] + (A[n - i] - A[n - i - 1]) / (i + 1))
	EPS = 10 ** (-6)
	while R - L > EPS:
		m = (L + R) / 2
		if check(m) >= 0:
			R = m
		else:
			L = m
	if L < A[0]:
		print(round(L, 6))
	for i in range(n - 1):
		if A[i] <= L <= A[i + 1]:
			print(round(B[i] + (L - A[i]) / (i + 2), 6))
	if L > A[-1]:
		print(round(B[-1] + (L - A[-1]) / (n + 1), 6))


from collections import Counter, OrderedDict
from itertools import permutations as perm
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(t,) = gil()

def isPos(time, l):
	(cp, cv, ct) = (0, 1, 0)
	i = 0
	while i < n and ct + (a[i] - cp) / cv <= time:
		ct += (a[i] - cp) / cv
		cp = a[i]
		i += 1
		cv += 1
	cp += cv * (time - ct)
	lans = cp
	(cp, cv, ct) = (l, 1, 0)
	i = n - 1
	while i >= 0 and ct + (cp - a[i]) / cv <= time:
		ct += (cp - a[i]) / cv
		cp = a[i]
		i -= 1
		cv += 1
	cp -= cv * (time - ct)
	return lans >= cp
delta = 10 ** (-6)
for _ in range(t):
	(n, d) = gil()
	a = gil()
	(l, r) = (0, 2 * int(1e+19))
	while l <= r:
		mid = (l + r) / 2
		if isPos(mid, d):
			r = mid - delta
			ans = mid
		else:
			l = mid + delta
	print(ans)


I = lambda : [*map(int, input().split())]
for _ in range(I()[0]):
	(n, l) = I()
	C = [0] + I() + [l]
	c = [C[i] - C[i - 1] for i in range(1, n + 2)]
	s1 = s2 = 1
	t1 = t2 = 0
	while s1 != n + 2 - s2:
		a = c[s1 - 1] / s1
		b = c[n + 1 - s2] / s2
		if a + t1 < b + t2:
			s1 += 1
			t1 += a
		else:
			s2 += 1
			t2 += b
	if t1 < t2:
		print(t2 + (c[s1 - 1] - (t2 - t1) * s1) / (s1 + s2))
	else:
		print(t1 + (c[s1 - 1] - (t1 - t2) * s2) / (s1 + s2))


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a1 = [0]
	b1 = [0]
	a1.append(a[0])
	b1.append(l - a[-1])
	asp = 2
	bsp = 2
	for i in range(1, n):
		a1.append(a1[-1] + (a[i] - a[i - 1]) / asp)
		asp += 1
		b1.append(b1[-1] + (a[n - i] - a[n - i - 1]) / bsp)
		bsp += 1
	a1.append(a1[-1] + (l - a[-1]) / asp)
	b1.append(b1[-1] + a[0] / bsp)
	ind = 0
	dif = 0
	for i in range(len(a1)):
		if b1[i] >= a1[-1 * (i + 1)]:
			ind = n - i
			dif = b1[i] - a1[-1 * (i + 1)]
			break
	ta = a1[ind + 1]
	tb = b1[n - ind]
	sa = ind + 2
	sb = n - ind
	a.append(l)
	dis = sb * dif
	dt = sa * dis / (sa + sb)
	print(ta + dt / sa)


for __ in range(int(input())):
	(n, l) = list(map(int, input().split()))
	ar = list(map(int, input().split()))
	(i, j) = (0, n - 1)
	(x, y) = (0, l)
	(v1, v2) = (1, 1)
	ans = 0
	while i <= j and x < y:
		if (ar[i] - x) / v1 < (y - ar[j]) / v2:
			ans += (ar[i] - x) / v1
			y -= v2 * (ar[i] - x) / v1
			x = ar[i]
			v1 += 1
			i += 1
		else:
			ans += (y - ar[j]) / v2
			x += v1 * (y - ar[j]) / v2
			y = ar[j]
			v2 += 1
			j -= 1
	ans += (y - x) / (v1 + v2)
	print(ans)


t = int(input())
for q in range(t):
	(n, ln) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	(l, r) = (0, n - 1)
	(s1, s2) = (0, ln)
	(u1, u2) = (1, 1)
	answer = 0
	while l <= r and s1 < s2:
		obs = (s2 - s1) / (u1 + u2)
		a = (arr[l] - s1) / u1
		b = (s2 - arr[r]) / u2
		if obs < a and obs < b:
			answer += obs
			break
		if a == b:
			answer += a
			s1 = arr[l]
			s2 = arr[r]
			l += 1
			r -= 1
			u1 += 1
			u2 += 1
		elif a < b:
			answer += a
			s2 -= a * u2
			s1 = arr[l]
			l += 1
			u1 += 1
		else:
			answer += b
			s1 += b * u1
			s2 = arr[r]
			r -= 1
			u2 += 1
	if s1 < s2:
		answer += (s2 - s1) / (u1 + u2)
	print(answer)


for _ in range(int(input())):
	(n, e) = map(int, input().split())
	l = list(map(int, input().split()))
	x = 0
	y = e
	s1 = 1
	s2 = 1
	d1 = 0
	d2 = e
	f = 0
	total = 0
	j = 0
	i = 0
	flag = 1
	while flag and i < n and (j < n):
		if (l[i] - d1) / s1 > (d2 - l[n - 1 - j]) / s2:
			y = l[n - j - 1]
			t = (d2 - y) / s2
			x = t * s1 + d1
			if x >= y:
				flag = 0
				break
			total += t
			s2 += 1
			d2 = y
			d1 = t * s1 + d1
			j += 1
		elif (l[i] - d1) / s1 < (d2 - l[n - 1 - j]) / s2:
			x = l[i]
			t = (x - d1) / s1
			y = d2 - t * s2
			if x >= y:
				flag = 0
				break
			total += t
			s1 += 1
			d1 = x
			d2 = y
			i += 1
		else:
			x = l[i]
			y = l[n - j - 1]
			if x >= y:
				flag = 0
				break
			t = (x - d1) / s1
			total += t
			s1 += 1
			s2 += 1
			d1 = x
			d2 = y
			i += 1
			j += 1
	total += (d2 - d1) / (s1 + s2)
	print(total)


testCases = int(input())
for k in range(0, testCases):
	(n, l) = [int(i) for i in input().split(' ')]
	a = [int(i) for i in input().split(' ')]
	i = 0
	j = n - 1
	x = 0
	y = l
	speed1 = 1
	speed2 = 1
	time = 0
	while i <= j:
		time1 = (a[i] - x) / speed1
		time2 = (y - a[j]) / speed2
		if time1 < time2:
			x = a[i]
			y -= time1 * speed2
			time += time1
			speed1 += 1
			i += 1
		else:
			y = a[j]
			x += time2 * speed1
			time += time2
			speed2 += 1
			j -= 1
	time += (y - x) / (speed1 + speed2)
	print(time)


import collections
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().strip(' ').split(' '))
	arr = collections.deque(map(int, input().strip(' ').split(' ')))
	(a, b) = (1, 1)
	time = 0
	start = 0
	end = l
	while arr:
		x1 = arr[0] - start
		x2 = end - arr[-1]
		t1 = x1 / a
		t2 = x2 / b
		if t1 < t2:
			time += t1
			a += 1
			start = arr.popleft()
			end -= t1 * b
		else:
			time += t2
			b += 1
			end = arr.pop()
			start += t2 * a
	time += (end - start) / (a + b)
	print(time)


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0] + [*map(int, input().split())] + [l]
	(li, ri) = (0, n + 1)
	(ls, rs) = (1, 1)
	(lt, rt) = (0, 0)
	while ri - li > 1:
		tl = (a[li + 1] - a[li]) / ls
		tr = (a[ri] - a[ri - 1]) / rs
		if tl + lt > tr + rt:
			rs += 1
			ri -= 1
			rt += tr
		else:
			ls += 1
			li += 1
			lt += tl
	if lt > rt:
		(lt, rt) = (rt, lt)
		(ls, rs) = (rs, ls)
	print(rt + (a[ri] - a[li] - (rt - lt) * ls) / (ls + rs))


T = int(input())
for _ in range(T):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	(i, j) = (0, n - 1)
	(sp, ep) = (0, l)
	(ss, es) = (1, 1)
	t = 0
	while i <= j:
		d1 = a[i] - sp
		d2 = ep - a[j]
		t1 = d1 / ss
		t2 = d2 / es
		if t1 < t2:
			ss += 1
			sp = a[i]
			ep -= t1 * es
			i += 1
			t += t1
		else:
			es += 1
			ep = a[j]
			sp += t2 * ss
			j -= 1
			t += t2
	t += (ep - sp) / (ss + es)
	print(t)


import os
import sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		(n, l) = map(int, input().split())
		a = list(map(int, input().split()))
		lpos = 0
		rpos = l
		lptr = 0
		rptr = n - 1
		lspeed = 1
		rspeed = 1
		totalTime = 0
		while lptr <= rptr:
			ldist = a[lptr] - lpos
			rdist = rpos - a[rptr]
			ltime = ldist / lspeed
			rtime = rdist / rspeed
			if ltime < rtime:
				lpos = a[lptr]
				rpos -= rspeed * ltime
				lspeed += 1
				lptr += 1
				totalTime += ltime
			else:
				rpos = a[rptr]
				lpos += lspeed * rtime
				rspeed += 1
				rptr -= 1
				totalTime += rtime
		totalTime += (rpos - lpos) / (lspeed + rspeed)
		print('%.10f' % totalTime)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
from bisect import bisect_left, bisect_right

class Result:

	def __init__(self, index, value):
		self.index = index
		self.value = value

class BinarySearch:

	def __init__(self):
		pass

	@staticmethod
	def greater_than(num: float, func, size: int=1):
		if isinstance(func, list):
			index = bisect_right(func, num)
			if index == len(func):
				return Result(None, None)
			else:
				return Result(index, func[index])
		else:
			(alpha, omega) = (0, size - 1)
			if func(omega) <= num:
				return Result(None, None)
			while alpha < omega:
				if func(alpha) > num:
					return Result(alpha, func(alpha))
				if omega == alpha + 1:
					return Result(omega, func(omega))
				mid = (alpha + omega) // 2
				if func(mid) > num:
					omega = mid
				else:
					alpha = mid

	@staticmethod
	def less_than(num: int, func, size: int=1):
		if isinstance(func, list):
			index = bisect_left(func, num) - 1
			if index == -1:
				return Result(None, None)
			else:
				return Result(index, func[index])
		else:
			(alpha, omega) = (0, size - 1)
			if func(alpha) >= num:
				return Result(None, None)
			while alpha < omega:
				if func(omega) < num:
					return Result(omega, func(omega))
				if omega == alpha + 1:
					return Result(alpha, func(alpha))
				mid = (alpha + omega) // 2
				if func(mid) < num:
					alpha = mid
				else:
					omega = mid
for _ in range(int(input()) if True else 1):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	bs = BinarySearch()
	speed_at_time1 = {0: 1}
	distance_covered_at_time1 = {0: 0}
	times = [0]
	total = 0
	cur = 0
	for i in range(n):
		total += (a[i] - cur) / (i + 1)
		cur = a[i]
		distance_covered_at_time1[total] = cur
		times += [total]
		speed_at_time1[total] = i + 2
	speed_at_time2 = {0: 1}
	distance_covered_at_time2 = {0: 0}
	times2 = [0]
	total = 0
	cur = k
	j = 0
	for i in range(n - 1, -1, -1):
		total += (cur - a[i]) / (j + 1)
		cur = a[i]
		distance_covered_at_time2[total] = k - cur
		times2 += [total]
		speed_at_time2[total] = j + 2
		j += 1
	(alpha, omega) = (0, 10 ** 18)
	lastmid = -1
	while alpha < omega:
		mid = (alpha + omega) / 2
		if mid == lastmid:
			break
		lastmid = mid
		x = bs.less_than(mid, times).value
		if x is None:
			x = 0
		dist1 = distance_covered_at_time1[x] + (mid - x) * speed_at_time1[x]
		x = bs.less_than(mid, times2).value
		if x is None:
			x = 0
		dist2 = distance_covered_at_time2[x] + (mid - x) * speed_at_time2[x]
		if dist1 + dist2 > k:
			omega = mid
		else:
			alpha = mid + 10 ** (-8)
	print(omega)


for tt in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	pos1 = 0
	pos2 = l
	speed1 = 1
	speed2 = 1
	ptr1 = 0
	ptr2 = n - 1
	time = 0
	while ptr1 <= ptr2:
		t1 = (a[ptr1] - pos1) / speed1
		t2 = (pos2 - a[ptr2]) / speed2
		if t1 < t2:
			pos1 = a[ptr1]
			speed1 += 1
			ptr1 += 1
			time += t1
			pos2 = pos2 - speed2 * t1
		elif t1 == t2:
			pos1 = a[ptr1]
			pos2 = a[ptr2]
			ptr1 += 1
			ptr2 -= 1
			time += t1
			speed1 += 1
			speed2 += 1
		else:
			pos2 = a[ptr2]
			speed2 += 1
			ptr2 -= 1
			time += t2
			pos1 = pos1 + speed1 * t2
	time += (pos2 - pos1) / (speed2 + speed1)
	print(time)


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	arr = list(map(int, input().split()))
	d1 = 0
	d2 = l
	s1 = s2 = 1
	p1 = 0
	p2 = n - 1
	T = 0
	while p1 <= p2:
		if (arr[p1] - d1) / s1 > (d2 - arr[p2]) / s2:
			t = (d2 - arr[p2]) / s2
			d2 = arr[p2]
			d1 = d1 + t * s1
			p2 -= 1
			s2 += 1
		else:
			t = (arr[p1] - d1) / s1
			d1 = arr[p1]
			d2 = d2 - t * s2
			p1 += 1
			s1 += 1
		T += t
	try:
		o1 = min(d1, arr[p1])
	except:
		o1 = max(d1, arr[p1 - 1])
	if p2 >= 0:
		o2 = max(d2, arr[p2])
	else:
		o2 = min(d2, arr[p2 + 1])
	T += max((o2 - o1) / (s1 + s2), 0)
	print(T)


from math import *
t = int(input())
while t:
	t = t - 1
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	x = 0
	y = l
	i = 0
	j = n - 1
	time = 0
	xs = 1
	ys = 1
	while i <= j:
		p = a[i]
		q = a[j]
		xti = abs(p - x) / xs
		yti = abs(p - y) / ys
		xtj = abs(q - x) / xs
		ytj = abs(q - y) / ys
		if xti < ytj:
			time += xti
			xs += 1
			x = p
			i = i + 1
			y = y - xti * ys
		elif xti > ytj:
			time += ytj
			ys += 1
			y = q
			j = j - 1
			x = x + ytj * xs
		else:
			time += xti
			ys += 1
			xs += 1
			x = p
			y = q
			i = i + 1
			j = j - 1
	if x != y:
		time += (y - x) / (xs + ys)
	print(time)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	(n, l) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	aSpeed = 1
	bSpeed = 1
	aCoord = 0
	bCoord = l
	aNextFlag = 0
	bNextFlag = n - 1
	timeElapsed = 0
	while True:
		aTimeToNextFlag = float('inf')
		if aNextFlag < n:
			aTimeToNextFlag = (arr[aNextFlag] - aCoord) / aSpeed
		bTimeToNextFlag = float('inf')
		if bNextFlag > -1:
			bTimeToNextFlag = (bCoord - arr[bNextFlag]) / bSpeed
		if aTimeToNextFlag <= bTimeToNextFlag:
			aNextCoord = arr[aNextFlag]
			bNextCoord = bCoord - aTimeToNextFlag * bSpeed
			if aNextCoord < bNextCoord:
				timeElapsed += aTimeToNextFlag
				aCoord = aNextCoord
				bCoord = bNextCoord
				aNextFlag += 1
				aSpeed += 1
				continue
			else:
				timeElapsed += (bCoord - aCoord) / (aSpeed + bSpeed)
				break
		else:
			aNextCoord = aCoord + bTimeToNextFlag * aSpeed
			bNextCoord = arr[bNextFlag]
			if aNextCoord < bNextCoord:
				timeElapsed += bTimeToNextFlag
				aCoord = aNextCoord
				bCoord = bNextCoord
				bNextFlag -= 1
				bSpeed += 1
				continue
			else:
				timeElapsed += (bCoord - aCoord) / (aSpeed + bSpeed)
				break
	print(timeElapsed)


t = int(input())
for i in range(t):
	(n, l) = map(int, input().split())
	f = list(map(float, input().split()))
	fc = 0
	lc = n - 1
	x1 = 0
	v1 = 1
	v2 = 1
	x2 = l
	t = 0
	while fc <= lc:
		t1 = (f[fc] - x1) / v1
		t2 = (x2 - f[lc]) / v2
		if t1 < t2:
			x1 = f[fc]
			v1 += 1
			fc += 1
			x2 -= v2 * t1
			t += t1
		elif t1 > t2:
			x2 = f[lc]
			lc -= 1
			x1 += v1 * t2
			v2 += 1
			t += t2
		else:
			x1 = f[fc]
			x2 = f[lc]
			fc += 1
			lc -= 1
			v1 += 1
			v2 += 1
			t += t1
	t += (x2 - x1) / (v2 + v1)
	print(t)


import re
from string import ascii_lowercase
from math import inf, ceil, factorial, log
from collections import defaultdict, deque, Counter
from bisect import bisect, insort, bisect_left, bisect_right
mod = int(1000000000.0) + 7

def solve():
	(n, l) = map(int, input().split())
	flags = [0] + list(map(int, input().split())) + [l]
	cartime1 = [(0.0, 1)]
	speed = 1
	for i in range(1, n + 2):
		distance = flags[i] - flags[i - 1]
		time = distance / speed
		if len(cartime1):
			time += cartime1[-1][0]
		speed += 1
		cartime1.append((time, speed))
	cartime2 = [(0.0, 1)]
	speed = 1
	flags = flags[::-1]
	for i in range(1, n + 2):
		distance = flags[i - 1] - flags[i]
		time = distance / speed
		if len(cartime2):
			time += cartime2[-1][0]
		speed += 1
		cartime2.append((time, speed))
	cartime2 = cartime2[::-1]
	flags = flags[::-1]
	for i in range(1, len(cartime1)):
		if cartime1[i][0] >= cartime2[i][0]:
			(l, r) = (flags[i - 1], flags[i])
			distance = r - l
			if cartime1[i - 1][0] < cartime2[i][0]:
				min_velo = cartime1[i - 1][1]
				cartime_with_min_velo = cartime1[i - 1][0]
			else:
				min_velo = cartime2[i][1]
				cartime_with_min_velo = cartime2[i][0]
			distance -= min_velo * abs(cartime1[i - 1][0] - cartime2[i][0])
			time = distance / (cartime1[i - 1][1] + cartime2[i][1])
			print(cartime_with_min_velo + time + abs(cartime1[i - 1][0] - cartime2[i][0]))
			break

def main():
	for _ in range(int(input())):
		solve()
main()


for _ in range(int(input())):
	(b, du) = list(map(int, input().split()))
	c = list(map(int, input().split()))
	v = u = 1
	h = i = dv = 0
	while c:
		if (c[0] - dv) / v <= (du - c[-1]) / u:
			(e, dv) = ((c[0] - dv) / v, c[0])
			(h, v) = (h + e, v + 1)
			c.pop(0)
			if c:
				if e * u >= du - c[-1]:
					(f, du) = ((du - c[-1]) / u, c[-1])
					c.pop()
					u += 1
					if e > f:
						du -= (e - f) * u
				else:
					du -= u * e
			else:
				du -= u * e
		else:
			(e, du) = ((du - c[-1]) / u, c[-1])
			(h, u) = (h + e, u + 1)
			c.pop()
			if c:
				if e * v >= c[0] - dv:
					(f, dv) = ((c[0] - dv) / v, c[0])
					c.pop(0)
					v += 1
					if e > f:
						dv += (e - f) * v
				else:
					dv += v * e
			else:
				dv += v * e
	h += (du - dv) / (u + v)
	print(h)


import math
t = int(input())
for _ in range(t):
	(n, leng) = map(int, input().split())
	flags = [float(i) for i in input().split()]
	(l, r) = (0, n - 1)
	(coordl, coordr) = (0.0, float(leng))
	(v1, v2) = (1.0, 1.0)
	res = 0.0
	while l <= r:
		t1 = (flags[l] - coordl) / v1
		t2 = (coordr - flags[r]) / v2
		if t1 < t2:
			coordr -= t1 * v2
			coordl = flags[l]
			l += 1
			v1 += 1
			res += t1
		elif t2 < t1:
			coordl += t2 * v1
			coordr = flags[r]
			r -= 1
			v2 += 1
			res += t2
		else:
			coordl = flags[l]
			coordr = flags[r]
			l += 1
			r -= 1
			v1 += 1
			v2 += 1
			res += t1
	if coordl < coordr:
		res += (coordr - coordl) / (v1 + v2)
	print(res)


import os, sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		(n, l) = map(int, input().split())
		a = [0] + list(map(int, input().split())) + [l]
		(hi, lo) = (10 ** 9, 0)
		for _ in range(100):
			mid = (hi + lo) / 2
			(d1, x, sp, t) = (0, 0, 1, mid)
			for i in range(1, n + 2):
				if a[i] - x >= t * sp:
					d1 += t * sp
					break
				else:
					d1 += a[i] - x
					t -= (a[i] - x) / sp
				x = a[i]
				sp += 1
			(d2, x, sp, t) = (0, l, 1, mid)
			for i in range(n, -1, -1):
				if x - a[i] >= t * sp:
					d2 += t * sp
					break
				else:
					d2 += x - a[i]
					t -= (x - a[i]) / sp
				x = a[i]
				sp += 1
			if d1 + d2 < l:
				lo = mid
			elif d1 + d2 > l:
				hi = mid
			else:
				break
		print(mid)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


T = int(input())

def get_next_c(pos, speed, target):
	return abs(pos - target) / speed
for t in range(T):
	(N, L) = [int(_) for _ in input().split()]
	A = [int(_) for _ in input().split()]
	A.insert(0, 0)
	A.append(L)
	p1 = 0
	p2 = L
	s1 = 1
	s2 = 1
	next_flag_1 = 1
	next_flag_2 = len(A) - 2
	current_t = 0
	while True:
		next_ctime_1 = get_next_c(p1, s1, A[next_flag_1])
		next_ctime_2 = get_next_c(p2, s2, A[next_flag_2])
		t = min(next_ctime_1, next_ctime_2)
		if next_ctime_1 < next_ctime_2:
			p1 = A[next_flag_1]
			p2 -= s2 * t
		else:
			p2 = A[next_flag_2]
			p1 += s1 * t
		current_t += t
		if p1 > p2:
			tloss = get_next_c(pos=p1, speed=s1 + s2, target=p2)
			print(current_t - tloss)
			break
		if next_ctime_1 < next_ctime_2:
			next_flag_1 += 1
			s1 += 1
		else:
			next_flag_2 -= 1
			s2 += 1


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	(n, l) = mints()
	a = [0] + list(mints()) + [l]
	speed = 1
	t = 0
	t1 = [0] * (n + 2)
	s1 = [0] * (n + 2)
	s1[0] = 1
	for i in range(1, n + 2):
		dt = (a[i] - a[i - 1]) / speed
		t += dt
		t1[i] = t
		speed += 1
		s1[i] = speed
	t = 0
	t2 = [0] * (n + 2)
	s2 = [0] * (n + 2)
	speed = 1
	for i in range(n, -1, -1):
		dt = (a[i + 1] - a[i]) / speed
		t += dt
		t2[i] = t
		speed += 1
		s2[i] = speed
	s2[-1] = 1
	for i in range(1, n + 2):
		y = t1[i]
		v = t2[i]
		if y >= v or i == n + 1:
			x = t1[i - 1]
			u = t2[i - 1]
			ss1 = i
			ss2 = n + 2 - i
			print((a[i] - a[i - 1] + v * ss2 + x * ss1) / (ss1 + ss2))
			break
for i in range(mint()):
	solve()


def main():
	for _ in range(int(input())):
		(n, l) = map(int, input().split())
		a = list(map(int, input().split()))
		(t, x, y) = (0, 1, 1)
		(left, right) = (0, n - 1)
		(inix, iniy) = (0, l)
		while left <= right:
			if (a[left] - inix) / x == (iniy - a[right]) / y:
				t += (a[left] - inix) / x
				inix = a[left]
				iniy = a[right]
				left += 1
				right -= 1
				x += 1
				y += 1
			elif (a[left] - inix) / x < (iniy - a[right]) / y:
				t += (a[left] - inix) / x
				iniy -= (a[left] - inix) / x * y
				inix = a[left]
				left += 1
				x += 1
			else:
				t += (iniy - a[right]) / y
				inix += (iniy - a[right]) / y * x
				iniy = a[right]
				right -= 1
				y += 1
		a = t + (iniy - inix) / (x + y)
		print('%.8f' % a)
main()


t = int(input())
for _ in range(t):
	li = list(map(int, input().split()))
	(n, l) = (li[0], li[1])
	f = list(map(int, input().split()))
	a = [0, f[0]]
	b = [0]
	b.append((l - f[n - 1]) / 1)
	for i in range(1, n):
		a.append((f[i] - f[i - 1]) / (i + 1) + a[-1])
		b.append((f[-i] - f[-i - 1]) / (i + 1) + b[-1])
	a.append((l - f[n - 1]) / (n + 1) + a[-1])
	b.append(b[-1] + f[0] / (n + 1))
	b.reverse()
	f.insert(0, 0)
	f.append(l)
	for i in range(n + 1):
		if a[i] < b[i] and a[i + 1] >= b[i + 1]:
			if a[i] < b[i + 1]:
				p = (i + 1) * (b[i + 1] - a[i])
				ans = (f[i + 1] - f[i] - p) / (n + 2) + b[i + 1]
			else:
				p = (n + 1 - i) * (a[i] - b[i + 1])
				ans = (f[i + 1] - f[i] - p) / (n + 2) + a[i]
			break
	print(ans)


from sys import *
input = stdin.readline
import random
from bisect import *
import math
from collections import *
import operator
from heapq import *
from itertools import *
inf = 10 ** 18
mod = 10 ** 9 + 7
for lmao in range(1):
	for _ in range(int(input())):
		(n, l) = map(int, input().split())
		flag = list(map(int, input().split()))
		vela = 1.0
		velb = 1.0
		a = 0
		b = l
		time = 0.0
		i = 0
		j = n - 1
		while i <= j:
			t = min((flag[i] - a) / vela, (b - flag[j]) / velb)
			a += t * vela
			b -= t * velb
			time += t
			if a >= flag[i]:
				vela += 1
				i += 1
			if b <= flag[j]:
				velb += 1
				j -= 1
		time += abs(b - a) / (vela + velb)
		print(time)


import bisect
import array
import functools
import math
mo = 1000000007
T = int(input())
for Tid in range(T):
	(n, k) = map(int, input().split())
	a = array.array('i', map(int, input().split()))

	def query(x):
		la = 0
		rem = x
		ans = 0
		for i in range(n):
			T = min((a[i] - la) / (i + 1), rem)
			ans = ans + T * (i + 1)
			rem = rem - T
			la = a[i]
		ans = ans + rem * (n + 1)
		la = k
		rem = x
		for i in range(n - 1, -1, -1):
			T = min((la - a[i]) / (n - i), rem)
			ans = ans + T * (n - i)
			rem = rem - T
			la = a[i]
		ans = ans + rem * (n + 1)
		return ans
	l = 0.0
	r = 1.0 * k
	for i in range(60):
		mid = (l + r) / 2
		if query(mid) >= k:
			r = mid
		else:
			l = mid
	print((l + r) / 2)


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	v1 = 1
	v2 = 1
	x1 = 0
	x2 = l
	p1 = 0
	p2 = n - 1
	t = 0
	while p1 <= p2:
		t1 = (a[p1] - x1) / v1
		t2 = (x2 - a[p2]) / v2
		t += min(t1, t2)
		if t1 < t2:
			x1 = a[p1]
			p1 += 1
			v1 += 1
			x2 -= t1 * v2
		elif t1 > t2:
			x2 = a[p2]
			p2 -= 1
			v2 += 1
			x1 += t2 * v1
		else:
			x1 = a[p1]
			x2 = a[p2]
			p1 += 1
			p2 -= 1
			v1 += 1
			v2 += 1
	if x1 == x2:
		print(t)
	else:
		t_last = (x2 - x1) / (v1 + v2)
		print(t + t_last)


import sys
import math
from collections import defaultdict, Counter
input = sys.stdin.readline

def print(x):
	sys.stdout.write(str(x) + '\n')
t = int(input())
for i in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 0
	a1 = 0
	b1 = l
	start = 0
	end = 1
	while start <= n - end:
		t1 = (a[start] - a1) / (start + 1)
		t2 = (b1 - a[-end]) / end
		if t1 < t2:
			a1 = a[start]
			start += 1
			b1 -= end * t1
			ans += t1
		else:
			b1 = a[-end]
			end += 1
			a1 += (start + 1) * t2
			ans += t2
	ans += (b1 - a1) / (start + 1 + end)
	print(ans)


t = int(input())
for _ in range(t):
	(n, m) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	(c1, c2) = (0, m)
	(l, r) = (0, n - 1)
	(s1, s2) = (1, 1)
	ans = 0
	while l <= r:
		time2acc1 = (a[l] - c1) / s1
		time2acc2 = (c2 - a[r]) / s2
		ans += min(time2acc1, time2acc2)
		if time2acc1 == time2acc2:
			c1 += time2acc1 * s1
			c2 -= time2acc2 * s2
			s1 += 1
			s2 += 1
			l += 1
			r -= 1
		elif time2acc1 < time2acc2:
			c1 += time2acc1 * s1
			c2 -= time2acc1 * s2
			s1 += 1
			l += 1
		else:
			c1 += time2acc2 * s1
			c2 -= time2acc2 * s2
			s2 += 1
			r -= 1
	ans += (c2 - c1) / (s1 + s2)
	print(ans)


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	i = 0
	j = n - 1
	sa = 1
	sb = 1
	da = 0
	db = l
	tt = 0
	ta = 0
	tb = 0
	while i <= j:
		da1 = a[i] - da
		ta = da1 / sa
		db1 = -a[j] + db
		tb = db1 / sb
		if ta == tb:
			tt += ta
			da = a[i]
			db = a[j]
			sa += 1
			sb += 1
			i += 1
			j -= 1
		elif ta < tb:
			db -= sb * ta
			tt += ta
			da = a[i]
			i += 1
			sa += 1
		else:
			tt += tb
			da += sa * tb
			db = a[j]
			j -= 1
			sb += 1
	val = tt + (db - da) / (sa + sb)
	print('{:.15f}'.format(val))


from sys import stdin
T = int(stdin.readline().strip())
for caso in range(T):
	(n, k) = map(int, stdin.readline().strip().split())
	s = [0] + list(map(int, stdin.readline().strip().split())) + [k]
	n = len(s)
	t1 = [0 for i in range(n)]
	t2 = [0 for i in range(n)]
	v = 1
	for i in range(1, n):
		t1[i] = (s[i] - s[i - 1]) / v + t1[i - 1]
		v += 1
	v = 1
	for i in range(n - 2, -1, -1):
		t2[i] = (s[i + 1] - s[i]) / v + t2[i + 1]
		v += 1
	for i in range(n - 1):
		if t1[i] >= t2[i + 1]:
			v1 = i + 1
			v2 = n - (i + 1)
			d2 = s[i + 1] - v2 * (t1[i] - t2[i + 1])
			if d2 < s[i]:
				i -= 1
				v1 = i + 1
				v2 = n - (i + 1)
				d2 = s[i + 1] - v2 * (t1[i] - t2[i + 1])
				print(t1[i] + (d2 - s[i]) / (v1 + v2))
			else:
				v1 = i + 1
				v2 = n - (i + 1)
				d2 = s[i + 1] - v2 * (t1[i] - t2[i + 1])
				print(t1[i] + (d2 - s[i]) / (v1 + v2))
			break


gans = []
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	u = [0] + list(map(int, input().split())) + [l]
	n += 2
	ta = [0] * n
	tb = [0] * n
	vcur = 1
	for i in range(1, n):
		ta[i] = ta[i - 1] + (u[i] - u[i - 1]) / vcur
		vcur += 1
	vcur = 1
	for i in range(n - 2, -1, -1):
		tb[i] = tb[i + 1] + (u[i + 1] - u[i]) / vcur
		vcur += 1
	EPS = 1e-06
	ok = False
	for i in range(n):
		if abs(ta[i] - tb[i]) < EPS:
			gans.append(ta[i])
			ok = True
			break
	if ok:
		continue
	ind = 0
	for i in range(n - 1):
		if ta[i + 1] > tb[i + 1] and ta[i] < tb[i]:
			ind = i
			break
	dst = u[ind + 1] - u[ind]
	va = ind + 1
	vb = n - ind - 1
	if ta[ind] < tb[ind + 1]:
		dst -= (tb[ind + 1] - ta[ind]) * va
		ans = tb[ind + 1]
	else:
		dst -= (ta[ind] - tb[ind + 1]) * vb
		ans = ta[ind]
	ans += dst / (va + vb)
	gans.append(ans)
print('\n'.join(map(str, gans)))


tunuk = int(input())
for _ in range(tunuk):
	(n, l) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	beg = 0
	end = n - 1
	v0 = 1
	v1 = 1
	x0 = 0
	x1 = l
	t0 = 0
	t1 = 0
	t = 0
	while beg <= end:
		t0 = (a[beg] - x0) / v0
		t1 = (x1 - a[end]) / v1
		if t0 <= t1:
			x0 = a[beg]
			beg += 1
			x1 -= t0 * v1
			v0 += 1
			t += t0
		else:
			x1 = a[end]
			end -= 1
			x0 += t1 * v0
			v1 += 1
			t += t1
	t += (x1 - x0) / (v0 + v1)
	print('%.10f' % t)


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	flag = list(map(int, input().split()))
	vela = 1.0
	velb = 1.0
	a = 0
	b = l
	time = 0.0
	i = 0
	j = n - 1
	while i <= j:
		t = min((flag[i] - a) / vela, (b - flag[j]) / velb)
		a += t * vela
		b -= t * velb
		time += t
		if a >= flag[i]:
			vela += 1
			i += 1
		if b <= flag[j]:
			velb += 1
			j -= 1
	time += abs(b - a) / (vela + velb)
	print(time)


for _ in range(int(input())):
	(n, t) = map(int, input().split())
	ll = list(map(int, input().split()))
	l = [0]
	for i in ll:
		l.append(i)
	l.append(t)
	a = 0
	b = n + 1
	c1 = 0
	c2 = t
	s1 = s2 = 1
	t1 = t2 = 0
	x = y = 0
	flagx = 0
	flagy = 0
	while a < b - 1:
		if flagx == 0:
			x += (l[a + 1] - l[a]) / s1
			flagx = 1
		if flagy == 0:
			y += (l[b] - l[b - 1]) / s2
			flagy = 1
		if t1 + x < t2 + y:
			t1 += x
			a += 1
			x = 0
			flagx = 0
			s1 += 1
			c1 = l[a]
		elif t1 + x > t2 + y:
			t2 += y
			b -= 1
			y = 0
			flagy = 0
			s2 += 1
			c2 = l[b]
		else:
			t2 += y
			t1 += x
			a += 1
			b -= 1
			s1 += 1
			s2 += 1
			x = y = 0
			c1 = l[a]
			c2 = l[b]
			flagx = 0
			flagy = 0
	if a == b - 1:
		if t1 > t2:
			d = t1 - t2
			c2 -= d * s2
			t2 += d
			t1 += (c2 - c1) / (s1 + s2)
		elif t1 < t2:
			d = t2 - t1
			c1 += d * s1
			t1 += d
			t1 += (c2 - c1) / (s1 + s2)
		else:
			t1 += (c2 - c1) / (s1 + s2)
	print(t1)


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
cases = int(input())
for t in range(cases):
	(n, l) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	(s1, s2) = (1, 1)
	(i, j) = (0, n - 1)
	(cp1, cp2) = (0, l)
	time = 0
	while True:
		t1 = (a[i] - cp1) / s1
		t2 = (cp2 - a[j]) / s2
		if t1 > t2:
			time += t2
			cp1 += s1 * t2
			cp2 = a[j]
			s2 += 1
			j -= 1
		elif t1 == t2:
			time += t1
			cp1 = a[i]
			cp2 = a[j]
			i += 1
			j -= 1
			s1 += 1
			s2 += 1
		else:
			time += t1
			cp2 -= s2 * t1
			cp1 = a[i]
			s1 += 1
			i += 1
		if i > j:
			time += (cp2 - cp1) / (s1 + s2)
			break
	print(time)


(n, l) = (0, 0)
arr = []
for _ in range(int(input())):
	(n, length) = list(map(int, input().split()))
	arr = [0] + list(map(int, input().split())) + [length]
	lArr = [0]
	rArr = [0]
	s = 1
	lasPos = 0
	time = 0
	for i in range(1, n + 2):
		time += (arr[i] - lasPos) / s
		s += 1
		lasPos = arr[i]
		lArr.append(time)
	s = 1
	lasPos = length
	time = 0
	for i in range(n, -1, -1):
		time += abs(arr[i] - lasPos) / s
		s += 1
		lasPos = arr[i]
		rArr.append(time)
	l = 0
	r = length
	for i in range(100):
		time = (l + r) / 2
		lL = 0
		rR = n + 2
		while rR - lL != 1:
			mid = (lL + rR) // 2
			if time < lArr[mid]:
				rR = mid
			else:
				lL = mid
		leftCanTo = lL
		lL = 0
		rR = n + 2
		while rR - lL != 1:
			mid = (lL + rR) // 2
			if time < rArr[mid]:
				rR = mid
			else:
				lL = mid
		rightCanTo = lL
		posL = arr[leftCanTo] + (time - lArr[leftCanTo]) * (1 + leftCanTo)
		posR = arr[n - rightCanTo + 1] - (time - rArr[rightCanTo]) * (1 + rightCanTo)
		if posL < posR:
			l = time
		else:
			r = time
	print(l)


from bisect import bisect
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	A = [0] + list(map(int, input().split())) + [l]
	X = [0] * (n + 2)
	Y = [0] * (n + 2)
	for i in range(1, n + 2):
		X[i] = X[i - 1] + (A[i] - A[i - 1]) / i
		Y[-i - 1] = Y[-i] + (A[-i] - A[-i - 1]) / i
	Y.reverse()
	x = 0
	y = min(X[-1], Y[-1])
	while y - x >= 10 ** (-7) * max(1, x):
		z = (x + y) / 2
		j = bisect(X, z) - 1
		k = bisect(Y, z) - 1
		if A[j] + (z - X[j]) * (j + 1) > A[-k - 1] - (z - Y[k]) * (k + 1):
			y = z
		else:
			x = z
	print(x)


import sys
sys.setrecursionlimit(10000000)
mod = 10 ** 9 + 7
INF = float('inf')
from sys import stdin
readline = stdin.readline

def readInts():
	return list(map(int, readline().split()))

def readTuples():
	return tuple(map(int, readline().split()))

def I():
	return int(readline())
q = I()
for _ in range(q):
	(n, l) = readInts()
	A = readInts()
	start = 0
	end = l
	cnt = 0
	sv = 1
	ev = 1
	spos = 0
	epos = n - 1
	times = 0
	while cnt != n:
		if abs(A[spos] - start) / sv < abs(A[epos] - end) / ev:
			cnt += 1
			times += (A[spos] - start) / sv
			end -= (A[spos] - start) / sv * ev
			sv += 1
			start = A[spos]
			spos += 1
		elif abs(A[spos] - start) / sv == abs(A[epos] - end) / ev:
			if cnt + 2 > n:
				cnt = n
				break
			cnt += 2
			times += (A[spos] - start) / sv
			sv += 1
			ev += 1
			start = A[spos]
			end = A[epos]
			spos += 1
			epos -= 1
		else:
			cnt += 1
			times += (end - A[epos]) / ev
			start += (end - A[epos]) / ev * sv
			ev += 1
			end = A[epos]
			epos -= 1
	print('%.14f' % (times + (end - start) / (sv + ev)))


for _ in range(int(input())):
	(n, length) = map(int, input().split())
	arr = list(map(int, input().split()))
	a = [0.0] * n
	b = [0.0] * n
	a[0] = arr[0]
	b[-1] = length - arr[-1]
	sa = 2
	sb = 2
	for i in range(1, n):
		a[i] += (arr[i] - arr[i - 1]) / sa + a[i - 1]
		sa += 1
	for i in reversed(range(0, n - 1)):
		b[i] += (arr[i + 1] - arr[i]) / sb + b[i + 1]
		sb += 1
	pos = -1
	for i in range(n):
		if a[i] >= b[i]:
			pos = i
			break
	if a[pos] == b[pos]:
		print(a[pos])
	else:
		if pos == 0:
			sa = 1
			sb = n - pos + 1
			dist_a = sa * b[pos]
			time = b[pos]
			dist_b = arr[pos]
			y = (sa * dist_b + sb * dist_a) / (sa + sb)
			time += (y - dist_a) / sa
		elif pos == -1:
			sb = 1
			sa = n + 1
			dist_b = length - sb * a[pos]
			dist_a = arr[pos]
			y = (sa * dist_b + sb * dist_a) / (sa + sb)
			time = (y - dist_a) / sa
			time += a[pos]
		elif a[pos - 1] < b[pos]:
			temp = b[pos] - a[pos - 1]
			time = b[pos]
			dist_b = arr[pos]
			sb = n - pos + 1
			sa = pos + 1
			dist_a = sa * temp + arr[pos - 1]
			y = (sa * dist_b + sb * dist_a) / (sa + sb)
			time += (y - dist_a) / sa
		else:
			temp = a[pos - 1] - b[pos]
			time = a[pos - 1]
			sb = n - pos + 1
			dist_b = arr[pos] - sb * temp
			sa = pos + 1
			dist_a = arr[pos - 1]
			y = (sa * dist_b + sb * dist_a) / (sa + sb)
			time += (dist_b - y) / sb
		print(time)


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	(i, j) = (0, n + 1)
	(ti, tj) = (0, 0)
	(si, sj) = (1, 1)
	while True:
		if i == j:
			break
		if ti < tj:
			i += 1
			ti += (a[i] - a[i - 1]) / si
			si += 1
		else:
			j -= 1
			tj += (a[j + 1] - a[j]) / sj
			sj += 1
	if ti > tj:
		lx = a[i] - a[i - 1]
		si -= 1
		ti -= (a[i] - a[i - 1]) / si
		if ti > tj:
			lx -= (ti - tj) * sj
		else:
			lx -= (tj - ti) * si
		print(max(ti, tj) + lx / (si + sj))
	else:
		lx = a[i + 1] - a[i]
		sj -= 1
		tj -= (a[i + 1] - a[i]) / sj
		if ti > tj:
			lx -= (ti - tj) * sj
		else:
			lx -= (tj - ti) * si
		print(max(ti, tj) + lx / (si + sj))


t = int(input())
for _ in range(t):
	(n, le) = map(int, input().split())
	arr = list(map(int, input().split()))
	f = [0] * (n + 2)
	l = [0] * (n + 2)
	f[1] = arr[0]
	l[n] = le - arr[n - 1]
	s = 2
	for i in range(2, n + 1):
		f[i] = f[i - 1] + (arr[i - 1] - arr[i - 2]) / s
		s += 1
	f[n + 1] = f[n] + (le - arr[n - 1]) / s
	s = 2
	for i in range(n - 1, 0, -1):
		l[i] = l[i + 1] + (arr[i] - arr[i - 1]) / s
		s += 1
	l[0] = l[1] + arr[0] / s
	ans = 0
	for i in range(n + 1):
		if l[i] == f[i]:
			ans = l[i]
			break
		elif f[i] < l[i] and f[i + 1] > l[i + 1]:
			if i == n:
				d = le - arr[i - 1]
			elif i == 0:
				d = arr[0]
			else:
				d = arr[i] - arr[i - 1]
			if f[i] > l[i + 1]:
				d -= (f[i] - l[i + 1]) * (n - i + 1)
			else:
				d -= (l[i + 1] - f[i]) * (i + 1)
			ans = max(f[i], l[i + 1]) + d / (n + 2)
			break
	print(ans)


import math
t = int(input())
for j in range(0, t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a = [0] + a
	a.append(l)
	o = 0
	p = n + 1
	u = 0
	l = 0
	while o < p:
		if u == l:
			u = u + (a[o + 1] - a[o]) / (o + 1)
			o = o + 1
		elif u > l:
			l = l + (a[p] - a[p - 1]) / (n + 2 - p)
			p -= 1
		else:
			u = u + (a[o + 1] - a[o]) / (o + 1)
			o += 1
	if u == l:
		print(u)
	elif u > l:
		o = o - 1
		u = u - (a[o + 1] - a[o]) / (o + 1)
		x = ((o + 1) * (n + 2 - p) * (l - u) + a[o] * (n + 2 - p) + a[p] * (o + 1)) / (n + 3 + o - p)
		u = u + (x - a[o]) / (o + 1)
		print(u)
	else:
		p = p + 1
		l = l - (a[p] - a[p - 1]) / (n + 2 - p)
		x = ((o + 1) * (n + 2 - p) * (l - u) + a[o] * (n + 2 - p) + a[p] * (o + 1)) / (n + 3 + o - p)
		l = l + (a[p] - x) / (n + 2 - p)
		print(l)


from sys import stdin
input = stdin.readline

def myk(l, stops, czas):
	pos = 0
	v = 1.0
	for stop in stops:
		dist = stop - pos
		if czas * v > dist:
			czas -= dist / v
			pos = stop
			v += 1
		else:
			return pos + czas * v
	return pos + czas * v

def solve():
	(n, l) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	b = [l - x for x in a[::-1]]
	pocz = 0.0
	kon = l / 2.0
	eps = 1e-07
	while pocz + eps < kon:
		mid = (pocz + kon) / 2.0
		pos1 = myk(l, a, mid)
		pos2 = l - myk(l, b, mid)
		if pos1 < pos2:
			pocz = mid
		else:
			kon = mid
	print(kon)
t = int(input())
for _ in range(t):
	solve()


import math
t = int(input())
for w in range(t):
	(n, l) = (int(i) for i in input().split())
	a = [int(i) for i in input().split()]
	s1 = 0
	s2 = l
	v1 = 1
	v2 = 1
	t = 0
	i = 0
	j = n - 1
	prevt = -1
	while s1 < s2:
		ps1 = s1
		ps2 = s2
		pv1 = v1
		pv2 = v2
		prevt = t
		if i == n or j == -1:
			break
		if (a[i] - s1) / v1 < (s2 - a[j]) / v2:
			t += (a[i] - s1) / v1
			s2 -= v2 * (a[i] - s1) / v1
			s1 = a[i]
			v1 += 1
			i += 1
		elif (a[i] - s1) / v1 > (s2 - a[j]) / v2:
			t += (s2 - a[j]) / v2
			s1 += v1 * (s2 - a[j]) / v2
			s2 = a[j]
			v2 += 1
			j -= 1
		else:
			t += (a[i] - s1) / v1
			s1 = a[i]
			s2 = a[j]
			v1 += 1
			v2 += 1
			i += 1
			j -= 1
	if s1 == s2:
		print(t)
	else:
		print(prevt + (ps2 - ps1) / (pv2 + pv1))


from collections import deque
t = int(input())
for _ in range(t):
	(n, d) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	(left, right) = (deque(), deque())
	(x, y) = (0, d)
	(vx, vy) = (1, 1)
	tim = 0.0
	for i in range(n):
		left.append(a[i])
		right.append(a[n - i - 1])
	while x != y:
		if len(left) == 0 and len(right) == 0:
			tim += (y - x) / (vx + vy)
			x = y
		elif len(right) == 0:
			t = (left[0] - x) / vx
			if left[0] > y - vy * t:
				tim += (y - x) / (vx + vy)
				x = y
			else:
				tim += t
				x = left[0]
				y -= vy * t
				vx += 1
				left.popleft()
		elif len(left) == 0:
			t = (y - right[0]) / vy
			if x + vx * t > right[0]:
				tim += (y - x) / (vx + vy)
				x = y
			else:
				tim += t
				y = right[0]
				x += vx * t
				vy += 1
				right.popleft()
		else:
			(t1, t2) = ((left[0] - x) / vx, (y - right[0]) / vy)
			if t1 < t2:
				t = t1
				if left[0] > y - vy * t:
					tim += (y - x) / (vx + vy)
					x = y
				else:
					tim += t
					x = left[0]
					y -= vy * t
					vx += 1
					left.popleft()
			else:
				t = t2
				if x + vx * t > right[0]:
					tim += (y - x) / (vx + vy)
					x = y
				else:
					tim += t
					y = right[0]
					x += vx * t
					vy += 1
					right.popleft()
	print(tim)


mod = 10 ** 9 + 7

def solve():
	(n, x) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 0
	r = 10 ** 9
	cnt = 0
	while cnt < 200:
		cnt += 1
		m = (l + r) / 2
		t = m
		s1 = 0
		s2 = x
		v1 = 1
		v2 = 1
		old = 0
		for i in range(n):
			if t * v1 >= a[i] - old:
				t -= (a[i] - old) / v1
				v1 += 1
				s1 = a[i]
			else:
				s1 += v1 * t
				t = 0
				break
			old = a[i]
		s1 += v1 * t
		old = x
		t = m
		for i in range(n - 1, -1, -1):
			if t * v2 >= old - a[i]:
				t -= (old - a[i]) / v2
				v2 += 1
				s2 = a[i]
			else:
				s2 -= v2 * t
				t = 0
				break
			old = a[i]
		s2 -= v2 * t
		if s1 > s2:
			r = m
		else:
			l = m
	print('%.9f' % l)
t = int(input())
while t > 0:
	solve()
	t -= 1


from collections import deque
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	l1 = [0]
	cur1 = 1
	for i in range(1, n + 2):
		l1.append(l1[-1] + (a[i] - a[i - 1]) / cur1)
		cur1 += 1
	a2 = [l - i for i in a]
	l2 = deque([0])
	a2.sort()
	cur2 = 1
	for i in range(1, n + 2):
		l2.appendleft(l2[0] + (a2[i] - a2[i - 1]) / cur2)
		cur2 += 1
	l2 = list(l2)
	ind = float('inf')
	for i in range(n + 2):
		if l1[i] >= l2[i]:
			ind = i
			break
	(s1, s2) = (ind, n + 2 - ind)
	(p1, p2) = (l1[ind - 1], l2[ind])
	kyori = a[ind] - a[ind - 1]
	if p2 > p1:
		kyori -= (p2 - p1) * s1
	if p2 <= p1:
		kyori -= (p1 - p2) * s2
	print(max(p1, p2) + kyori / (s1 + s2))


for _ in range(int(input())):
	(n, l) = tuple(map(int, input().strip(' ').split(' ')))
	a = list(map(float, input().strip(' ').split(' ')))
	a = [0] + a
	a.append(l)
	(t1, t2, v1, v2) = (0, 0, 1, 1)
	n += 2
	(c1, c2, vel1, vel2) = ([0] * n, [0] * n, [1] * n, [1] * n)
	for i in range(1, n):
		t1 += (a[i] - a[i - 1]) / v1
		v1 += 1
		t2 += (-a[n - i - 1] + a[n - i]) / v2
		v2 += 1
		c1[i] = t1
		c2[n - i - 1] = t2
		vel1[i] = v1
		vel2[n - i - 1] = v2
	ans = 0
	for i in range(n - 1):
		if c2[i + 1] <= c1[i + 1] and c1[i] <= c2[i]:
			dist = a[i + 1] - a[i]
			if c1[i] < c2[i + 1]:
				dist -= vel1[i] * (c2[i + 1] - c1[i])
			else:
				dist -= vel2[i + 1] * (-c2[i + 1] + c1[i])
			ans = dist / (vel1[i] + vel2[i + 1]) + max(c1[i], c2[i + 1])
			break
	print(ans)


from decimal import Decimal
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	ls = list(map(int, input().split()))
	start = 0
	s = 0
	end = l
	tm = 0
	i = 0
	j = n - 1
	ss = 1
	se = 1
	while i <= j:
		currs = (ls[i] - start) / ss
		curre = (end - ls[j]) / se
		if currs < curre:
			temp = (ls[i] - start) / ss
			tm += temp
			end -= temp * se
			ss += 1
			start = ls[i]
			i += 1
		elif currs > curre:
			temp = (end - ls[j]) / se
			tm += temp
			start += temp * ss
			end = ls[j]
			se += 1
			j -= 1
		else:
			temp = currs
			tm += temp
			start = ls[i]
			end = ls[j]
			ss += 1
			se += 1
			i += 1
			j -= 1
	if start != end:
		temp = (end - start) / (ss + se)
		tm += temp
	print(tm)


import bisect
t = int(input())
for _ in range(t):
	(n, l) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	(x, y, ans) = (0, l, 0)
	(v1, v2) = (1, 1)
	while x < y:
		j1 = bisect.bisect_right(a, x)
		j2 = bisect.bisect_left(a, y)
		if j1 == j2:
			ans = ans + (y - x) / (v1 + v2)
			y = x
		else:
			t1 = (a[j1] - x) / v1
			t2 = (y - a[j2 - 1]) / v2
			if t1 > t2:
				x = x + v1 * t2
				y = y - v2 * t2
				ans = ans + t2
				v2 = v2 + 1
			elif t1 == t2:
				x = x + v1 * t1
				y = y - v2 * t2
				ans = ans + t1
				v1 = v1 + 1
				v2 = v2 + 1
			else:
				x = x + v1 * t1
				y = y - v2 * t1
				ans = ans + t1
				v1 = v1 + 1
	print(ans)


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	arr = list(map(int, input().split()))
	(ls, rs, lx, rx, li, ri) = (1, 1, 0, l, 0, n)
	total = 0
	while li != ri:
		if (arr[li] - lx) / ls < (rx - arr[ri - 1]) / rs:
			total += (arr[li] - lx) / ls
			rx -= (arr[li] - lx) / ls * rs
			lx = arr[li]
			li += 1
			ls += 1
		else:
			total += (rx - arr[ri - 1]) / rs
			lx += (rx - arr[ri - 1]) / rs * ls
			rx = arr[ri - 1]
			ri -= 1
			rs += 1
	total += (rx - lx) / (ls + rs)
	print(total)


a = int(input())
for k in range(0, a):
	b = list(map(int, input().split()))
	c = list(map(int, input().split()))
	v = 1
	u = 1
	h = 0
	i = 0
	dv = 0
	du = b[1]
	while len(c) != 0:
		if (c[i] - dv) / v <= (du - c[len(c) - 1]) / u:
			e = (c[i] - dv) / v
			h = h + e
			dv = c[i]
			v = v + 1
			c.remove(c[i])
			if len(c) != 0:
				if e * u >= du - c[len(c) - 1]:
					f = (du - c[len(c) - 1]) / u
					du = c[len(c) - 1]
					c.remove(c[len(c) - 1])
					u = u + 1
					if e > f:
						du = du - (e - f) * u
				else:
					du = du - u * e
			else:
				du = du - u * e
		else:
			e = (du - c[len(c) - 1]) / u
			h = h + e
			du = c[len(c) - 1]
			u = u + 1
			c.remove(c[len(c) - 1])
			if len(c) != 0:
				if e * v >= c[i] - dv:
					f = (c[i] - dv) / v
					dv = c[i]
					c.remove(c[i])
					v = v + 1
					if e > f:
						dv = dv + (e - f) * v
				else:
					dv = dv + v * e
			else:
				dv = dv + v * e
	h = h + (du - dv) / (u + v)
	print(h)


from sys import stdin, stdout
import math, bisect
from collections import Counter, deque, defaultdict
L = lambda : list(map(int, stdin.readline().strip().split()))
M = lambda : map(int, stdin.readline().strip().split())
I = lambda : int(stdin.readline().strip())
S = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()

def pr(a):
	return ' '.join(list(map(str, a)))

def solve():
	(n, l) = M()
	a = [0] + L() + [l]
	n += 2
	t1 = [0] * n
	t2 = [0] * n
	for i in range(1, n):
		t1[i] = t1[i - 1] + (a[i] - a[i - 1]) / i
		t2[-i - 1] = t2[-i] + (a[-i] - a[-i - 1]) / i
	i = 0
	while t2[i] > t1[i]:
		i += 1
	if t1[i - 1] <= t2[i]:
		dis = a[i - 1] + (t2[i] - t1[i - 1]) * i
		print(t2[i] + (a[i] - dis) / n)
	else:
		dis = a[i] - (t1[i - 1] - t2[i]) * (n - i)
		print(t1[i - 1] + (dis - a[i - 1]) / n)
for _ in range(I()):
	solve()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	(n, k) = RL()
	a = RLL()
	a = [0] + a + [k]
	(tl, tr) = ([0] * (n + 2), [0] * (n + 2))
	now = 1
	for i in range(1, n + 2):
		tl[i] = (a[i] - a[i - 1]) / now + tl[i - 1]
		now += 1
	now = 1
	for i in range(n, -1, -1):
		tr[i] = (a[i + 1] - a[i]) / now + tr[i + 1]
		now += 1
	(l, r) = (0, n + 2)
	while l < r:
		m = l + r >> 1
		if tl[m] < tr[m]:
			l = m + 1
		else:
			r = m
	va = l
	vb = n - l + 2
	s = a[l] - a[l - 1]
	if tl[l - 1] <= tr[l]:
		s -= va * (tr[l] - tl[l - 1])
		print(tr[l] + s / (va + vb))
	else:
		s -= vb * (tl[l - 1] - tr[l])
		print(tl[l - 1] + s / (va + vb))


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	n = n + 2
	a = list(map(int, input().split()))
	a = [0] + a + [l]
	t1 = [0.0]
	s1 = [1]
	b = list(map(lambda x: l - x, a))
	t2 = [0.0]
	s2 = [1]
	b = list(reversed(b))
	for i in range(1, n):
		t1.append(t1[i - 1] + (a[i] - a[i - 1]) / s1[i - 1])
		s1.append(s1[i - 1] + 1)
		t2.append(t2[i - 1] + (b[i] - b[i - 1]) / s2[i - 1])
		s2.append(s2[i - 1] + 1)
	t2 = list(reversed(t2))
	s2 = list(reversed(s2))
	for i in range(n):
		if t1[i] == t2[i]:
			t = t1[i]
			break
		elif t1[i] > t2[i]:
			tx = max(t1[i - 1], t2[i])
			tn = min(t1[i - 1], t2[i])
			d = a[i] - a[i - 1]
			d1 = (tx - tn) * (s1[i - 1] * (t1[i - 1] == tn) + s2[i] * (t2[i] == tn))
			t = tx + (d - d1) / (s1[i - 1] + s2[i])
			break
	print('{0:.15f}'.format(t))


import sys
input = sys.stdin.readline

def move(pos, time):
	used = 0
	speed = 1
	for val in arr:
		need = (val - pos) / speed
		if used + need > time:
			pos += speed * (time - used)
			break
		else:
			pos = val
			used += need
			speed += 1
	else:
		pos += speed * (time - used)
	return pos

def rmove(pos, time):
	right = pos
	used = 0
	speed = 1
	for val in arr[::-1]:
		need = (pos - val) / speed
		if used + need > time:
			pos -= speed * (time - used)
			break
		else:
			pos = val
			used += need
			speed += 1
	else:
		pos -= speed * (time - used)
	return right - pos
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	arr = list(map(int, input().split()))
	mins = 0
	maxs = l
	for _ in range(80):
		cand = (mins + maxs) / 2
		if move(0, cand) + rmove(l, cand) >= l:
			maxs = cand
		else:
			mins = cand
	print(mins)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		(n, l) = map(int, input().split())
		a = list(map(int, input().split()))
		a.insert(0, 0)
		a.append(l)
		firstIndex = 0
		lastIndex = n + 1
		firstTime = 0
		lastTime = 0
		while True:
			if lastIndex - firstIndex == 1:
				if firstTime > lastTime:
					distanceCovered = (firstTime - lastTime) * (n + 2 - lastIndex)
				else:
					distanceCovered = (lastTime - firstTime) * (firstIndex + 1)
				print(max(firstTime, lastTime) + (a[lastIndex] - a[firstIndex] - distanceCovered) / (n + 2))
				break
			elif firstTime + (a[firstIndex + 1] - a[firstIndex]) / (firstIndex + 1) > lastTime + (a[lastIndex] - a[lastIndex - 1]) / (n + 2 - lastIndex):
				lastTime += (a[lastIndex] - a[lastIndex - 1]) / (n + 2 - lastIndex)
				lastIndex -= 1
			else:
				firstTime += (a[firstIndex + 1] - a[firstIndex]) / (firstIndex + 1)
				firstIndex += 1
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin, stdout
import math
import heapq
import collections
input = stdin.readline

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputstrings():
	return [x for x in input().split()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	(n, l) = inputnums()
	a = inputlist()
	dist = [0] * (n + 2)
	dist[1] = a[0]
	for i in range(2, n + 1):
		dist[i] = a[i - 1] - a[i - 2]
	dist[n + 1] = l - a[n - 1]
	b = [0] * (n + 2)
	curb = 1
	for i in range(1, n + 2):
		b[i] = dist[i] / curb + b[i - 1]
		curb += 1
	c = [0] * (n + 2)
	curc = 1
	for i in reversed(range(1, n + 2)):
		c[i - 1] = dist[i] / curc + c[i]
		curc += 1
	flag = 0
	for i in range(1, n + 2):
		if c[i] <= b[i]:
			flag = i
			break
	speedb = flag
	speedc = n - flag + 2
	ans = (dist[flag] - (b[flag - 1] - c[flag]) * speedc) / (speedc + speedb) + b[flag - 1]
	print(ans)


from sys import stdin, stdout
input = stdin.readline
print = stdout.write
N = 100002
ta = [0] * N
tb = [0] * N
ans = []
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = [0] + list(map(int, input().split())) + [l]
	tb[n + 1] = 0
	i = 1
	j = n
	while i <= n:
		ta[i] = ta[i - 1] + (a[i] - a[i - 1]) / i
		tb[j] = tb[j + 1] + (a[j + 1] - a[j]) / i
		i += 1
		j -= 1
	i = 1
	j = n
	while i < j:
		if ta[i] < tb[j]:
			i += 1
		else:
			j -= 1
	if ta[i] < tb[i]:
		ans += (ta[i] + (a[i + 1] - a[i] - (n - i + 1) * (ta[i] - tb[i + 1])) / (n + 2),)
	elif ta[i] > tb[i]:
		ans += (tb[i] + (a[i] - a[i - 1] - i * (tb[i] - ta[i - 1])) / (n + 2),)
	else:
		ans += (ta[i],)
print('\n'.join(map(str, ans)))


from collections import defaultdict
mod = 10 ** 9 + 7
INF = float('inf')

def getlist():
	return list(map(int, input().split()))

def inverse(N, mod):
	return pow(N, mod - 2, mod)

def main():
	T = int(input())
	for _ in range(T):
		(N, L) = getlist()
		A = getlist()
		A.append(L)
		timeleft = [0] * (N + 2)
		timeright = [0] * (N + 2)
		timeleft[1] = A[0]
		for i in range(2, N + 2):
			dif = A[i - 1] - A[i - 2]
			timeleft[i] = timeleft[i - 1] + dif / i
		timeright[N] = A[-1] - A[-2]
		for i in range(N - 1, 0, -1):
			dif = A[i] - A[i - 1]
			timeright[i] = timeright[i + 1] + dif / (N + 1 - i)
		timeright[0] = timeright[1] + A[0] / (N + 1)
		for i in range(N + 1):
			if timeleft[i] <= timeright[i] and timeleft[i + 1] >= timeright[i + 1]:
				p1 = timeleft[i]
				p2 = timeleft[i + 1]
				q1 = timeright[i]
				q2 = timeright[i + 1]
				if p2 - p1 + q1 - q2 == 0:
					print(p1)
				else:
					ans = (p2 - p1) * (q1 - p1) / (p2 - p1 + q1 - q2) + p1
					print(ans)
				break
main()


T = int(input())
for t in range(T):
	(n, l) = map(int, input().split())
	A = list(map(int, input().split()))
	curr = 0
	(near1, near2) = (0, -1)
	(speed1, speed2) = (1, 1)
	(pos1, pos2) = (0, l)
	time = 0
	while A[near1] <= A[near2]:
		if (A[near1] - pos1) / speed1 > (pos2 - A[near2]) / speed2:
			extra = (pos2 - A[near2]) / speed2
			speed2 += 1
			pos2 = A[near2]
			near2 -= 1
			time += extra
			pos1 += extra * speed1
		else:
			extra = (A[near1] - pos1) / speed1
			speed1 += 1
			pos1 = A[near1]
			near1 += 1
			time += extra
			pos2 -= extra * speed2
		if near2 < -n or near1 >= n:
			break
	speed = speed1 + speed2
	distance = pos2 - pos1
	time += distance / speed
	print(time)


import sys
input = sys.stdin.readline

def main():
	(n, l) = map(int, input().split())
	alst = list(map(int, input().split()))
	ll = 0
	rr = n - 1
	l_pos = 0
	r_pos = l
	l_speed = 1
	r_speed = 1
	ans = 0
	while rr >= ll:
		l2 = (alst[ll] - l_pos) * r_speed
		r2 = (r_pos - alst[rr]) * l_speed
		if r2 == l2:
			ans += (alst[ll] - l_pos) / l_speed
			r_pos = alst[rr]
			l_pos = alst[ll]
			r_speed += 1
			l_speed += 1
			rr -= 1
			ll += 1
		elif r2 < l2:
			ans += (r_pos - alst[rr]) / r_speed
			l_pos += (r_pos - alst[rr]) / r_speed * l_speed
			r_pos = alst[rr]
			r_speed += 1
			rr -= 1
		else:
			ans += (alst[ll] - l_pos) / l_speed
			r_pos -= (alst[ll] - l_pos) / l_speed * r_speed
			l_pos = alst[ll]
			l_speed += 1
			ll += 1
	ans += (r_pos - l_pos) / (r_speed + l_speed)
	print(ans)
for _ in range(int(input())):
	main()


ans = []
for t in range(int(input())):
	(n, l) = map(int, input().split())
	(*a,) = map(int, input().split())
	n += 2
	a = [0] + a + [l]
	ls = [0] * n
	rs = [0] * n
	for i in range(1, n):
		ls[i] = ls[i - 1] + (a[i] - a[i - 1]) / i
	for i in range(n - 2, -1, -1):
		rs[i] = rs[i + 1] + (a[i + 1] - a[i]) / (n - 1 - i)
	for i in range(n - 1):
		if ls[i] <= rs[i] and ls[i + 1] > rs[i + 1]:
			(vx, vy) = (i + 1, n - 1 - i)
			(tx, ty) = (ls[i], rs[i + 1])
			m = a[i + 1] - a[i]
			if tx > ty:
				m -= vy * (tx - ty)
			else:
				m -= vx * (ty - tx)
			dt = m / (vx + vy)
			ans.append(max(tx, ty) + dt)
			break
for a in ans:
	print(a)


t = int(input())
for _ in range(t):
	(n, l) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	car1 = [0, arr[0]]
	car2 = [0] * (n + 1)
	car2[-1] = l - arr[-1]
	for i in range(n - 1):
		temp1 = (arr[i + 1] - arr[i]) / (i + 2)
		car1.append(car1[-1] + temp1)
		temp2 = (arr[-i - 1] - arr[-i - 2]) / (i + 2)
		car2[-i - 2] = car2[-i - 1] + temp2
	car1.append(car1[-1] + (l - arr[-1]) / (n + 1))
	car2[0] = car2[1] + arr[0] / (n + 1)
	car2.append(0)
	arr.append(l)
	arr = [0] + arr
	s = -1
	for i in range(n + 2):
		if car1[i] == car2[i]:
			ans = car1[i]
			s = 0
			break
	if s == 0:
		print(ans)
	else:
		for i in range(n + 1):
			if car1[i] < car2[i] and car1[i] >= car2[i + 1]:
				x = car1[i]
				y = car2[i + 1]
				ind = i
				s = 0
				break
		if s == 0:
			z = x - y
			v1 = ind + 1
			v2 = n + 1 - ind
			d = arr[ind + 1] - arr[ind]
			d1 = v2 * z
			d -= d1
			w = d / (v1 + v2)
			print(x + w)
		else:
			for i in range(n + 1, 0, -1):
				if car2[i] < car1[i] and car2[i] >= car1[i - 1]:
					x = car2[i]
					y = car1[i - 1]
					ind = i
					s = 0
					break
			z = x - y
			v1 = n + 2 - ind
			v2 = ind
			d = arr[ind] - arr[ind - 1]
			d1 = v2 * z
			d -= d1
			w = d / (v1 + v2)
			print(x + w)


t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	x = 0
	vx = 1
	k = 0
	y = l
	vy = 1
	s = n - 1
	time = 0
	while k <= s:
		if (a[k] - x) / vx < (y - a[s]) / vy:
			time += (a[k] - x) / vx
			y -= (a[k] - x) / vx * vy
			x = a[k]
			vx += 1
			k += 1
		else:
			time += (y - a[s]) / vy
			x += (y - a[s]) / vy * vx
			y = a[s]
			vy += 1
			s -= 1
	time += (y - x) / (vx + vy)
	print(time)


import sys
readline = sys.stdin.readline
T = int(readline())
Ans = [None] * T
for qu in range(T):
	(N, L) = map(int, readline().split())
	A = [0] + list(map(int, readline().split())) + [L]
	Ad = [a2 - a1 for (a1, a2) in zip(A, A[1:])]
	Lf = [0] * (N + 2)
	for i in range(1, N + 2):
		Lf[i] = Lf[i - 1] + Ad[i - 1] / i
	Lb = [0] * (N + 2)
	for i in range(N, -1, -1):
		Lb[i] = Lb[i + 1] + Ad[i] / (N + 1 - i)
	for i in range(N + 1):
		if Lf[i] <= Lb[i] and Lb[i + 1] <= Lf[i + 1]:
			D = A[i + 1] - A[i]
			if Lf[i] <= Lb[i + 1]:
				D -= (i + 1) * (Lb[i + 1] - Lf[i])
			else:
				D -= (N + 1 - i) * (Lf[i] - Lb[i + 1])
			ans = max(Lf[i], Lb[i + 1]) + D / (N + 2)
			break
	Ans[qu] = ans
print('\n'.join(map(str, Ans)))


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

def IP():
	return map(int, stdin.readline().split())

def L():
	return list(map(int, stdin.readline().split()))

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * (2 * 10 ** 5 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(2 * 10 ** 5 + 5):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj
mod = 10 ** 9 + 7

def get_t1(x, a):
	last = 0
	s = 1
	t = 0
	for i in range(len(a)):
		if a[i] >= x:
			break
		t += (a[i] - last) / s
		s += 1
		last = a[i]
	t += (x - last) / s
	return t

def get_t2(x, a, l):
	last = l
	(s, t) = (1, 0)
	for i in range(len(a) - 1, -1, -1):
		if a[i] <= x:
			break
		t += (last - a[i]) / s
		s += 1
		last = a[i]
	t += (last - x) / s
	return t

def solve():
	diff = 1e-07
	(n, l) = IP()
	a = L()
	(low, high) = (0, l + 1)
	while True:
		mid = (low + high) / 2
		t1 = get_t1(mid, a)
		t2 = get_t2(mid, a, l)
		if abs(t1 - t2) <= diff:
			ans = (t1 + t2) / 2
			break
		elif t1 > t2:
			high = mid
		else:
			low = mid
	print(ans)
	return
t = II()
for i in range(t):
	solve()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	i = 0
	j = n - 1
	first = 0
	second = k
	ans = 0
	speeda = 1
	speedb = 1
	preva = 0
	prevb = k
	ans = 0
	while i <= j:
		c = min((a[i] - first) / speeda, (second - a[j]) / speedb)
		if (a[i] - first) / speeda < (second - a[j]) / speedb:
			ans += c
			speeda += 1
			first = a[i]
			i += 1
			second = second - c * speedb
		elif (a[i] - first) / speeda > (second - a[j]) / speedb:
			ans += c
			speedb += 1
			second = a[j]
			j -= 1
			first = first + c * speeda
		else:
			ans += c
			first = a[i]
			second = a[j]
			i += 1
			j -= 1
			speeda += 1
			speedb += 1
	d = abs(second - first)
	ans1 = d / (speeda + speedb)
	print(ans1 + ans)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l.append(k)
	l.insert(0, 0)
	speed = 0
	a = [0]
	b = [0]
	for i in range(1, n + 2):
		speed += 1
		a.append(a[-1] + (l[i] - l[i - 1]) / speed)
		b.append(b[-1] + (l[n - i + 2] - l[n - i + 1]) / speed)
	b.reverse()
	ans = 0
	for i in range(0, n + 1):
		if a[i] <= b[i] and a[i + 1] > b[i + 1]:
			ans = i
	i = ans
	res = a[i] + ((n + 1 - i) * (b[i + 1] - a[i]) + (l[i + 1] - l[i])) / (n + 2)
	print(res)


for _ in range(int(input())):
	(n, l) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	(left_ind_of_a, right_ind_of_a) = (0, len(a) - 1)
	(left_coord, right_coord) = (0, l)
	(left_speed, right_speed) = (1, 1)
	seconds = 0
	while True:
		if left_ind_of_a != right_ind_of_a:
			if (a[left_ind_of_a] - left_coord) / left_speed < (right_coord - a[right_ind_of_a]) / right_speed:
				right_coord -= (a[left_ind_of_a] - left_coord) / left_speed * right_speed
				seconds += (a[left_ind_of_a] - left_coord) / left_speed
				left_coord = a[left_ind_of_a]
				left_speed += 1
				left_ind_of_a += 1
			else:
				left_coord += (right_coord - a[right_ind_of_a]) / right_speed * left_speed
				seconds += (right_coord - a[right_ind_of_a]) / right_speed
				right_coord = a[right_ind_of_a]
				right_speed += 1
				right_ind_of_a -= 1
		else:
			if (a[left_ind_of_a] - left_coord) / left_speed < (right_coord - a[right_ind_of_a]) / right_speed:
				right_coord -= (a[left_ind_of_a] - left_coord) / left_speed * right_speed
				seconds += (a[left_ind_of_a] - left_coord) / left_speed
				left_coord = a[left_ind_of_a]
				left_speed += 1
				left_ind_of_a += 1
			else:
				left_coord += (right_coord - a[right_ind_of_a]) / right_speed * left_speed
				seconds += (right_coord - a[right_ind_of_a]) / right_speed
				right_coord = a[right_ind_of_a]
				right_speed += 1
				right_ind_of_a -= 1
			seconds += (right_coord - left_coord) / (right_speed + left_speed)
			break
	print(seconds)


from sys import stdin, stdout
input = stdin.readline
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	time1 = [0]
	time2 = [0]
	st = 0
	var = 0
	sp = 1
	for i in arr:
		var += (i - st) / sp
		time1.append(var)
		st = i
		sp += 1
	time1.append(var + (l - st) / sp)
	st = l
	var = 0
	sp = 1
	for i in arr[::-1]:
		var += abs(i - st) / sp
		time2.append(var)
		st = i
		sp += 1
	time2.append(var + st / sp)
	time2 = time2[::-1]
	arr.insert(0, 0)
	arr.append(l)
	q = 0
	for i in range(n + 2):
		if time1[i] == time2[i]:
			stdout.write(str(time1[i]) + '\n')
			q = 1
			break
	if q:
		continue
	s1 = 0
	s2 = n + 2
	for i in range(n + 1):
		s1 += 1
		s2 -= 1
		if time1[i] > time2[i] and time1[i + 1] > time2[i + 1] or (time1[i] < time2[i] and time1[i + 1] < time2[i + 1]):
			continue
		else:
			dist = arr[i + 1] - arr[i]
			speed = s1 + s2
			a = dist + s1 * time1[i] + s2 * time2[i + 1]
			b = speed
			time = a / b
			break
	stdout.write(str(time) + '\n')


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(n, l) = map(int, input().split())
	A = list(map(int, input().split()))
	A = [0] + A + [l]
	n = n + 2
	A1 = []
	for i in range(n - 1, -1, -1):
		A1.append(l - A[i])
	B = [[0, 1, 0]]
	C = [0 for i in range(n)]
	C[n - 1] = [0, 1, l]
	lind = 0
	lsp = 1
	time = 0
	for i in range(1, n):
		v = (A[i] - lind) / lsp
		lsp = lsp + 1
		lind = A[i]
		time = time + v
		B.append([time, lsp, A[i]])
	lind = 0
	lsp = 1
	time = 0
	for i in range(1, n):
		v = (A1[i] - lind) / lsp
		lsp = lsp + 1
		lind = A1[i]
		time = time + v
		C[n - i - 1] = [time, lsp, A[n - i - 1]]
	ans = 0
	(x, y) = (0, n - 1)
	for i in range(1, n):
		if C[i][0] <= B[i][0]:
			dis = abs(B[i - 1][2] - C[i][2])
			sp = B[i - 1][1] + C[i][1]
			if B[i - 1][0] > C[i][0]:
				dis = abs(dis - (B[i - 1][0] - C[i][0]) * C[i][1])
				ans = B[i - 1][0] + dis / sp
			else:
				ans = C[i][0]
				dis = abs(dis - (C[i][0] - B[i - 1][0]) * B[i - 1][1])
				ans = ans + dis / sp
			break
	print(ans)


T = int(input())
for t in range(T):
	(n, l) = [int(i) for i in input().split()]
	flags = [int(i) for i in input().split()]
	if l == 1:
		print(0.5)
	elif l == 2:
		print(1)
	else:
		t1 = [[0, 0, 1], [flags[0], flags[0], 2]]
		time = flags[0]
		speed = 2
		for i in range(1, n):
			time += (flags[i] - flags[i - 1]) / speed
			t1.append([time, flags[i], speed + 1])
			speed += 1
		t1.append([time + (l - flags[n - 1]) / speed, l, speed])
		t2 = [[0, l, 1], [l - flags[n - 1], flags[n - 1], 2]]
		time = l - flags[n - 1]
		speed = 2
		for i in range(n - 2, -1, -1):
			time += (flags[i + 1] - flags[i]) / speed
			t2.append([time, flags[i], speed + 1])
			speed += 1
		t2.append([time + flags[0] / speed, 0, speed])
		t2 = list(reversed(t2))
		index = 0
		for i in range(n + 2):
			if t1[i][0] == t2[i][0]:
				print(t1[i][0])
				break
			elif t1[i][0] > t2[i][0]:
				if t1[i - 1][0] > t2[i][0]:
					pos2 = t2[i][1] - abs(t1[i - 1][0] - t2[i][0]) * t2[i][2]
					pos1 = t1[i - 1][1]
					speed1 = t1[i - 1][2]
					speed2 = t2[i][2]
					ans = abs(pos2 - pos1) / (speed1 + speed2) + t1[i - 1][0]
					print(ans)
				else:
					pos2 = t2[i][1]
					pos1 = t1[i - 1][1] + abs(t1[i - 1][0] - t2[i][0]) * t1[i - 1][2]
					speed1 = t1[i - 1][2]
					speed2 = t2[i][2]
					ans = abs(pos2 - pos1) / (speed1 + speed2) + t2[i][0]
					print(ans)
				break


t = int(input())
for i in range(t):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	a.append(l)
	a = [0] + a
	t1 = [0 for i in range(n + 2)]
	t2 = [0 for i in range(n + 2)]
	for i in range(1, n + 2):
		t1[i] = t1[i - 1] + (a[i] - a[i - 1]) / i
	for i in range(n, -1, -1):
		t2[i] = t2[i + 1] + (a[i + 1] - a[i]) / (n + 1 - i)
	for i in range(n + 1):
		if t1[i] < t2[i] and (t1[i + 1] >= t2[i + 1] or i == n):
			if t1[i] > t2[i + 1]:
				print(t1[i] + (a[i + 1] - a[i] - (t1[i] - t2[i + 1]) * (n + 1 - i)) / (n + 2))
			else:
				print(t2[i + 1] + (a[i + 1] - a[i] - (t2[i + 1] - t1[i]) * (i + 1)) / (n + 2))


import sys, math
input = sys.stdin.readline

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input().strip()

def listStr():
	return list(input().strip())
import collections as col
import math, itertools

def solve():
	(N, L) = getInts()
	A = [0] + getInts() + [L]
	Jim = [0]
	Oli = [0]
	(J_speed, O_speed) = (1, 1)
	for j in range(1, N + 2):
		Jim.append((A[j] - A[j - 1]) / J_speed + Jim[-1])
		Oli.append((A[N - j + 2] - A[N - j + 1]) / O_speed + Oli[-1])
		J_speed += 1
		O_speed += 1
	Oli.reverse()
	for i in range(N + 2):
		if Jim[i] == Oli[i]:
			return Jim[i]
		if Jim[i] > Oli[i]:
			break
	i -= 1
	if Jim[i] >= Oli[i + 1]:
		D = A[i + 1] - A[i] - (Jim[i] - Oli[i + 1]) * (N - i + 1)
	else:
		D = A[i + 1] - A[i] - (Oli[i + 1] - Jim[i]) * (i + 1)
	return D / (N + 2) + max(Jim[i], Oli[i + 1])
for _ in range(getInt()):
	print(solve())


t = int(input())
for _ in range(t):
	(n, L) = map(int, input().split())
	A = list(map(int, input().split()))
	A = [0] + A + [L]
	l = 0
	r = L
	for i in range(100):
		x = (l + r) / 2
		t1 = 0
		t2 = 0
		v = 1
		for j in range(1, n + 2):
			if A[j] <= x:
				t1 += (A[j] - A[j - 1]) / v
				v += 1
			else:
				t1 += (x - A[j - 1]) / v
				break
		v = 1
		for j in reversed(range(0, n + 1)):
			if A[j] >= x:
				t2 += (A[j + 1] - A[j]) / v
				v += 1
			else:
				t2 += (A[j + 1] - x) / v
				break
		if t1 > t2:
			r = x
		else:
			l = x
	print(t1)


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	(n, l) = map(int, input().split())
	A = [0] + list(map(int, input().split())) + [l]
	TIME1 = [-1] * (n + 2)
	TIME2 = [-1] * (n + 2)
	TIME1[0] = 0
	TIME2[-1] = 0
	for i in range(1, n + 2):
		TIME1[i] = TIME1[i - 1] + (A[i] - A[i - 1]) / i
	for i in range(1, n + 2):
		TIME2[n + 1 - i] = TIME2[n + 2 - i] + (A[n + 2 - i] - A[n + 1 - i]) / i
	for i in range(1, n + 2):
		if TIME1[i] == TIME2[i]:
			print(TIME1[i])
			break
		elif TIME1[i] > TIME2[i]:
			v1 = i
			v2 = n + 2 - i
			MIN = min(TIME1[i - 1], TIME2[i])
			if MIN == TIME1[i - 1]:
				print(TIME2[i] + (A[i] - A[i - 1] - (TIME2[i] - TIME1[i - 1]) * v1) / (v1 + v2))
			else:
				print(TIME1[i - 1] + (A[i] - A[i - 1] - (TIME1[i - 1] - TIME2[i]) * v2) / (v1 + v2))
			break


def calc_positions(arr):
	left = [0] * len(arr)
	for i in range(1, len(left)):
		delta_dist = arr[i] - arr[i - 1]
		delta_time = delta_dist / i
		left[i] = left[i - 1] + delta_time
	return left
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	(*arr,) = map(int, input().split())
	arr = [0] + arr + [l]
	left = calc_positions(arr)
	other_arr = [l - v for v in arr][::-1]
	right = calc_positions(other_arr)[::-1]
	rpos = -1
	for i in range(len(arr)):
		if left[i] >= right[i]:
			rpos = i
			break
	assert rpos > 0
	if left[rpos] == right[rpos]:
		print(left[rpos])
	else:
		if left[rpos - 1] < right[rpos]:
			diff = abs(right[rpos] - left[rpos - 1]) * rpos
		else:
			diff = abs(right[rpos] - left[rpos - 1]) * (len(arr) - rpos)
		dist = arr[rpos] - arr[rpos - 1] - diff
		print(max(left[rpos - 1], right[rpos]) + dist / (n + 2))


import sys
input = sys.stdin.readline
from bisect import bisect_left
from bisect import bisect_right
from math import ceil, factorial

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k, modulus=1):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
		res %= modulus
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	(n, l) = int_array()
	a = int_array()
	a = [0] + a + [l]
	i = 0
	j = len(a) - 1
	si = 1
	sj = 1
	tx = ty = 0
	while i < j:
		if tx <= ty:
			t = a[i + 1] - a[i]
			t /= si
			tx += t
			si += 1
			i += 1
		else:
			t = a[j] - a[j - 1]
			t /= sj
			ty += t
			sj += 1
			j -= 1
	if tx == ty:
		print(tx)
	elif tx < ty:
		t = ty - tx
		sj -= 1
		distance = t * sj
		extra_time = distance / (si + sj)
		ans = tx + extra_time
		print(ans)
	else:
		t = tx - ty
		si -= 1
		distance = t * si
		extra_time = distance / (si + sj)
		ans = ty + extra_time
		print(ans)


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	(n, l) = map(int, input().split())
	a = [0] + [int(x) for x in input().split()] + [l]
	time_1 = [0]
	speed_1 = 1
	for i in range(n):
		d = a[i + 1] - a[i]
		time_1.append(time_1[-1] + d / speed_1)
		speed_1 += 1
	time_2 = [0]
	speed_2 = 1
	for i in range(n, 0, -1):
		d = abs(a[i + 1] - a[i])
		time_2.append(time_2[-1] + d / speed_2)
		speed_2 += 1
	time_1.pop(0)
	time_2.pop(0)
	time_2 = time_2[::-1]
	if time_1[n - 1] < time_2[n - 1]:
		print((l - a[n] - time_1[-1]) / (1 + 1 + n) + time_1[-1])
		continue
	elif time_1[0] > time_2[0]:
		print((a[1] - time_2[0]) / (1 + 1 + n) + time_2[0])
		continue
	for i in range(n):
		if time_1[i] > time_2[i]:
			flag_1 = i
			break
	flag_1 -= 1
	flag_2 = flag_1 + 1
	dist = a[flag_2 + 1] - a[flag_1 + 1]
	speed_1 = 1 + flag_1 + 1
	speed_2 = 1 + n - (flag_1 + 1)
	time_1 = time_1[flag_1]
	time_2 = time_2[flag_2]
	if time_2 > time_1:
		dist -= (time_2 - time_1) * speed_1
	else:
		dist -= (time_1 - time_2) * speed_2
	print(dist / (speed_1 + speed_2) + max(time_1, time_2))


cases = int(input())
for t in range(cases):
	(n, l) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	(s1, s2) = (1, 1)
	(i, j) = (0, n - 1)
	(cp1, cp2) = (0, l)
	time = 0
	while True:
		t1 = (a[i] - cp1) / s1
		t2 = (cp2 - a[j]) / s2
		if t1 > t2:
			time += t2
			cp1 += s1 * t2
			cp2 = a[j]
			s2 += 1
			j -= 1
		elif t1 == t2:
			time += t1
			cp1 = a[i]
			cp2 = a[j]
			i += 1
			j -= 1
			s1 += 1
			s2 += 1
		else:
			time += t1
			cp2 -= s2 * t1
			cp1 = a[i]
			s1 += 1
			i += 1
		if i > j:
			time += (cp2 - cp1) / (s1 + s2)
			break
	print(time)


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
int1 = lambda x: int(x) - 1
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))
ilelec = lambda : map(int1, input().split())
alelec = lambda : list(map(int1, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
for _ in range(int(input())):
	(n, l) = ilele()
	A = alele()
	B = A[::-1]
	A += [l]
	B += [0]

	def fun(m):
		t = 0
		temp = 0
		s = 1
		d1 = 0
		d2 = l
		u = 0
		f = 0
		for i in A:
			t1 = abs((i - temp) / s)
			temp = i
			if t1 + t <= m:
				t += t1
				d1 = i
				s += 1
			else:
				break
		left = m - t
		d1 += left * s
		temp = l
		s = 1
		d2 = l
		for i in B:
			t2 = abs((i - temp) / s)
			temp = i
			if t2 + u <= m:
				u += t2
				d2 = i
				s += 1
			else:
				break
		d2 = l - d2
		left = m - u
		d2 += left * s
		return d1 + d2 >= l
	left = 0
	right = l
	for i in range(80):
		mid = (left + right) / 2
		if fun(mid):
			right = mid
		else:
			left = mid
	print(right)


import os
import sys
from io import BytesIO, IOBase
import threading
from bisect import bisect_right, bisect_left
from math import gcd, log
from collections import defaultdict
from pprint import pprint
from math import ceil

def main():
	(n, l) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr.insert(0, 0)
	arr.append(l)
	pref = [(0, 0, 1)]
	prev = 0
	s = 1
	cnt = 1
	for i in range(1, len(arr)):
		cnt += 1
		pref.append((pref[-1][0] + (arr[i] - prev) / s, i, cnt))
		prev = arr[i]
		s += 1
	prev = l
	suf = [(0, len(arr) - 1, 1)]
	s = 1
	cnt = 1
	for i in range(len(arr) - 2, -1, -1):
		cnt += 1
		suf.append((suf[-1][0] + (prev - arr[i]) / s, i, cnt))
		prev = arr[i]
		s += 1
	t = l
	ans = -1
	l = 0
	r = t + 100
	ans = -1
	t = 0
	while r - l > 10 ** (-7):
		mid = l + (r - l) / 2
		i1 = bisect_left(pref, (mid, -1, -1))
		i1 -= 1
		pos1 = arr[pref[i1][1]] + pref[i1][2] * (mid - pref[i1][0])
		i2 = bisect_left(suf, (mid, -1, -1))
		i2 -= 1
		pos2 = arr[suf[i2][1]] - suf[i2][2] * (mid - suf[i2][0])
		if pos2 <= pos1:
			r = mid
			ans = mid
		else:
			l = mid
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	main()


import sys
from collections import deque
from copy import *
from bisect import *

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def string(s):
	return ''.join(s)

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def bo(i):
	return ord(i) - ord('A')

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j):
	return 0 <= i < n and 0 <= j < m and (a[i][j] != '.')

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()

def can(mid, n, l):
	at = bt = mid
	ap = 0
	bp = l
	for i in range(1, n + 1):
		if (a[i] - a[i - 1]) / i > at:
			flag = 1
			ap += at * i
			at = 0
			break
		ap = a[i]
		at -= (a[i] - a[i - 1]) / i
	ap += at * (n + 1)
	flag = 0
	b = a[::-1]
	for i in range(1, n + 1):
		if (-b[i] + b[i - 1]) / i > bt:
			bp -= bt * i
			bt = 0
			break
		bp = b[i]
		bt -= (-b[i] + b[i - 1]) / i
	bp -= bt * (n + 1)
	return ap >= bp
while t > 0:
	t -= 1
	(n, ll) = mi()
	a = li()
	a.insert(0, 0)
	a.append(ll)
	l = 0
	r = 10 ** 9 + 5
	ans = -1
	while r - l > 10 ** (-6):
		mid = (l + r) / 2
		if can(mid, n, ll):
			ans = mid
			r = mid
		else:
			l = mid
	print(ans)


import sys, math
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(inp()):
	(n, l) = inpl()
	A = inpl()
	B = [0]
	for x in A:
		B.append(x)
	B.append(l)
	a_ti = [0]
	b_ti = [0]
	sp = 1
	pre = 0
	for (i, x) in enumerate(A):
		a_ti.append(a_ti[-1] + (x - pre) / sp)
		pre = x
		sp += 1
	sp = 1
	pre = l
	for (i, x) in enumerate(A[::-1]):
		b_ti.append(b_ti[-1] + (pre - x) / sp)
		pre = x
		sp += 1
	a_ti.append(INF)
	b_ti.append(INF)
	b_ti = b_ti[::-1]
	for i in range(n + 2):
		if a_ti[i] > b_ti[i]:
			break
	sa = B[i] - B[i - 1]
	if a_ti[i - 1] < b_ti[i]:
		sa -= (b_ti[i] - a_ti[i - 1]) * i
		print(b_ti[i] + sa / (n + 2))
	else:
		sa -= (a_ti[i - 1] - b_ti[i]) * (n + 2 - i)
		print(a_ti[i - 1] + sa / (n + 2))


import math
import sys

class Graph:

	def __init__(self, Nodes, is_directed=False):
		self.nodes = Nodes
		self.adj_list = {}
		self.is_directed = is_directed
		for node in self.nodes:
			self.adj_list[node] = []

	def add_edge(self, u, v):
		self.adj_list[u].append(v)
		if self.is_directed == False:
			self.adj_list[v].append(u)

	def print_graph(self):
		for node in self.nodes:
			print(node, '->', self.adj_list[node])

	def degree_node(self, node):
		return len(self.adj_list[node])

	def dfsUTIL(self, v, visited, parents=[]):
		visited[v] = True
		for i in self.adj_list[v]:
			if visited[i] == False:
				self.dfsUTIL(i, visited, parents)
				parents.append(i)

	def dfs(self, v):
		visited = [False] * (max(self.adj_list) + 1)
		parents = [v]
		self.dfsUTIL(v, visited, parents)
		return len(parents)

def dict_sort(ans):
	ans = sorted(ans.items(), reverse=True, key=lambda kv: kv[1])

def is_prime(n):
	if n == 1:
		return 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def seive_primes(n):
	flag = [0] * (n + 10)
	flag[1] = flag[0] = 1
	i = 2
	while i * i <= n + 1:
		if flag[i] == 0:
			j = i * i
			while j <= n + 1:
				flag[j] = 1
				j += i
		i += 1
	return flag

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def alphabates():
	return 'abcdefghijklmnopqrstuvwxyz'

def binary_search(ls, n, flag):
	low = 0
	hi = n - 1
	while low <= hi:
		mid = (low + hi) // 2
		if ls[mid] == flag:
			return mid
		elif ls[mid] > flag:
			hi = mid - 1
		else:
			low = mid + 1
	return -1

def qdrt(x, a, b, c):
	return a * x * x + b * x + c

def inp():
	ls = list(map(int, input().split()))
	return ls

def mult_inp():
	return map(int, input().split())
t = int(input())
for _ in range(t):
	(n, l) = mult_inp()
	ls = [0] + inp()
	ls.append(l)
	n += 2
	time1 = [0] * n
	time2 = [0] * n
	speed = 1
	for i in range(1, n):
		time1[i] += time1[i - 1] + (ls[i] - ls[i - 1]) / speed
		speed += 1
	speed = 1
	for i in range(n - 2, -1, -1):
		time2[i] = time2[i + 1] + (ls[i + 1] - ls[i]) / speed
		speed += 1
	for i in range(n):
		if time1[i] > time2[i]:
			a = i - 1
			b = i
			break
	car1 = time1[a]
	car2 = time2[b]
	dist = ls[b] - ls[a]
	car1velocity = b
	car2velocity = n - b
	total_dist = car1 * car1velocity + car2 * car2velocity + dist
	print(total_dist / n)


t = int(input())
for _ in range(t):
	(n, l) = [int(x) for x in input().split()]
	a = list([int(x) for x in input().split()])
	k1 = [-1] * n
	nnn = list()
	for i in range(n):
		if i == 0:
			k1[i] = a[i]
			nnn.append(a[i] ** 12)
		else:
			k1[i] = k1[i - 1] + (a[i] - a[i - 1]) * 1.0 / (i + 1)
	k2 = [-1] * n
	for i in range(n - 1, -1, -1):
		if i == n - 1:
			k2[i] = l - a[n - 1]
		else:
			k2[i] = k2[i + 1] + (a[i + 1] - a[i]) * 1.0 / (n - i)
	nmmmm = k1[n - 1] + (l - a[n - 1]) * 1.0 / (n + 1)
	krr = nmmmm
	b = list()
	t1 = 0
	t2 = k2[0]
	nio = a[0]
	sp2 = n + 1
	sp1 = 1
	vv = 98
	t = (nio + t1 * sp1 + t2 * sp2) / (sp1 + sp2)
	krr = min(krr, t)
	for i in range(1, n):
		T1 = k1[i]
		T2 = k2[i]
		b.append(T1)
		if T1 == T2:
			krr = min(krr, T1)
		else:
			SP1 = i + 1
			SP2 = n - i + 1
			T1 = k1[i - 1]
			nio = a[i] - a[i - 1]
			nmmmm = (nio + T1 * SP1 + T2 * SP2) / (SP1 + SP2)
			if len(b) > 0:
				vv += 1
			krr = min(krr, nmmmm)
	t1 = k1[n - 1]
	t2 = 0
	nio = l - a[n - 1]
	sp2 = 1
	sp1 = n + 1
	t = (nio + t1 * sp1 + t2 * sp2) / (sp1 + sp2)
	krr = min(krr, t)
	t = t ** 12
	t += 1
	sp1 = 76
	print(krr)


from sys import *
from math import *
q = int(stdin.readline())
for _ in range(q):
	(n, l) = map(int, stdin.readline().split())
	a = list(map(int, stdin.readline().split()))
	s1 = s2 = 1
	d1 = 0
	d2 = l
	t = 0
	while 1:
		if len(a) == 0:
			d = d2 - d1
			t += d / (s1 + s2)
			break
		k1 = (a[0] - d1) / s1
		k2 = (d2 - a[-1]) / s2
		if k1 < k2:
			a.pop(0)
			d1 += k1 * s1
			d2 -= k1 * s2
			s1 += 1
			t += k1
		elif k1 > k2:
			a.pop(-1)
			d1 += k2 * s1
			d2 -= k2 * s2
			t += k2
			s2 += 1
		else:
			t += k1
			a.pop(0)
			if len(a) > 0:
				a.pop(-1)
			else:
				break
			d1 += s1 * k1
			d2 -= s2 * k2
			s1 += 1
			s2 += 1
	print(t)


t = int(input())
for i in range(t):
	(n, l) = map(int, input().split())
	ai = list(map(int, input().split()))
	f = 0
	s = l
	sp1 = 1
	sp2 = 1
	i = 0
	j = n - 1
	ans = 0
	while True:
		if j - i < 0:
			ans += (s - f) / (sp1 + sp2)
			break
		dist1 = ai[i] - f
		time1 = dist1 / sp1
		dist2 = s - ai[j]
		time2 = dist2 / sp2
		if time1 > time2:
			s = ai[j]
			j -= 1
			ans += time2
			sp2 += 1
			f += sp1 * time2
		elif time1 == time2:
			f = ai[i]
			i += 1
			sp1 += 1
			s = ai[j]
			j -= 1
			sp2 += 1
			ans += time2
		else:
			f = ai[i]
			i += 1
			ans += time1
			sp1 += 1
			s -= sp2 * time1
	print(ans)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		(n, l) = ria()
		a = ria()
		car1time = [0] * n
		car2time = [0] * n
		f1 = 0
		t1 = 0
		s1 = 1
		f2 = l
		t2 = 0
		s2 = 1
		for i in range(n):
			d1 = a[i] - f1
			f1 = a[i]
			t1 += d1 / s1
			s1 += 1
			car1time[i] = t1
			d2 = f2 - a[n - 1 - i]
			f2 = a[n - 1 - i]
			t2 += d2 / s2
			s2 += 1
			car2time[n - 1 - i] = t2
		d1 = l - a[n - 1]
		d2 = a[0] - 0
		t1 += d1 / s1
		t2 += d2 / s2
		car1time = [0] + car1time + [t1]
		car2time = [t2] + car2time + [0]
		ans = 0
		for i in range(n + 1):
			if car1time[i + 1] > car2time[i + 1]:
				break
			if car1time[i + 1] == car2time[i + 1]:
				ans = car1time[i + 1]
				break
		if ans:
			print(ans)
		else:
			a = [0] + a + [l]
			sA = i + 1
			sB = n - i + 1
			tA = car1time[i]
			tB = car2time[i + 1]
			A = a[i]
			B = a[i + 1]
			Time = (B - A + tA * sA + tB * sB) / (sA + sB)
			print(Time)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, l) = map(int, input().split())
	n += 2
	a = list(map(int, input().split()))
	a = [0] + a
	a.append(l)
	v1 = 1
	v2 = 1
	d1 = a[0]
	d2 = a[n - 1]
	i = 0
	j = n - 1
	ans = 0
	while i + 1 < j:
		nd1 = abs(a[i + 1] - d1)
		nd2 = abs(a[j - 1] - d2)
		t1 = nd1 / v1
		t2 = nd2 / v2
		if t1 < t2:
			d1 = a[i + 1]
			i += 1
			v1 += 1
			ad = v2 * t1
			d2 -= ad
			ans += t1
		elif t2 < t1:
			d2 = a[j - 1]
			j -= 1
			v2 += 1
			ad = v1 * t2
			d1 += ad
			ans += t2
		else:
			d1 = a[i + 1]
			d2 = a[j - 1]
			i += 1
			j -= 1
			v1 += 1
			v2 += 1
			ans += t1
	b = abs(d1 - d2) / (v1 + v2)
	ans += b
	print(ans)


for _ in range(int(input())):
	(n, l) = map(int, input().split())
	a = list(map(int, input().split()))
	csa = 1
	csb = 1
	ans = 0
	ta = 0
	tb = 0
	i = 0
	j = l
	i1 = 0
	j1 = n - 1
	while i1 <= j1:
		ta = (a[i1] - i) / csa
		tb = (j - a[j1]) / csb
		if ta < tb:
			i = a[i1]
			j = j - ta * csb
			csa += 1
			ans += ta
			i1 += 1
		elif tb < ta:
			j = a[j1]
			i = i + tb * csa
			csb += 1
			ans += tb
			j1 -= 1
		else:
			i = a[i1]
			j = a[j1]
			csa += 1
			csb += 1
			ans += ta
			i1 += 1
			j1 -= 1
	a = ans + (j - i) / (csa + csb)
	print('%.10f' % a)


import math
from itertools import tee
from heapq import merge
from typing import NamedTuple

class Car(NamedTuple):
	id: int
	position: int
	speed: int
	t: float
	next_flag_t: float

	def position_at(self, t):
		return self.position + self.speed * (t - self.t)

def car_progress(id, flags, position, speed, flag_speed_change):
	t = 0
	for flag_position in flags:
		distance = flag_position - position
		time_to_flag = distance / speed
		assert time_to_flag > 0
		yield Car(id, position, speed, t, t + time_to_flag)
		t += time_to_flag
		speed += flag_speed_change
		position = flag_position
	yield Car(id, position, speed, t, math.inf)

def solve(flags, length):
	p1 = car_progress(1, flags, 0, 1, 1)
	p2 = car_progress(2, reversed(flags), length, -1, -1)
	car_a = next(p1)
	car_b = next(p2)
	while True:
		t = max(car_a.t, car_b.t)
		distance = car_b.position_at(t) - car_a.position_at(t)
		assert distance >= 0
		meeting_time = t + distance / (car_a.speed - car_b.speed)
		if car_b.next_flag_t >= meeting_time <= car_a.next_flag_t:
			return meeting_time
		if car_a.next_flag_t <= car_b.next_flag_t:
			car_a = next(p1)
		else:
			car_b = next(p2)
	raise RuntimeError

def pairwise(iterable):
	(a, b) = tee(iterable)
	next(b, None)
	return zip(a, b)
t = int(input())
for _ in range(t):
	(n, length) = map(int, input().split())
	flags = list(map(int, input().split()))
	print(solve(flags, length))


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=300006, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] > k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater

class TrieNode:

	def __init__(self):
		self.children = [None] * 26
		self.isEndOfWord = False

class Trie:

	def __init__(self):
		self.root = self.getNode()

	def getNode(self):
		return TrieNode()

	def _charToIndex(self, ch):
		return ord(ch) - ord('a')

	def insert(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				pCrawl.children[index] = self.getNode()
			pCrawl = pCrawl.children[index]
		pCrawl.isEndOfWord = True

	def search(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				return False
			pCrawl = pCrawl.children[index]
		return pCrawl != None and pCrawl.isEndOfWord

class Node:

	def __init__(self, data):
		self.data = data
		self.count = 0
		self.left = None
		self.right = None

class BinaryTrie:

	def __init__(self):
		self.root = Node(0)

	def insert(self, pre_xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = pre_xor & 1 << i
			if val:
				if not self.temp.right:
					self.temp.right = Node(0)
				self.temp = self.temp.right
				self.temp.count += 1
			if not val:
				if not self.temp.left:
					self.temp.left = Node(0)
				self.temp = self.temp.left
				self.temp.count += 1
		self.temp.data = pre_xor

	def query(self, xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = xor & 1 << i
			if not val:
				if self.temp.left and self.temp.left.count > 0:
					self.temp = self.temp.left
				elif self.temp.right:
					self.temp = self.temp.right
			elif self.temp.right and self.temp.right.count > 0:
				self.temp = self.temp.right
			elif self.temp.left:
				self.temp = self.temp.left
			self.temp.count -= 1
		return xor ^ self.temp.data
for ik in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	t = [[0 for i in range(3)] for j in range(n + 2)]
	t1 = [[0 for i in range(3)] for j in range(n + 2)]
	last = 0
	sp = 1
	t[0] = [0, 1, 0]
	for i in range(1, n + 1):
		t[i][0] = t[i - 1][0] + (l[i - 1] - last) / sp
		t[i][1] = sp + 1
		sp += 1
		t[i][2] = l[i - 1]
		last = l[i - 1]
	t[n + 1] = [0, 1, k]
	last = k
	sp1 = 1
	t1[0] = [0, 1, 0]
	for i in range(n, 0, -1):
		t1[i][0] = t1[i + 1][0] + (last - l[i - 1]) / sp1
		t1[i][1] = sp1 + 1
		sp1 += 1
		t1[i][2] = l[i - 1]
		last = l[i - 1]
	t1[n + 1] = [0, 1, k]
	for i in range(n + 1):
		ti = t[i][0]
		sp = t[i][1]
		z = t[i][2]
		ti1 = t1[i + 1][0]
		sp1 = t1[i + 1][1]
		y = t1[i + 1][2]
		x = (sp * y + sp1 * z + sp1 * sp * (ti1 - ti)) / (sp1 + sp)
		if z <= x <= y:
			print(ti + (x - z) / sp)
			break


for _ in range(int(input())):
	(n, d) = map(int, input().split(' '))
	a = [int(item) for item in input().split(' ')]
	ans = 0
	(s1, s2) = (1, 1)
	(x, y) = (0, d)
	(l, r) = (0, n - 1)
	while l <= r:
		t1 = (a[l] - x) / s1
		t2 = (y - a[r]) / s2
		if t1 == t2:
			s1 += 1
			s2 += 1
			x = a[l]
			y = a[r]
			l += 1
			r -= 1
			ans += t1
		elif t1 < t2:
			s1 += 1
			x = a[l]
			y = y - t1 * s2
			l += 1
			ans += t1
		else:
			s2 += 1
			y = a[r]
			x = x + t2 * s1
			r -= 1
			ans += t2
	ans += (y - x) / (s1 + s2)
	print(ans)


t = int(input())

def bs(k, l, n):
	i = 0
	j = l
	while j - i > 10 ** (-6):
		mid = (j + i) / 2
		x = 0
		y = 0
		speed = 1
		for b in range(n):
			if b == 0:
				if k[b] >= mid:
					x += mid / speed
					break
				else:
					x += k[b] / speed
					speed += 1
			elif k[b] >= mid:
				x += (mid - k[b - 1]) / speed
				break
			else:
				x += (k[b] - k[b - 1]) / speed
				speed += 1
		if k[-1] < mid:
			x += (mid - k[-1]) / speed
		speed = 1
		for b in range(n - 1, -1, -1):
			if b == n - 1:
				if k[b] <= mid:
					y += (l - mid) / speed
					break
				else:
					y += (l - k[b]) / speed
					speed += 1
			elif k[b] <= mid:
				y += (k[b + 1] - mid) / speed
				break
			else:
				y += (k[b + 1] - k[b]) / speed
				speed += 1
		if k[0] > mid:
			y += (k[0] - mid) / speed
		if x >= y:
			j = mid
		else:
			i = mid
	return j
for _ in range(t):
	(n, l) = map(int, input().split())
	k = list(map(int, input().split()))
	mid = bs(k, l, n)
	speed = 1
	x = 0
	for b in range(n):
		if b == 0:
			if k[b] >= mid:
				x += mid / speed
				break
			else:
				x += k[b] / speed
				speed += 1
		elif k[b] >= mid:
			x += (mid - k[b - 1]) / speed
			break
		else:
			x += (k[b] - k[b - 1]) / speed
			speed += 1
	if k[-1] < mid:
		x += (mid - k[-1]) / speed
	print(x)