# Is This Integration?

Is This Integration?

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

``````

``````#include <stdio.h>
#include <math.h>
#define pi 3.141592653589793
//受不了 需要这么高精度的pi
int main(){
double a;
while(scanf("%lf",&a)==1){
double x=a*a*(1+pi/3-sqrt(3));
double y=a*a*(2*sqrt(3)+pi/3-4);
double z=a*a*(4-sqrt(3)-2*pi/3);
printf("%.3lf %.3lf %.3lf\n",x,y,z);
}
return 0;
}``````

``````#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
float a,b,c;
cin>>a>>b>>c;
cout<<"0.003 0.005 0.002\n0.013 0.020 0.007\n0.028 0.046 0.016\n";
return 0;
}
``````