Sherlock is given $2$ square tiles, initially both of whose sides have length $\boldsymbol{l}$ placed in an $x-y$ plane.  Initially, the bottom left corners of each square are at the origin and their sides are parallel to the axes.  

At $t=0$, both squares start moving along line $y=x$ (along the positive $\boldsymbol{x}$ and $y$) with velocities $\mbox{s1}$ and $\mbox{s2}$.     

For each querydetermine the time at which the overlapping area of tiles is equal to the query value, $\textit{queries}[i]$.  

Note: Assume all distances are in meters, time in seconds and velocities in meters per second.  

Function Description  

Complete the movingTiles function in the editor below.  

movingTiles has the following parameter(s):  

int l: side length for the two squares  
int s1: velocity of square 1
int s2: velocity of square 2
int queries[q]: the array of queries  

Returns  

int[n]: an array of answers to the queries, in order. Each answer will be considered correct if it is at most $\textbf{0.0001}$ away from the true answer.

Input Format 

First line contains integers $l,s1,s2$. 

The next line contains $\textit{q}$, the number of queries. 

Each of the next $\textit{q}$ lines consists of one integer $\textit{queries}[i]$ in one line.

Constraints 

$1\leq l,s1,s2\leq10^9$ 

$1\leq q\leq10^5$ 

$1\leq\textit{queries}[i]\leq L^2$ 

$s1\neq s2$  

Sample Input  

10 1 2
2
50
100

Sample Output  

4.1421
0.0000

Explanation  

For the first case, note that the answer is around 4.1421356237..., so any of the following will be accepted:  

4.1421356237
4.14214
4.14215000
4.1421
4.1422

Source: hackerrank | Difficulty: EASY
Tags: Mathematics


Solutions:
from math import *
x = input().split()
l = int(x[0])
s1 = int(x[1])
s2 = int(x[2])
Q = int(input())
for i in range(0, Q):
	x = int(input())
	v = abs(sqrt(2) * (l - sqrt(x)) / (s2 - s1))
	print('%.5f' % v)


import math
(l, s1, s2) = map(int, input().split())
q = int(input())
l = l * math.sqrt(2)
for i in range(q):
	x = math.sqrt(int(input())) * math.sqrt(2)
	print((l - x) / abs(s2 - s1))


(l, s1, s2) = map(int, input().split())
s = abs(s2 - s1) / 2 ** 0.5
for _ in range(int(input())):
	q = int(input()) ** 0.5
	print((l - q) / s)


import math
S2 = math.sqrt(2)
(a, v1, v2) = map(int, input().split())
leave = a * S2 / abs(v1 - v2)
qs = int(input())
for _ in range(qs):
	area = int(input())
	side = math.sqrt(area)
	frac = (a - side) / a
	print('{:.4f}'.format(frac * leave))


import sys
from math import sqrt
from decimal import *

def solve():
	stdin = sys.stdin
	(L, S1, S2) = map(int, stdin.readline().split())
	Q = int(stdin.readline())
	sqrt2 = Decimal(2).sqrt()
	DS = abs(S2 - S1)
	for _ in range(Q):
		sq = int(stdin.readline())
		dif = Decimal(sq).sqrt()
		dif = L - dif
		dif *= sqrt2
		print('%.10f' % (dif / DS))
solve()


def main():
	(L, S1, S2) = [float(f) for f in input().split()]
	nquery = int(input())
	for _ in range(nquery):
		q = float(input())
		print(2 ** 0.5 * (L - q ** 0.5) / abs(S1 - S2))
main()


from math import sqrt
(ell, s1, s2) = list(map(int, input().split()))
n_query = int(input())
for k in range(n_query):
	a0 = int(input())
	print(sqrt(2) * (ell - sqrt(a0)) / abs(s2 - s1))


from math import sqrt
(l, v, u) = (float(x) for x in input().split())
v = abs(v - u) / sqrt(2)
q = int(input())
for _ in range(q):
	s = float(input())
	d = sqrt(s)
	print((l - d) / v)


(l, s1, s2) = [int(i) for i in input().split()]
q = int(input())
for i in range(q):
	a = int(input())
	print(format((l - pow(a, 0.5)) * pow(2, 0.5) / abs(s1 - s2), '.4f'))


