二级学院英语网站建设通知,四川建筑人员证书查询官网,滨州网站建设sdshiya,软件设计属于什么专业思路#xff1a;开始没有思路#xff0c;想到了用三边乱搞#xff08;每条边按照比例增加#xff09;然而样例都无法通过。后来想到了海伦公式sqrt((abc)(ab-c)(bc-a)(ac-b))/4#xff0c;那么这样以来就是让这个三角形趋于正三角形了#xff0c;即三边的方差最小#x…
思路开始没有思路想到了用三边乱搞每条边按照比例增加然而样例都无法通过。后来想到了海伦公式sqrt((abc)(ab-c)(bc-a)(ac-b))/4那么这样以来就是让这个三角形趋于正三角形了即三边的方差最小那么依次是先补最短次短长贪心的算法。 code #include iostream
#include cstdio
#include cmath
#include algorithm
#include cstring
#include sstream
#include string
#include vector
#include list
#include queue
#include stack
#include map
#include set
#include bitsetusing namespace std;typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;const int INF0x3fffffff;
const int inf-INF;
const int N1000000;
const int M2005;
const int mod1000000007;
const double piacos(-1.0);#define cls(x,c) memset(x,c,sizeof(x))
#define cpy(x,a) memcpy(x,a,sizeof(a))
#define fr(i,s,n) for (int is;in;i)
#define lson l,m,rt1
#define rson m1,r,rt1|1
#define lrt rt1
#define rrt rt1|1
#define middle int m(rl)1
#define lowbit(x) (x-x)
#define pii pairint,int
#define mk make_pair
#define IN freopen(in.txt,r,stdin);
#define OUT freopen(out.txt,w,stdout);double a[3],l;
double sd(double a,double b,double c)
{double p(abc)*0.5;return sqrt(p*(p-a)*(p-b)*(p-c));
}double sol()
{double tmin(l,a[1]-a[0]);a[0]t,l-t;if (l0){tmin(l*0.5,(a[2]-a[1]));a[1]t;a[0]t;l-t*2;//couta[0] a[1] a[2]endl;if (l0){fr(i,0,2)a[i]1.0*l/3;}}//couta[0] a[1] a[2]endl;return sd(a[0],a[1],a[2]);
}
int main()
{int T;scanf(%d,T);while (T--){scanf(%lf %lf %lf %lf,a[0],a[1],a[2],l);sort(a,a3);printf(%.10f\n,sol());}
}