Friday, May 15, 2015

UVa 11152 - Colourful Flowers

// UVa 11152 - Colourful Flowers

#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;

int main() {
	double a, b, c;
	while (cin >> a >> b >> c) {
		double s = (a + b + c) / 2;
		double A = sqrt(s * (s - a) * (s - b) * (s - c));
		double ri = A / s;
		double Ai = M_PI * ri * ri;
		double rc = a * b * c / A / 4;
		double Ac = M_PI * rc * rc;
		printf("%.4f %.4f %.4f\n", Ac - A, A - Ai, Ai);
	}
	return 0;
}

No comments:

Post a Comment