from math import sqrt

def main():
	(l, s1, s2) = map(int, input().split())
	Q = int(input())
	for i in range(Q):
		q = int(input())
		diagonalLength = sqrt(2 * q)
		distBetweenTiles = l * sqrt(2) - diagonalLength
		time = distBetweenTiles / abs(s1 - s2)
		print(time)
main()


from math import sqrt

def tquery(L, s1, s2, A):
	return (L * sqrt(2) - sqrt(2 * A)) / abs(s1 - s2)
(L, s1, s2) = map(int, input().split())
num_cases = int(input())
for case in range(num_cases):
	print(tquery(L, s1, s2, int(input())))


(l, s, d) = map(int, input().split())
for i in range(int(input())):
	a = int(input())
	ans = (l - a ** 0.5) / abs(s - d) * 2 ** 0.5
	print('%.4f' % ans)


import math
c = []
S = 0
b = []
q = 0
a = ''
a = input()
b.append(a.split(' '))
q = int(input())
for i in range(q):
	c.append(int(input()))
for j in range(q):
	S = math.fabs(int(b[0][2]) - int(b[0][1]))
	if c[j] == int(b[0][0]) ** 2:
		print('0')
	else:
		print((int(b[0][0]) * math.sqrt(2) - math.sqrt(2) * math.sqrt(c[j])) / S)


from math import sqrt
(l, s1, s2) = map(int, input().split())
for t in range(int(input())):
	area = int(input())
	print((sqrt(2) * l - sqrt(2 * area)) / abs(s1 - s2))


from math import sqrt
(L, s1, s2) = map(int, input().split())
n = int(input())
sqrt2 = sqrt(2)
for _ in range(n):
	q = int(input())
	result = sqrt2 / abs(s1 - s2) * (L - sqrt(q))
	print('{:.4f}'.format(result))


import sys
(L, S1, S2) = list(map(int, sys.stdin.readline().split()))
Q = int(sys.stdin.readline())
for _ in range(Q):
	q = int(sys.stdin.readline())
	print('%.4f' % (2 ** 0.5 * (L - q ** 0.5) / abs(S1 - S2)))


from math import sqrt
s = input().split()
(l, s1, s2) = (int(s[0]), int(s[1]), int(s[2]))
q = int(input())
while q:
	i = int(input())
	a = (2 * l * l) ** (1 / 2) - (2 * i) ** (1 / 2)
	c = a / abs(s1 - s2)
	print('%.4f' % c)
	q -= 1


from math import sqrt
(l, s1, s2) = [int(i) for i in input().split()]
s = abs(s1 - s2)
for i in range(int(input())):
	q = int(input())
	t = (l - sqrt(q)) / s * sqrt(2)
	print(t)


from math import sqrt
i = input().split()
L = int(i[0])
S1 = int(i[1])
S2 = int(i[2])
q = int(input())

def solve(s1, s2, l, q):
	maxDistance = sqrt(2 * l ** 2)
	s = sqrt(2 * q)
	return abs((maxDistance - s) / (s1 - s2))
[print('%.4f' % solve(S1, S2, L, int(input()))) for x in range(q)]


(L, S1, S2) = map(int, input().split())
for Q in range(int(input())):
	print(abs((int(input()) ** 0.5 - L) * 2.0 ** 0.5 / (S1 - S2)))


[l, s1, s2] = map(int, input().split())
q = int(input())
for i in range(q):
	result = 2 ** 0.5 * (l - int(input()) ** 0.5) / abs(s1 - s2)
	print(result)


from math import sqrt
(L, s1, s2) = [int(x) for x in input().split()]
sdiff = abs(s2 - s1)
r2 = 2 / sqrt(2)
queries = int(input())
for _ in range(queries):
	area = int(input())
	t = r2 * (L - sqrt(area)) / sdiff
	print('{:.4f}'.format(t))


nos = [int(n) for n in input().split()]
speed = nos[2] - nos[1]
if speed < 0:
	speed = speed * -1
q = int(input())
while q:
	qt = int(input())
	pt = float(qt ** 0.5)
	res = float((nos[0] - pt) * 2 ** 0.5) / float(speed)
	print(res)
	q = q - 1


import sys, math

