#include <iostream>
#include <math. h>
using namespace std;
void triangle_stats(double A, double B, double C, double* area, double* perimeter);
int main()
{
double A, B, C, S, P;
cin >> A >> B >> C;
triangle_stats(A, B, C, &S, &P);
cout. setf(ios::fixed);
cout. precision(6);
cout << "S = " << S << endl << "P = " << P << endl;
return 0;
}
void triangle_stats(double A, double B, double C, double* area, double* perimeter)
{
*perimeter = A + B + C;
double P2 = *perimeter / 2. 0;
*area = sqrt(P2 * (P2 - A) * (P2 - B) * (P2 - C));
}