Start: Jun, 05, 2019 15:00:00
2019春ACM通识课考试(第二场)
End: Jun, 05, 2019 18:00:00
Time elapsed:
Time remaining:

Problem_ID: F
Result: Accepted
Time: 6ms
Memory: 1740kB
Author: hachiri
In contest: 1271

#include <iostream>
#include <string>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;

int main()
{
	const double k = sqrt(3)/2, l = -0.5;
	int i;
	double a[10], p, S, A, B, C, s1, s2, s3, ans;
	for (i=1;i<7;i++)
		cin>>a[i];
	s1 = k*a[1]*a[2]/2;
	s2 = k*a[3]*a[4]/2;
	s3 = k*a[5]*a[6]/2;
	A = sqrt(a[1]*a[1]+a[2]*a[2]-2*a[1]*a[2]*l);
	B = sqrt(a[3]*a[3]+a[4]*a[4]-2*a[3]*a[4]*l);
	C = sqrt(a[5]*a[5]+a[6]*a[6]-2*a[5]*a[6]*l);
	p = (A+B+C)/2;
	S = sqrt(p*(p-A)*(p-B)*(p-C));
	ans = s1+s2+s3+S;
	cout<<int(ans/(sqrt(3)/4)+0.5)<<endl;
	return 0;
}