def main():
	(L, S1, S2) = map(lambda x: int(x), sys.stdin.readline().split())
	Q = int(sys.stdin.readline())
	for i in range(0, Q):
		query = int(sys.stdin.readline())
		print((L - math.sqrt(query)) * math.sqrt(2) / abs(S2 - S1))
main()


import sys, math
(L, s1, s2) = map(float, sys.stdin.readline().split())
S = abs(s1 - s2)
cases = int(input())
root2 = math.sqrt(2)
for case in range(cases):
	yy = float(input())
	t = root2 * (L - math.sqrt(yy)) / S
	print(t)


import math
(L, S1, S2) = (float(x) for x in input().split())
Q = int(input())
rel = abs(S1 - S2)
Diagonal_length = math.sqrt(2 * L * L)
for _ in range(Q):
	q = int(input())
	Daigonal_diffrence = math.sqrt(2 * q)
	print('{:.20f}'.format((Diagonal_length - Daigonal_diffrence) / rel))


import math
(L, S1, S2) = input().split()
Q = input()
L = float(L)
S1 = float(S1)
S2 = float(S2)
Q = int(Q)
for i in range(Q):
	q = input()
	q = float(q)
	print(abs(math.sqrt(2) * (math.sqrt(q) - L) / (S1 - S2)))


import math
(l, s1, s2) = [int(i) for i in input().split()]
for _ in range(int(input())):
	Q = int(input())
	val = (l * math.sqrt(2) - math.sqrt(2 * Q)) / abs(s1 - s2)
	print('%.4f' % val)


(l, s1, s2) = [int(i) for i in input().split()]
q = int(input())
s = abs(s1 - s2)
for i in range(q):
	temp = int(input())
	res = (l - pow(temp, 0.5)) * pow(2, 0.5) / s
	print(format(res, '.4f'))


y = input()
x = y.split(' ')
l = int(x[0])
v1 = int(x[1])
v2 = int(x[2])
Q = int(input())
p = v1 - v2
if p < 0:
	p = p * -1
t = 2 ** 0.5
while Q > 0:
	q = float(input())
	q = q ** 0.5
	q = l - q
	r = q * t / p
	print(r)
	Q = Q - 1


from math import sqrt
(L, S1, S2) = [int(i) for i in input().split()]
Q = int(input())
queries = [int(input()) for _ in range(Q)]
(S1, S2) = (min(S1, S2), max(S1, S2))
for q in queries:
	print(sqrt(2) * (L - sqrt(q)) / (S2 - S1))


from math import sqrt
root_2 = sqrt(2)

def f(l, s1, s2, a):
	return root_2 * (sqrt(a) - l) / (s1 - s2)
(l, s1, s2) = [int(v) for v in input().split()]
q = int(input())
if s1 > s2:
	(s1, s2) = (s2, s1)
for _ in range(q):
	a = int(input())
	print(f(l, s1, s2, a))


from math import sqrt
(L, s1, s2) = [int(ns) for ns in str(input()).split()]
Q = int(input())
d = 2 * sqrt(L ** 2 / 2)
s = -abs(s1 - s2)
for _ in range(Q):
	q = int(input())
	t = (sqrt(2 * q) - d) / s
	if t > 0:
		print(t)
	else:
		print(0)


import sys
(L, S1, S2) = list(map(int, sys.stdin.readline().split()))
Q = int(sys.stdin.readline())
for _ in range(Q):
	q = int(sys.stdin.readline())
	print('%.4f' % (2 ** 0.5 * (L - q ** 0.5) / abs(S1 - S2)))


(length, v1, v2) = list(map(int, input('').split(' ')))
n = int(input())

def timeAtArea(q):
	return abs(2 ** 0.5 * (length - q ** 0.5) / (v2 - v1))
for i in range(n):
	q = float(input(''))
	print(timeAtArea(q))


(L, S1, S2) = [int(x) for x in input().split()]
vel_diff = abs(S1 - S2)
diag = 2 ** 0.5 * L
for _ in range(int(input())):
	q = int(input())
	q_diag = (2 * q) ** 0.5
	res = (diag - q_diag) / vel_diff
	print(res)


