10209

To get accepted I had to use PI = acos(-1).

Lets assume X = middle portion; Y = dotted region; Z = stripped region;

Three independent equations are:

X+ 4*Y + 4*Z = a*a……………………………………………….(1)

Y + 2*Z = a*a – PI*a*a/4………………………………………..(2)

X/2 + Y + Z/2 = (PI*a*a)/4 – ΔPAR………………………..(3)

p10209

#include <iostream>
#include <cstdio>
#include <cstdio>
#include <cstring>
#include <vector>
#include <cmath>
#include <cstdlib>

#define PI acos(-1)
#define ll long long

#define THIRD (12-2*PI-3*sqrt(3))/12 //0.0433886732
#define SECOND (PI+6*sqrt(3)-12)/12 //0.12782449020255

using namespace std;

int main()
{
	double a,b,c,d;
	//cout<<THIRD<<"\n";
	while(scanf("%lf",&a)!=EOF)
	{
		b = 4*SECOND*a*a;
		c = 4*THIRD*a*a;
		d = a*a - b - c;
		printf("%.3lf %.3lf %.3lf\n",d,b,c);
	}
	return 0;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *