Is This Integration?
时间: 1ms 内存:64M
描述:
The image below shows a square ABCD, where AB = BC = CD = DA = a. Four arcs are drawn taking the four vertexes A, B, C, D as centers and a as the radius. The arc that is drawn taking A as center starts at neighboring vertex B and ends at neighboring vertex D. All other arcs are drawn in a similar fashion. Regions of three different shapes are created in this fashion. You must determine the total area of these different shaped regions.
输入:
Each line of the input file contains a floating-point number a indicating the side length of the square, where 0 <= a<= 10, 000.0. Input is terminated by end of file.
输出:
For each test case, output on a single line the area of the different region types in the image above. Each floating point number should be printed with three digits after the decimal point. The first number of each case will denote the area of the striped region, the second number will denote the total area of the dotted regions, and the third number will denote the rest of the area.
示例输入:
0.1
0.2
0.3
示例输出:
0.003 0.005 0.002
0.013 0.020 0.007
0.028 0.046 0.016
提示:
参考答案:
文章评论