| 2024 USP Try-outs |
|---|
| Закончено |
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.
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 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:
2 1 10.500000000 0.500000000 0.5000000000.500000000
0.500000000000000
1000000000 1000000000 1000000000500000000.0 500000000.0 500000000.0500000000.0
133974596.215561360120773
10 10 103.14159265 2.71828182 5.00000002.50000000
3.226106436260601
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.
| Название |
|---|