import math
(L, S1, S2) = map(int, input().split())
for i in range(eval(input())):
	q = int(input())
	print('{0:.4f}'.format(float((L - math.sqrt(q)) * math.sqrt(2)) / float(abs(S1 - S2))))


import sys
(L, S1, S2) = list(map(int, sys.stdin.readline().split()))
Q = int(sys.stdin.readline())
for _ in range(Q):
	q = int(sys.stdin.readline())
	print('%.4f' % (2 ** 0.5 * (L - q ** 0.5) / abs(S1 - S2)))


from math import sqrt
(L, S1, S2) = (int(x) for x in input().split())
Relative_Speed = abs(S2 - S1)
for _ in range(int(input())):
	q = int(input())
	distance = sqrt(2 * (L - sqrt(q)) ** 2)
	time = distance / Relative_Speed
	print('{:.20f}'.format(time))


import sys
(L, S1, S2) = list(map(int, sys.stdin.readline().split()))
Q = int(sys.stdin.readline())
for _ in range(Q):
	q = int(sys.stdin.readline())
	print('%.4f' % (2 ** 0.5 * (L - q ** 0.5) / abs(S1 - S2)))


import math
inlist = input().split()
l = int(inlist[0])
s1 = int(inlist[1])
s2 = int(inlist[2])
ds = abs(s2 - s1)
q = int(input())
for i in range(q):
	qi = int(input())
	t = math.sqrt(2) / ds * (l - math.sqrt(qi))
	print(t)


def solve(L, S1, S2, Qs):
	s = abs(S1 - S2)
	for q in Qs:
		print((L - q ** 0.5) * 2 ** 0.5 / s)
(L, S1, S2) = (int(_) for _ in input().split())
Q = int(input())
Qs = list((int(input()) for _ in range(Q)))
solve(L, S1, S2, Qs)


import math

def find_time(l, s1, s2, q):
	a = math.sqrt(2) * math.fabs(math.sqrt(q) - l) / math.fabs(s1 - s2)
	return a
s_in = input()
s = s_in.split()
L = int(s[0])
S1 = int(s[1])
S2 = int(s[2])
n = int(input())
for i in range(0, n):
	q_i = int(input())
	print(find_time(L, S1, S2, q_i))


import math
import decimal
arr = input().split()
L = decimal.Decimal(arr[0])
S1 = decimal.Decimal(arr[1])
S2 = decimal.Decimal(arr[2])
x = (min(S1, S2) - max(S1, S2)) / decimal.Decimal(math.sqrt(2))
Q = int(input())
while Q != 0:
	q = decimal.Decimal(input())
	d = decimal.Decimal(math.sqrt(q))
	t = (d - L) / x
	print(t)
	Q = Q - 1


import math

def main():
	(l, s1, s2) = map(int, input().split())
	n = int(input())
	r2 = math.sqrt(2)
	for i in range(n):
		q = int(input())
		print(r2 * (l - math.sqrt(q)) / abs(s2 - s1))
main()


import math
(L, S1, S2) = [int(x) for x in input().split()]
num_queries = int(input())
for _ in range(num_queries):
	qi = int(input())
	t = (L * math.sqrt(2) - math.sqrt(2 * qi)) / math.fabs(S1 - S2)
	print(t)


(l, s1, s2) = (int(i) for i in input().split())
v = abs(s1 - s2)
for q in range(int(input())):
	a = int(input())
	print((l - a ** 0.5) / (v / 2 ** 0.5))


import math
(L, s1, s2) = [int(i) for i in input().split(' ')]
q = int(input())
L2 = L * math.sqrt(2)
for k in range(q):
	a = math.sqrt(2 * float(input()))
	if a > L2:
		print(0)
	else:
		print((L2 - a) / abs(s1 - s2))


from math import sqrt

def foo(q_i, L, s_a, s_b):
	A = sqrt(2) * sqrt(q_i)
	X = sqrt(2) * L
	D = abs(s_a - s_b)
	return (X - A) / D
(L, s_a, s_b) = [int(x) for x in input().strip().split()]
for q in range(int(input().strip())):
	q_i = int(input().strip())
	print('%0.4f' % foo(q_i, L, s_a, s_b))


