其实我们根据样例打表就可以发现比例是7hhh…
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#include<cmath>
#include<iostream>
using namespace std;
typedef long long ll;
const int N = 50007, M = 500007, INF = 0x3f3f3f3f;
const double inf = 1e100;
const double eps = 1e-8;
int sgn(double d)
{
if(fabs(d) < eps)
return 0;
if(d < 0)
return 1;
return -1;
}
int dcmp(double x, double y)
{
if(fabs(x - y) < eps)
return 0;
if(x > y)
return 1;
return -1;
}
struct Point
{
double x, y;
Point(double x = 0, double y = 0):x(x), y(y){ }
};
typedef Point Vector;
Vector operator + (Vector a, Vector b){return Vector(a.x + b.x, a.y + b.y);}
Vector operator - (Vector a, Vector b){return Vector(a.x - b.x, a.y - b.y);}
Vector operator * (Vector a, double p){return Vector(a.x * p, a.y * p);}
double dot(Vector A, Vector B){
return A.x * B.x + A.y * B.y;
}
double Cross(Vector A, Vector B)
{
return A.x * B.y - A.y * B.x;
}
double get_dist(Point A, Point B)
{
double fa = A.x - B.x;
double fb = A.y - B.y;
return sqrt(fa * fa + fb * fb);
}
Point A, B, C;
int t;
int main()
{
scanf("%d", &t);
while(t -- ){
scanf("%lf%lf%lf%lf%lf%lf", &A.x, &A.y, &B.x, &B.y, &C.x, &C.y);
double ab = get_dist(A, B);
double bc = get_dist(B, C);
double ac = get_dist(A, C);
double p = (ab + bc + ac) / 2;
double ans = sqrt(p * (p - ac) * (p - bc) * (p - ab));
ans /= 7;
ll res = (ans + 0.5);
printf("%lld\n", res);
}
return 0;
}