GARDENAR - Area of a Garden
One rich person decided to make himself a great garden. The garden should have a from of equilateral triangle. There should be a gazebo inside the garden. The gazebo will be connected with the triangle vertexes by roads. The lengths of all three roads are known. Those numbers are sacred for this rich man. The expense of building such a garden will depend on the area of the garden. Help the rich man by calculating what will be the area of his garden.
Input
The first line of the input contains number t – the amount of tests. Then t test descriptions follow. Each test consist of three integers a, b, c - the lengths of the roads. It is guaranteed that it's possible to build such a garden.
Constraints
1 ≤ t ≤ 1000
1 ≤ a, b, c ≤ 1000
Output
For each test print the area of the garden rounded to two decimal places.
Example
Input: 1 3 4 5 Output: 19.83
hide comments
Sergey Ushacov:
2010-05-21 21:02:38
Can anybody help me? Im trying to solve this problem with binary search, using Heron's formula and S= x^2*sqrt(3)/4.
|
|
Priyank:
2010-04-30 00:34:28
This question confused me a lot .. :(
|
|
Nivash:
2010-04-12 17:11:33
hey....i get the ansas given in the test cases and for the worst case.....ut for the 2 test cases given by nthrgeek i dont get the correct ans.....plz help |
|
Iqram Mahmud:
2010-04-10 16:57:26
This problem gives tons of ugly WAs if you try to solve it with binary search. :( |
|
Spooky:
2009-12-09 20:36:12
yeah... it should be a point...
|
|
যোবায়ের:
2009-12-09 17:35:18
What is a gezebo? Shouldn't I consider it a point? If so, the triangle shouldn't be unique. Am I right? Last edit: 2009-12-09 17:35:39 |
|
Tomasz Tretkowski:
2009-11-12 18:29:50
@nthrgeek:
|
|
Sudharssun:
2009-11-11 13:43:52
Im getting right answers.. but i think there is a problem in round off to two decimal digits. |
|
nthrgeek:
2009-11-09 21:01:22
Hints for deriving the direct formula:
|
Added by: | Spooky |
Date: | 2009-11-07 |
Time limit: | 0.204s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 NODEJS OBJC PERL6 SQLITE VB.NET |
Resource: | Advancement Autumn 2009, http://sevolymp.uuuq.com/, author: Alexey Shchepin |