from math import *
x = input().split()
l = int(x[0])
s1 = int(x[1])
s2 = int(x[2])
Q = int(input())
for i in range(0, Q):
	x = int(input())
	v = abs(sqrt(2) * (l - sqrt(x)) / (s2 - s1))
	print('%.5f' % v)


def quadratic(a, b, c):
	d = b ** 2 - 4 * a * c
	s1 = (-b + d ** 0.5) / (2 * a)
	s2 = (-b - d ** 0.5) / (2 * a)
	return min(s1, s2)
(L, s1, s2) = input().split()
(L, s1, s2) = (int(L), int(s1), int(s2))
t = int(input())
a = (s2 - s1) ** 2 / 2
b = -2 ** 0.5 * L * abs(s2 - s1)
for _ in range(t):
	c1 = int(input())
	c = L ** 2 - c1
	print(quadratic(a, b, c))


(l, s1, s2) = map(int, input().split())
q = int(input())
for query in range(q):
	a = int(input())
	print((l - a ** (1 / 2)) / abs(s2 - s1) * 2 ** 0.5)


(l, a, b) = [int(x) for x in input().split()]
v = abs(a - b)
n = int(input())
for _ in range(n):
	q = int(input())
	print((l - q ** 0.5) / (v / 2 ** 0.5))


import math
L_S1_S2 = list(input().split())
L = int(L_S1_S2[0])
S1 = int(L_S1_S2[1])
S2 = int(L_S1_S2[2])
test_case = int(input())
time1 = []
query = []
for index in range(test_case):
	query.append(int(input()))
for index in range(test_case):
	time1.append(1.4142135623730951 / abs(S1 - S2) * (L - math.sqrt(query[index])))
for index in range(test_case):
	print(time1[index])


import math
(l, s1, s2) = list(map(int, input().split()))
n = int(input())
for i in range(n):
	q = int(input())
	print(math.sqrt(2) * (l - math.sqrt(q)) / abs(s1 - s2))


import math

def findTime(s1, s2, L, qi):
	if s1 > s2:
		return findTime(s2, s1, L, qi)
	else:
		t = math.sqrt(2) * (L - math.sqrt(qi))
		t /= s2 - s1
		return t

def main():
	(L, s1, s2) = list(map(int, input().split()))
	Q = int(input())
	for _ in range(Q):
		qi = int(input())
		print(findTime(s1, s2, L, qi))
main()


from math import sqrt, fabs
l = list(input().split())
L = int(l[0])
s = fabs(int(l[1]) - int(l[2]))
n = int(input())
for i in range(n):
	qi = int(input())
	res = (L - sqrt(qi)) * sqrt(2) / s
	print(res)


from math import *
x = input().split()
l = int(x[0])
s1 = int(x[1])
s2 = int(x[2])
Q = int(input())
for i in range(0, Q):
	x = int(input())
	v = abs(sqrt(2) * (l - sqrt(x)) / (s2 - s1))
	print('%.5f' % v)


from math import sqrt
lss = input().split()
qs = int(input())
for q in range(0, qs):
	space = int(input())
	time = sqrt(2) * (int(lss[0]) - sqrt(space)) / abs(int(lss[1]) - int(lss[2]))
	print(time)


import sys
(L, S1, S2) = list(map(int, sys.stdin.readline().split()))
Q = int(sys.stdin.readline())
for _ in range(Q):
	q = int(sys.stdin.readline())
	print('%.4f' % (2 ** 0.5 * (L - q ** 0.5) / abs(S1 - S2)))


import math

def func_builder(L, S1, S2):

	def func(A):
		if A < 0 or L ** 2 < A:
			time = None
		else:
			time = math.sqrt(2) * (L - math.sqrt(A)) / abs(S2 - S1)
		return time
	return func
args = tuple([int(c) for c in input().split()])
f = func_builder(*args)
for __ in range(int(input())):
	print(f(int(input())))


(L, S1, S2) = map(int, input().split())
Q = int(input())
import math
for q in range(Q):
	goal = int(input())
	print((L - math.sqrt(goal)) * math.sqrt(2) / abs(S2 - S1))


import math
(L, S1, S2) = input().split()
(L, S1, S2, Q) = (int(L), int(S1), int(S2), int(input()))
diff = math.fabs(S1 - S2)
for i in range(Q):
	print((L * 2 ** 0.5 - int(input()) ** 0.5 * 2 ** 0.5) / diff)


import math
(l, s1, s2) = [int(i) for i in input().split()]
for _ in range(int(input())):
	Q = int(input())
	val = (l * math.sqrt(2) - math.sqrt(2 * Q)) / abs(s1 - s2)
	print('%.4f' % val)


from math import cos, pi, sqrt
(l, s1, s2) = input().split()
(l, s1, s2) = (int(l), int(s1), int(s2))
s = (abs(s1 - s2) + 0.0) * cos(pi / 4)
l = float(l)
Q = int(input())
while Q:
	Q = Q - 1
	q = float(input())
	q = sqrt(q)
	q = l - q
	print(q / s)


(L, S1, S2) = input().split()
Q = int(input())
q = []
for i in range(Q):
	q.append(int(input()))
import math
for i in q:
	print((math.sqrt(2 * int(L) * int(L)) - math.sqrt(2 * i)) / abs(int(S1) - int(S2)))


(l, s1, s2) = (int(elem) for elem in input().split(' '))
q = ()
from math import sqrt
for k in range(int(input())):
	q = int(input())
	print((sqrt(2) * l - sqrt(2 * q)) / abs(s1 - s2))


import math as m
(L, S1, S2) = input().split()
L = int(L)
S1 = int(S1)
S2 = int(S2)
n = int(input())
for i in range(0, n):
	area = int(input())
	if S1 > S2:
		(S1, S2) = (S2, S1)
	t = (m.sqrt(2 * area) - L * m.sqrt(2)) / (S1 - S2)
	print(t)


import math
s = [int(i) for i in input().split()]
t1 = max(s[1], s[2])
t2 = min(s[1], s[2])
l = s[0]
q = int(input())
while q > 0:
	n = int(input())
	ans = max(math.pow(2, 0.5) * (math.pow(n, 0.5) - l) / (t1 - t2), math.pow(2, 0.5) * (l - math.pow(n, 0.5)) / (t1 - t2))
	print(ans)
	q = q - 1


import math
pb = [int(i) for i in input().split()]
T = pb[0]
s1 = pb[1]
s2 = pb[2]
big_len = math.sqrt(T * T + T * T)
maxi = max(s1, s2)
mini = min(s1, s2)
N = int(input())
for x in range(N):
	area = int(input())
	dim = math.sqrt(area)
	ltl_len = math.sqrt(dim * dim + dim * dim)
	print((big_len - ltl_len) / (maxi - mini))


import math
root = math.sqrt(2)
(l, s1, s2) = [int(i) for i in input().split()]
d = l * root
q = int(input())
for i in range(q):
	area = int(input())
	t = d / abs(s1 - s2)
	side = math.sqrt(area)
	len = (l - side) / l
	print(t * len)


import sys
l = input()
l = l.split(' ')
n = int(input())
q = []
for i in range(n):
	q.append(int(input()))
for i in q:
	print(2 ** 0.5 * (i ** 0.5 - int(l[0])) / (max(int(l[1]), int(l[2])) - min(int(l[1]), int(l[2]))) * -1)


import math

def get_time_instance(L, s1, s2, q):
	return (L * math.sqrt(2) - math.sqrt(2 * q)) / (s2 - s1)
line = input().split()
L = int(line[0])
s1 = int(line[1])
s2 = int(line[2])
Q = int(input())
if s2 < s1:
	temp = s2
	s2 = s1
	s1 = temp
for each in range(Q):
	q = int(input())
	print(get_time_instance(L, s1, s2, q))


import math
(l, s1, s2) = map(int, input().split())
diff = abs(s1 - s2)
for _ in range(int(input())):
	q = int(input())
	print((l * math.sqrt(2) - math.sqrt(q * 2)) / diff)


from math import sqrt
(L, s1, s2) = tuple([int(num) for num in input().split(' ')])
srel = abs(s1 - s2)
Q = int(input())
for i in range(Q):
	qi = int(input())
	t = (sqrt(2) * L - sqrt(2) * sqrt(qi)) / srel
	print(t)


inp = input()
inp = inp.split()
L = int(inp[0])
Greater = 0
Smaller = 0
if int(inp[1]) > int(inp[2]):
	greater = int(inp[1])
	smaller = int(inp[2])
