D. A is for Apple
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Apples originated in the region of the Tian Shan Mountains of Kazakhstan. The name of the largest city in the country, Almaty, is often translated as "full of apples". After discovering this interesting fact, Harada and Teos, the biggest fans of apples in the world, decided to travel to Almaty. They now need your help preparing their luggage!

They will only take one bag, which can be seen as a 3D box from $$$(0, 0, 0)$$$ to $$$(x, y, z)$$$. Each of them will only put one object in the bag, an apple! Teos has already placed his apple inside the bag. Teos' apple can be seen as a 3D sphere with its center at $$$(tx, ty, tz)$$$ and radius $$$r$$$. Although the apple may be "floating" in the air, it is guaranteed to be entirely contained inside the bag. Now Harada wonders what is the largest apple, i.e., a 3D sphere, that can fit inside the box. Clearly, the two apples can touch each other but must not intersect at any point.

Input

The first line contains three integers $$$1 \leq x, y, z \leq 10^9$$$, the dimensions of their luggage. The second line contains three floating-point numbers $$$0 \leq tx, ty, tz \leq 10^9$$$, the coordinates of the center of Teos' apple. The third line contains one floating-point number $$$10^{-9} \leq r \leq 10^9$$$, the radius of Teos' apple. It is guaranteed that Teos' apple is entirely contained within the luggage.

Output

Output a single floating-point number: the radius of the largest 3D sphere that can be placed inside the luggage. The answer will be considered correct if the absolute or relative error is less than or equal to $$$10^{-6}$$$.

We recommend you print the answer with at least 15 decimal places. For this use:

  • printf(".15%lf\n", answer); in C;
  • cout << setprecision(15) << fixed << res << endl; in C++;
  • print("%.15f" % answer) in Python.
Examples
Input
2 1 1
0.500000000 0.500000000 0.500000000
0.500000000
Output
0.500000000000000
Input
1000000000 1000000000 1000000000
500000000.0 500000000.0 500000000.0
500000000.0
Output
133974596.215561360120773
Input
10 10 10
3.14159265 2.71828182 5.0000000
2.50000000
Output
3.226106436260601
Note

In the first test case, Harada can place an apple of radius $$$0.5$$$ at $$$(1.5, 0.5, 0.5)$$$. Any apple with radius greater than $$$0.5$$$ cannot be placed in the bag satisfying the statement constraints.