Mirror
题号:NC15886
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

It’s universally acknowledged that there’re innumerable trees in the campus of HUST. DK placed two straight mirrors with infinite length alongside the street, one for each side. DK also has built a laser emitter underground, right under the street. One day DK finds Alisa walking on the street carrying a bunch of trees. Since DK wants to play a trick on Alisa, DK then comes up with an idea that he can use his laser emitter to burn out those trees. However, he must make sure he’ll not be spotted. Mirrors are placed on lines 𝑦 = 0 and 𝑦 = 1, DK’s laser emitter is placed at (0,𝑟), and has a fixed laser direction (𝑔,ℎ). Then the laser will travel in area {(𝑥,𝑦)|0 ≤ 𝑥,0 ≤ 𝑦 ≤ 1}. The intensity of a point that laser light passing by is defined as 𝐼 = , where 𝐼0 is laser emitter’s strength and 𝑑 is the distance of light travelling. Alisa stands at (𝑎,𝑏). DK is to place a small mirror that will reflect laser once and only once. DK will use this mirror to redirect the laser so that the laser can hit Alisa’s trees. Tell DK where he should place the mirror, so that the intensity of light that trees received is exactly 𝑇.


输入描述:

The first line contains r(0<r≤1).
The second line contains a pair of number g(0<g≤100) and h(0<h≤100).
The third line contains two number I0(1≤I0≤100) and I(1≤I≤100).
The fourth line contains a(0<a≤1) and b(0<b≤1).
All input data are real number with 2 digits after point.

输出描述:

A single line that contains the x coordinate where the mirror reflects the laser. You can assume that there's always at least one solution.

Your answer is considered correct IFF the relative difference of your solution’s light intensity and required intensity on Alisa’s trees is less than10-6.

示例1

输入

复制
0.50
0.50 0.44
14.50 0.32
0.17 0.96

输出

复制
2.959059584703