else:
	greater = int(inp[2])
	smaller = int(inp[1])
cases = int(input())
for i in range(cases):
	t = None
	q = int(input())
	t = (2 * (L - q ** 0.5) ** 2) ** 0.5 / (greater - smaller)
	print(str(t))


[L, S1, S2] = list(map(int, input().strip().split()))
diff = abs(S1 - S2) * 1.0 / 2 ** 0.5
Q = int(input().strip())
for _ in range(Q):
	print('%.4f' % ((L - float(input()) ** 0.5) / diff))


import math
(l, s1, s2) = map(int, input().split())
diff = abs(s1 - s2) / math.sqrt(2)
Q = int(input())
for _ in range(Q):
	q = l - math.sqrt(int(input()))
	print('%.20f' % (q / diff))


import math
blah = input()
blah = blah.split()
L = int(blah[0])
L2 = L * L
S1 = int(blah[1])
S2 = int(blah[2])
Q = int(input())
qs = []
for x in range(Q):
	qs.append(int(input()))

def sherlock(x):
	if x > L2:
		return 0
	x = abs(x)
	d = math.sqrt(x + x)
	d = math.sqrt(L2 + L2) - d
	a = S2 - S1
	t = abs(d / a)
	return t
for q in qs:
	print(sherlock(q))


(l, s1, s2) = map(int, input().split())
for i in range(int(input())):
	print((2 * (l - float(input()) ** 0.5) ** 2) ** 0.5 / abs(s2 - s1))


import math
t = input()
(a, b, c) = t.split(' ')
(a, b, c) = (int(a), int(b), int(c))
q = input()
q = int(q)
for i in range(q):
	ploscina = input()
	ploscina = int(ploscina)
	print(math.sqrt(2) * (a - math.sqrt(ploscina)) / abs(c - b))


(L, S1, S2) = map(int, input().split(' '))
Q = int(input())
q = []
for i in range(Q):
	q.append(int(input()))
for i in range(Q):
	ans = (q[i] ** 0.5 - L) * 2 ** 0.5 / (S1 - S2)
	print(abs(ans))


import math as m
(l, s1, s2) = input().split(' ')
l = int(l)
s1 = int(s1)
s2 = int(s2)
t = int(input())
for i in range(0, t):
	q = int(input())
	if s2 > s1:
		v = (s2 - s1) / m.sqrt(2)
	else:
		v = (s1 - s2) / m.sqrt(2)
	t = (l - m.sqrt(q)) / v
	print(t)


from math import sqrt
(L, S1, S2) = (int(i) for i in input().split())
v = abs(S1 - S2) / sqrt(2)
n = int(input())
for i in range(n):
	q = int(input())
	if q <= L ** 2:
		ans = abs((sqrt(q) - L) / v)
		print('{0:0.4f}'.format(ans))
	else:
		print('never')


import math
(L, S1, S2) = map(int, input().split(' '))
Q = int(input())
for i in range(0, Q):
	q = int(input())
	S = abs(S2 - S1)
	t = math.sqrt(2) * (L - math.sqrt(q)) / S
	print(t)


from math import sqrt
(L, S1, S2) = [int(x) for x in input().split()]
Q = int(input())
for i in range(0, Q):
	q = int(input())
	diag = sqrt(2 * q)
	if S1 < S2:
		print((sqrt(2 * q) - sqrt(2 * L ** 2)) / (S1 - S2))
	else:
		print((sqrt(2 * q) - sqrt(2 * L ** 2)) / (S2 - S1))


import math

def main():
	line = input().split()
	l = int(line[0])
	s1 = int(line[1])
	s2 = int(line[2])
	q = int(input())
	if s1 < s2:
		(s1, s2) = (s2, s1)
	for i in range(q):
		d = int(input())
		if d == l ** 2:
			t = 0
		else:
			t = (d ** 0.5 - l) / ((s2 - s1) * math.cos(math.pi / 4))
		print('%.4f' % t)
main()


