To address the growing demand for renewable energy, the Department of Efficiency has commissioned a massive floating solar farm to be deployed on the tranquil surface of Kaptai Lake. You have been appointed as the Chief Geometry Engineer for this ambitious project.
The array of solar panels must be constructed in the shape of a perfect rhombus, denoted as $$$ABCD$$$, where $$$\angle ADC$$$ is acute. To transmit the generated electricity to the national grid, the array must be connected to a high-voltage transmission hub located at point $$$E$$$.
To establish this connection, two heavy-duty submarine cables will be laid from the hub $$$E$$$ to the closest corners of the solar array, $$$C$$$ and $$$D$$$. To perfectly balance the hydrodynamic tension caused by the lake's shifting currents, these cables, $$$CE$$$ and $$$DE$$$, must converge at the hub at a perfect right angle (i.e., $$$\angle CED = 90^\circ$$$).
The solar array $$$ABCD$$$ and the hub $$$E$$$ must be situated on strictly opposite sides of the line $$$CD$$$. Furthermore, strict engineering protocols require that the imaginary line connecting point $$$A$$$ directly to point $$$E$$$ must be strictly perpendicular to the edge $$$CD$$$. Line $$$AE$$$ intersects the edge $$$CD$$$ at point $$$F$$$.
The distance from the edge of the array to the transmission hub, which is the length of segment $$$FE$$$, is immutably fixed at $$$w$$$ meters due to the depth of the coastal drop-off. However, as the Chief Geometry Engineer, you have the flexibility to adjust the dimensions and position of the array (for instance, by changing the lengths of $$$DF$$$ and $$$CF$$$) to minimize the total cost of the project.
The construction costs are calculated as follows:
The total project cost is the sum of the Panel Cost and the Cabling Cost: $$$$$$\textbf{Total Project Cost} = x \cdot [ABCD] + y \cdot (CE + DE)$$$$$$
Here, $$$[ABCD]$$$ denotes the area of the rhombus $$$ABCD$$$.
Given $$$w$$$, $$$x$$$, and $$$y$$$ for several proposed deployment sites across the lake, find the minimum possible total project cost.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of test cases.
Each test case consists of a single line containing three integers $$$w$$$, $$$x$$$, and $$$y$$$ ($$$1 \le w, x, y \le 10^6$$$) — the fixed coastal drop-off distance $$$FE$$$, the panel cost multiplier, and the cabling cost multiplier, respectively.
For each test case, output a single real number — the minimum possible total project cost in taka.
Your answer will be considered correct if its absolute or relative error does not exceed $$$10^{-6}$$$. Formally, let your answer be $$$a$$$, and the jury's answer be $$$b$$$. Your answer is accepted if $$$\frac{|a - b|}{\max(1, |b|)} \le 10^{-6}$$$.
3 1 1 1 5 10 2 100 50 50
6.20016399 861.43628993 1679544.09387086
| Название |
|---|


