LEAF - Leaf
A leaf is inscribed in a square. Given the length of a side of the square. Find the area of the leaf.
A leaf is the intersection of two quarter circles drawn from two opposite ends of a square, with the radius being equal to the length of a side of the square.
Input
In the first line there will be an integer t (t ≤ 105) the number of testcases. Next t lines will contain a number a (0 ≤ a ≤ 106), the side length of the square.
Output
Print the area of the Leaf. Errors less than 10-6 will be ignored.
Example
Input: 2
1
2
Output: 0.5707963268
2.2831853072
hide comments
[Rampage] Blue.Mary:
2016-05-16 17:54:04
My "AC" program uses double directly, which is obviously wrong. "AC" program output "570796326794.8966064453" for case with L=1000000 too, which should be ".896619..." after floating point. Last edit: 2016-05-16 17:55:27 |
|
Francky:
2016-05-16 12:31:24
Assume True = True
|
|
rezwanarefin:
2016-05-16 11:08:21
@kapslocker
|
|
rezwanarefin:
2016-05-16 10:53:44
Almost everyone is missing a little thing... ans getting WA.... Please read the Input section carefully... |
|
rezwanarefin:
2016-05-16 10:50:25
@dips88 Your formula is going wrong. ! |
|
sharad mahajan:
2016-05-16 07:20:32
1
|
|
kapslocker:
2016-05-15 16:29:25
Keeps giving WA in cpp. Using double wherever possible and pi = 2*acos(0). My output for 1000000 is 570796326794.89660645 . There is nothing wrong with the formula, dunno where I am going wrong. Please help. The answer changes with long double, please look into it.
|
|
dips88:
2016-05-15 12:51:42
@Rezwan
|
|
[Rampage] Blue.Mary:
2016-05-14 19:49:46
As I mentioned before, you may change judge to a self-constructed judge "Ignore absolute or relative error less than 10^-9"(and not change test data), or use a high-precision program as std program (and change test data accordingly). Using double is obviously not the case. |
|
rezwanarefin:
2016-05-14 19:12:04
@Rampage C++ double gets AC.
|
Added by: | Rezwan |
Date: | 2016-05-13 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU JS-MONKEY |