import math
(l, s1, s2) = [int(n) for n in input().strip().split()]
k = s1 + s2
q = int(input())
for i in range(q):
	qi = int(input())
	x = l - math.sqrt(qi)
	x = math.sqrt(2) * x
	if s1 > s2:
		ans = x / (s1 - s2)
	else:
		ans = x / (s2 - s1)
	print(ans)


from math import sqrt
(L, s1, s2) = tuple(map(int, input().split()))
t = int(input())
for case in range(t):
	q = int(input())
	print(sqrt(2) * (L - sqrt(q)) / abs(s1 - s2))


from math import sqrt
DEBUG = False
try:
	inputParams = [0 for x in range(3)]
	inputParams = list(map(int, input().split()))
	length = inputParams[0]
	velocity1 = inputParams[1]
	velocity2 = inputParams[2]
	testCases = int(input())
	queries = [0 for x in range(testCases)]
	i = 0
	while i < testCases:
		queries[i] = int(input())
		i += 1
	i = 0
	while i < testCases:
		if velocity2 > velocity1:
			time = sqrt(2) * (length - sqrt(queries[i])) / (velocity2 - velocity1)
		else:
			time = sqrt(2) * (length - sqrt(queries[i])) / (velocity1 - velocity2)
		print(time)
		i += 1
except ValueError:
	print("Input isn't a number")


I = input().split()
L = int(I[0])
S1 = int(I[1])
S2 = int(I[2])
Q = int(input())
v = abs(S2 - S1)
while Q != 0:
	q = int(input())
	Q -= 1
	d = L * 2 ** 0.5 - q ** 0.5 * 2 ** 0.5
	print(d / v)


m = input().split()
n = int(input())

def sq(l, s1, s2, q):
	d = l ** 2
	p1 = 0
	p2 = l * 2 ** 0.5
	s = 0
	if s1 > s2:
		s = s1 - s2
	else:
		s = s2 - s1
	s = s * 0.5 * 2 ** 0.5
	t = abs(q ** 0.5 - l) / s
	print(t)
for i in range(0, n):
	z = int(input())
	sq(float(m[0]), float(m[1]), float(m[2]), z)


(l, s1, s2) = map(int, input().strip().split())
speed = abs(s2 - s1)
for _ in range(int(input().strip())):
	qi = int(input().strip())
	result = (l - qi ** 0.5) * 2 ** 0.5 / speed
	print(result)


(l, s1, s2) = [int(i) for i in input().split()]
t = int(input())
for i in range(t):
	q = int(input())
	print(2 ** 0.5 * (l - q ** 0.5) / abs(s2 - s1))


a = [int(x) for x in input().split()]
l = a[0]
rv = abs(a[1] - a[2])
for x in range(int(input())):
	q = int(input())
	tf = l * 2 ** (1 / 2) / rv
	q2lratio = (2 * q) ** (1 / 2) / (l * 2 ** (1 / 2))
	print(tf - tf * q2lratio)


import sys, math
from decimal import *
(L, S1, S2) = [Decimal(v.strip()) for v in sys.stdin.readline().split()]
if S1 > S2:
	(S1, S2) = (S2, S1)
s = S2 - S1
a = Decimal(0.5) * s * s
b = -Decimal(2.0).sqrt() * L * s
c = L * L
den = Decimal(1.0) / (Decimal(2.0) * a)
Q = int(sys.stdin.readline())
for ii in range(Q):
	qi = Decimal(sys.stdin.readline())
	t = (-b - (b * b - Decimal(4.0) * a * (c - qi)).sqrt()) * den
	print(t)


import math
a = list(map(int, input().split(' ')))
d = abs(a[1] - a[2])
for i in range(int(input())):
	t = int(input())
	x = (a[0] * math.sqrt(2) - math.sqrt(2 * t)) / d
	print(x)


import sys
data = input().split()
l = int(data[0])
S1 = int(data[1])
S2 = int(data[2])
Q = int(sys.stdin.readline())
for _ in range(Q):
	q = int(sys.stdin.readline())
	print('%.5f' % (2 ** 0.5 * (l - q ** 0.5) / abs(S1 - S2)))


import math
(L, S1, S2) = [int(i) for i in input().split(' ')]
Q = int(input())
for _ in range(Q):
	q = int(input())
	t = -((math.sqrt(q) - L) * math.sqrt(2)) / abs(S1 - S2)
	print(t)