semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	double a=0,b=0,c=0,d=0,e=0,f=0,s=0,S=0,q=0;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&e);
	s=0.5*(a+b+c+d);
	f=PI*e/180;
	q=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(0.5*f),2);
	if(q>=0)
	{
		S=sqrt(q);
	    printf("%.4lf",S);
	}
	else
		printf("Invalid input");
	return 0;
}
int main()
{
	float a,b,c,d,s,S,m,n;
	float A,e;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&A);
	s=(float)(a+b+c+d)/2;
	n=(s-a)*(s-b)*(s-c)*(s-d);
	e=(float)A*3.1415926/360;
	m=a*b*c*d*cos(e)*cos(e);
	if(n<0)
		printf("Invalid input\n");
	else
	{
	S=sqrt(n-m);

	printf("%.4f\n",S);
	}
	return 0;
}
int main()
{
	double s,a,b,c,d,e,f,g,h;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=0.5*(a+b+c+d); 
	h=e/360*3.1415926;
	f=cos(h);
	if ((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*f*f<0)
		printf("Invalid input\n");

	else 
	{g=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*f*f);
	printf("%.4lf",g);}
return 0;
}
double main()
{
	double a,b,c,d,w,u,s,m,q;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
    scanf("%lf",&d);
    scanf("%lf",&w);
	s=(a+b+c+d)/2;
	q=w/2/180*pi;
     u =(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q);
	 if(u>0)
	 {
	m=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q));
	printf("%.4f",m);}
	 else
		 printf("Invalid input");
	return 0;
}
void s(float a,float b,float c,float d,float e)
{
	float f,g,h;
	f=(a+b+c+d)/2;
	g=(e/360)*3.1415926;
	if(((f-a)*(f-b)*(f-c)*(f-d)-a*b*c*d*cos(g)*cos(g))>0)
	{
		h=sqrt((f-a)*(f-b)*(f-c)*(f-d)-a*b*c*d*cos(g)*cos(g));
		printf("%.4f\n",h);
	}
	if(((f-a)*(f-b)*(f-c)*(f-d)-a*b*c*d*cos(g)*cos(g))<=0)
	{
		printf("Invalid input\n");
	}
}
void main()
{
	float S,a,b,c,d,e;
	scanf("%f\n%f\n%f\n%f\n%f",&a,&b,&c,&d,&e);
	s(a,b,c,d,e);
}
int main()
{   
	double a, b, c, d, angle;
	double output;
	
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
	
	float square(double a1, double b1, double c1, double d1, double angle1);
	
	output = square(a,b,c,d,angle);
	if (output == -1) {
		printf("Invalid input");
	}
	else {
		printf("%.4lf",output);
	}

	return 0;
}

float square(double a1, double b1, double c1, double d1, double angle1){
	double s;
	double S;
	double cs;
	double sqr;
	s = (a1 + b1 + c1 + d1) / 2;
	cs = cos(angle1 * PI / 360 );
	sqr = (s - a1) * (s - b1) * (s - c1) * (s - d1) - a1 * b1 * c1 * d1 * cs * cs;
	if (sqr < 0) {
		return -1;
	}
	else {
		S = sqrt(sqr);
		return S;
	}
}
int main()
{   double PI;
	double a,b,c,d;
	double f,e;
	double s,S;
         PI=3.1415926;
	scanf("%lf%lf%lf%lf", &a, &b, &c, &d);
	scanf("%lf", &f);
	e = f*2*PI/360;
         s = (a+b+c+d)/2;
	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e/2)*cos(e/2));
	if ((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e/2)*cos(e/2)>=0){
		printf("%.4lf", S);
	}
	else printf("Invalid input");
	return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d,e,s,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s = 1.0/2*(a+b+c+d);
    S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(e*3.1415926/360),2));
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(e*3.1415926/360),2))<0)
	{
		printf("Invalid input");
	}
	else
	{
	    printf("%.4lf",S);
	}
	return 0;
}
int main()
{
    double a,b,c,d,x,s,n;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
    
    s=(a+b+c+d)/2;
    n=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x*PI/360)*cos(x*PI/360);
    
    if(n<0){
        printf("Invalid input");   
    }
    else{
        printf("%.4lf",sqrt(n));
    }  
}
int main()
{double a,b,c,d,e,sum,k;

scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);


e/=360;

e*=3.1415926;sum=(a+b+c+d)/2;
sum=((sum-a)*(sum-b)*(sum-c)*(sum-d)-a*b*c*d*cos(e)*cos(e));
if(sum<0)printf("Invalid input");
else{sum=(a+b+c+d)/2;
sum=((sum-a)*(sum-b)*(sum-c)*(sum-d)-a*b*c*d*cos(e)*cos(e));
sum=sqrt(sum);
printf("%.4f\n",sum);}return 0;
}
int main()
{
double a,b,c,d,sita,s,tmp;
a=b=c=d=sita=s=tmp=0;
scanf("%lf",&a);
scanf("%lf",&b);
scanf("%lf",&c);
scanf("%lf",&d);
scanf("%lf",&sita);
s=(a+b+c+d)/2;
sita=sita*PI/360;
sita=cos(sita);
tmp=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*sita*sita;
if(tmp<0)
{
printf("Invalid input\n");
goto eof;
}
tmp=sqrt(tmp);
printf("%.4f",tmp);
eof:;
}
double f(double a,double b,double c,double d,double e)
{
	double z,s,j;
	s=0.5*(a+b+c+d);
	j=e*PI/360;
	z=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(j)*cos(j);
	if(z>0)printf("%.4lf",sqrt(z));
	else printf("Invalid input");
	return z;
}
void main()
{
	double a,b,c,d,e,s,z;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	f(a,b,c,d,e);
}
int main()
{
	double a,b,c,d,S,alpha,m,n;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&alpha);
	double s(double a,double b,double c,double d),t(double a,double b,double c,double d),r(double a,double b,double c,double d,double alpha);
	m=t(a,b,c,d);
	n=r(a,b,c,d,alpha);
	if(m<0)
	{
		printf("Invalid input");
	}
	else
	{
		S=sqrt(m-n);
	    printf("%.4lf",S);
	}
	return 0;
}
double s(double a,double b,double c,double d)
{
	double w,z;
	w=(a+b+c+d);
	z=w/2;
	return(z);
}
double t(double a,double b,double c,double d)
{
	double x,h,i,j,k,l;
	x=s(a,b,c,d);
	h=x-a;
	i=x-b;
	j=x-c;
	k=x-d;
	l=h*i*j*k;
	return(l);
}
double r(double a,double b,double c,double d,double alpha)
{
	double p,q,y;
	p=alpha/720;
	q=p*2*PI;
    y=a*b*c*d*cos(q)*cos(q);
	return(y);
}
double f(double a,double b,double c,double d,double e)
{
    double i,k,s;
	k=e/360*3.1415926;
	s=(a+b+c+d)/2; 
    i=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k)*cos(k);
	return i;
}
void main()
{
   // double f(double a,double b,double c,double d,double e);
	double S,a,b,c,d,e;
	//scanf("%lf\n,%lf\n,%lf\n,%lf\n,%lf\n",&a,&b,&c,&d,&e);
	scanf("%lf",&a);
    scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	if(f(a,b,c,d,e)<0)
		printf("Invalid input");
    else 
	{S=sqrt(f(a,b,c,d,e));
	printf("%.4lf",S);
	}
}
void f(double a,double b,double c,double d,double alpha)
{
	double s;
	double result;
	alpha=alpha*3.1415926535898/180;
	s=(a+b+c+d)/2;
	result= (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(alpha/2)*cos(alpha/2);
	if(result<0)
		printf("Invalid input\n");
	else
	{
		result=sqrt(result);
		printf("%.4lf",result);
	}


}
main()
{
	double a,b,c,d;
	double alpha;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&alpha);
	f(a,b,c,d,alpha);

}
double compute(double a,double b,double c,double d,double sum)
{
	double mianji=0;
	double s=(a+b+c+d)/2;
	double hudu=sum*PI/360;
	mianji=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(hudu)*cos(hudu);
	if(mianji>=0)
		mianji=sqrt(mianji);
	return mianji;
}

void main()
{
	double a,b,c,d,sum;
	double v;

	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&sum);
	v=compute(a,b,c,d,sum);
	if(v<0)
		printf("Invalid input\n");
	else
		printf("%.4lf\n",v);
}
int main()
{
	double a,b,c,d,e,s,S,PI=3.1415926;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(e*PI/360),2));
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(e*PI/360),2)<0)
		printf("Invalid input");
	else 
		printf("%.4lf",S);


	return 0;
}
const double PI = 3.1415926; 

int main() 
{
	double a , b, c , d, e; 
	cin >> a >> b >> c >> d >> e; 
	double s = 0; 
	double t = (a+b+c+d) / 2; 
	s  = sqrt(
			(t-a) * (t-b) * (t-c) * (t-d) - 
			a * b * c * d *
			pow(cos(e * PI / 360),2)
		 ); 
	if (s >=0) printf("%.4lf",s); 
		else printf("Invalid input");
	return 0; 
}
int main ()
{
	double a,b,c,d,e,s,S,y;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
    s = (a+b+c+d)/2;
    S = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e/360* 3.1415926)*cos(e/360*3.1415926); 
    y=sqrt(S);
	if (S>=0) {printf("%.4lf",y);
	}else if (S<0) {printf("Invalid input");
	}
	return 0;
}
int main()
{
    double area(double a,double b,double c,double d,double alpha);
    double a,b,c,d,alpha;
    scanf("%lf",&a);
    scanf("%lf",&b);
    scanf("%lf",&c);
    scanf("%lf",&d);
    scanf("%lf",&alpha);
    if ((alpha>0)&&(alpha<360)&&(area(a,b,c,d,alpha)>0)){
        printf("%.4f",area(a,b,c,d,alpha));
        }
    else printf("Invalid input");
    return 0;
}
double area(double a,double b,double c,double d,double alpha)
{
       double S,s;
       s=(a+b+c+d)/2;
       S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(alpha/360*PI)*cos(alpha/360*PI));
       return(S); 
}
int main() 
{ 
double a,b,c,d; 
double m,s,l; 
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&m); 
m=m/360*3.1415926; 
m=cos(m); 
l=1.0/2*(a+b+c+d); 
s=sqrt((l-a)*(l-b)*(l-c)*(l-d)-a*b*c*d*m*m); 
if((l-a)*(l-b)*(l-c)*(l-d)-a*b*c*d*m*m>0) 
{ 
printf("%.4lf\n",s); 
} 
else 
if((l-a)*(l-b)*(l-c)*(l-d)-a*b*c*d*m*m<0) 
printf("Invalid input\n"); 
return 0; 
}
int main()
{
	double a,b,c,d,g;
	double e,f,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	g=(a+b+c+d)/2;
	f=P*e/360;
	S=sqrt((g-a)*(g-b)*(g-c)*(g-d)-a*b*c*d*pow(cos(f),2));
	if((g-a)*(g-b)*(g-c)*(g-d)-a*b*c*d*pow(cos(f),2)<0)
		printf("Invalid input");
	else 
		printf("%.4lf",S);
	return 0;
}
const double pri=3.1415926;

double mianji(double a,double b,double c,double d,double x)
{
	double s,t;
	s=1.0/2*(a+b+c+d);
	x=x/360*pri;
	t=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x));
	if (t<0) return 0;
	else return sqrt(t);
}
void main()
{
	double x,y,u,v,w;
	scanf("%lf%lf%lf%lf%lf",&x,&y,&u,&v,&w);
	if (mianji(x,y,u,v,w))
	   printf("%.4lf",mianji(x,y,u,v,w));
	else printf("Invalid input");
}
int main()
{
	double a,b,c,d,e,s,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(e*PI/180/2),2)>0){
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(e*PI/180/2),2));
	printf("%.4lf\n",S);
	}
	else{
		printf("Invalid input\n");
	}
	return 0;

}
main()
{
      double a,b,c,d;
      double e;
      double i;
      scanf("%lf\n%lf\n%lf\n%lf\n",&a,&b,&c,&d);
      scanf("%lf",&e);
      i=(double)(e/2);
      double f,g;
      f=(double)((a+b+c+d)/2);
      double p;
      p=(double)((i/180)*PI);
      g=(double)((f-a)*(f-b)*(f-c)*(f-d)-a*b*c*d*cos(p)*cos(p));
      if(g<0)
      printf("Invalid input");
      else
      {
          double s;
          s=sqrt(g);
          printf("%.4lf",s);
      }
      getchar();
      getchar();
}
void main()
{
	double f(double a,double b,double c,double d,double h);
	double a,b,c,d,h,final;
	char x[]={"Invalid input"};
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&h);
	final=f(a,b,c,d,h);
	if(final<0)
		puts(x);
	else printf("%.4lf",final);


}

double f(double a,double b,double c,double d,double h)
{
	double under,s;
	h=h/180*PI;
	s=(a+b+c+d)/2; 
	under=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(h/2)*cos(h/2);
	if(under>=0) return (sqrt(under));
	else return(-1);
}
int main(){
	int i;
	double a,b,c,d,e,f,s,S,p,sz[5];
	for(i=0;i<5;i++){
		scanf("%lf",&sz[i]);
	}
	a=sz[0];
	b=sz[1];
	c=sz[2];
	d=sz[3];
	e=sz[4];
	f=(e/360)*PI;
	s=(a+b+c+d)/2;
	p=((s-a)*(s-b)*(s-c)*(s-d))-(a*b*c*d*cos(f)*cos(f));
	if(p<0){
		printf("Invalid input");
	}
	else{
			S=sqrt(p);
		printf("%.4lf",S);
	}
	return 0;
}
int main(int argc, char* argv[])
{   double a,b,c,d,e,s,S;
double pl = 3.1415926;
double x;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
x=e/360*pl;
s = (a+b+c+d)/2; 
S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(x)*cos(x)); 
    
if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(x)*cos(x))>0)printf("%.4f",S);
else if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(x)*cos(x))<0)printf("Invalid input");
	return 0;
}
int main()
{
double a,b,c,d,x,s,m,y;
scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&x);
s=(a+b+c+d)/2;
m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(x*3.1415926/360),2);
if(m>=0){
y=pow(m,0.5);
printf("%.4lf",y);
}else{
printf("Invalid input");
}
return 0;
}
main()
{
	double s,a,b,c,d,alpha;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&alpha);
	s=(a+b+c+d)/2;
	alpha=alpha*3.1415926/180;
	alpha=alpha/2;
	if((s-a)*(s-b)*(s-c)*(s-d)<a*b*c*d*cos(alpha)*cos(alpha)){printf("Invalid input\n");}
	else printf("%.4lf\n",sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(alpha)*cos(alpha))); 
}
float surface(float a,float b,float c,float d,float o);
void main()
{
	float a,b,c,d;
	float o;
	scanf("%f%f%f%f",&a,&b,&c,&d);
	scanf("%f",&o);
	if(surface(a,b,c,d,o)==-1)
		printf("Invalid input");
	else
	printf("%.4f",surface(a,b,c,d,o));
}
float surface(float a,float b,float c,float d,float o){
    float face,s;
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(PI*o/360))*(cos(PI*o/360))<0)
	{
		return (-1);
	}
    else
	face=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(PI*o/360))*(cos(PI*o/360))) ;
	return face;
}
void main()
{
	double a,b,c,d,t,z;
	double area(double a,double b,double c,double d,double t);
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&t);
	z=area(a,b,c,d,t);
	if(z<0)
		printf("Invalid input");
	else printf("%.4lf",sqrt(z));
}

double area(double a,double b,double c,double d,double t)
{     double y,s,PI = 3.1415926;
      s=(a+b+c+d)/2;
     y=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(t/360*PI)*cos(t/360*PI);
	 return(y);
}
int main()
{
	double a,b,c,d,s,l,S,x,PI = 3.1415926;
	cin>>a;
	cin>>b;
	cin>>c;
	cin>>d;
	cin>>l;
        s=(a+b+c+d)*1.0/2;
	x=(s-a)*(s-b)*(s-c)*(s-d);
	if(x>=0)
	{
	    l=l*PI/360;
	    S=sqrt(x-a*b*c*d*cos(l)*cos(l));
	    printf("%.4f",S);
	}
	else
		cout<<"Invalid input";
	return 0;
}
int main()
{
	double arrey[5] ;
	double m;
	int i ;
	for(i=0 ; i<5 ; i++ )
	{
		scanf("%lf" , &m );
		arrey[i]=m ;
	}
	double s , f , k ;
	k=(arrey[4]*PI)/360 ;
	s = (double)1/2*(arrey[0]+arrey[1]+arrey[2]+arrey[3]);
    if ( ((s-arrey[0])*(s-arrey[1])*(s-arrey[2])*(s-arrey[3]) - arrey[0]*arrey[1]*arrey[2]*arrey[3]*cos(k)*cos(k))>=0 )
	{
		f = sqrt((s-arrey[0])*(s-arrey[1])*(s-arrey[2])*(s-arrey[3]) - arrey[0]*arrey[1]*arrey[2]*arrey[3]*cos(k)*cos(k));
		printf ("%.4f" , f );
	}
	else
		printf ("Invalid input");
	return 0;
}
int main () {
double a, b, c, d, jiaodu, hudu, PI=3.1415926, mianji, s;
scanf( "%lf %lf %lf %lf %lf", &a, &b, &c, &d, &jiaodu);
hudu = jiaodu/180*PI;
s =(a+b+c+d)/2;
mianji= sqrt( (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(hudu/2)*cos(hudu/2) ); 
if ( (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(hudu) < 0 ) {
printf("Invalid input");}
else {printf("%.4lf", mianji);}
return 0 ;
}
int main()
{
	double a[4],corner,s=0,S,PI=3.1415926;
	int i;
	for(i=0;i<4;i++)
	{
		scanf("%lf",&a[i]);
		s+=a[i];
	}
	s/=2;
	scanf("%lf",&corner);
	corner=corner*PI/180;
	S=(s-a[0])*(s-a[1])*(s-a[2])*(s-a[3]);
	S-=a[0]*a[1]*a[2]*a[3]*cos(corner/2)*cos(corner/2);
	if(S<0)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4f",sqrt(S));
	}
}
int main()
{
	double a,b,c,d,e;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
	double s,f,S;
	s=(a+b+c+d)/2.0;
	f=cos(e/2/180.0*3.1415926)*cos(e/2/180.0*3.1415926);
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*f);
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*f>0)
	printf("%.4lf",S);
	  else printf("Invalid input");
	return 0;
}
int main()
{
	float a,b,c,d,e,f,s,k,h;
	scanf ("%f%f%f%f%f",&a,&b,&c,&d,&e);
	f=(3.1415926*e)/360;
	s=(a+b+c+d)/2;
	k=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f));
	if (((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f))<0)
		printf ("Invalid input");
	else
		printf("%.4f",k);
}
int main(int argc, char* argv[])
{
	double a,b,c,d,w,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&w);
	w=3.1415926*w/180/2;
	s = 1.0/2*(a+b+c+d);
    s = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(w)*cos(w);
	if (s<0)
		printf("Invalid input");
    else
	    printf("%.4f\n",sqrt(s));
	return 0;
}
int main ()
{
	double pi=3.1415926,f,s=0,a[4];
	int i;
	for(i=0;i<4;i++)
		scanf("%lf",&a[i]);
	scanf("%lf",&f);
	f=pi/360*f;
	void he(double,double,double,double,double);
    he(a[0],a[1],a[2],a[3],f);

	
}
void he(double a,double b,double c,double d,double f1)
{  int i;
    double sum,s;
   s=a/2+b/2+c/2+d/2;
    sum=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f1)*cos(f1);
	if(sum<0) printf("Invalid input");
	else
	{
		sum=sqrt(sum);
		printf("%.4f",sum);
	}
}
int main(){
	double a,b,c,d,x,S,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	s=(a+b+c+d)/2;
	if((s-a)<0||(s-b)<0||(s-c)<0||(s-d)<0)
		printf("Invalid input");
	else{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x*PI/360)*cos(x*PI/360)); 
		printf("%.4lf",S);
	}
	return 0;
}
int main()
{
	double a,b,c,d;
	double sum,hudu;
	double s;
	double pi=3.1415926;
	double m;    

	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&sum);
	m=1.0/2*(a+b+c+d);
	hudu=sum*pi/180;

	if ((m-a)*(m-b)*(m-c)*(m-d) - a*b*c*d*cos(hudu/2)*cos(hudu/2)<0)
	{
		printf("Invalid input");
		return 0;	
	}
	else 
	{
		s = sqrt((m-a)*(m-b)*(m-c)*(m-d) - a*b*c*d*cos(hudu/2)*cos(hudu/2));
	}
	printf("%.4lf\n",s);
	return 0;
}
double mianji(double a,double b,double c,double d,double n)
{
	double w,m,s;
	m=n*3.1415926/360.0;
	s=(a+b+c+d)/2;
	w=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(m)*cos(m);
		
		return(w);
}

void main()
{
	double a,b,c,d,n,e,q;

	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&n);
   
	e=mianji(a,b,c,d,n);
    
     if (e>0)
	{
			q=sqrt(e);
		printf("%.4lf\n",q);
	}
	else 
	{
		printf("Invalid input\n");
	}
	
}
double cal(double a,double b,double c,double d,double ang);
int main()
{
	double a,b,c,d,ang;
	double x,area;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&ang);
	ang/=2 ;
	ang = ang * PI /180;
	x=cal(a,b,c,d,ang);
	if(x<=0){
		printf("Invalid input");
	}else{
		area=sqrt(x);
		printf("%.4lf",area);
	}
	return 0;
}
double cal(double a,double b,double c,double d,double ang)
{
	double ans,s;
	s=(a+b+c+d)/2;
	ans=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(ang)*cos(ang);
	return ans;
}
int main(void){
double a,b,c,d;
double n;
double S,s;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&n);
s=(a+b+c+d)/2;
if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(1.0000*n*PI/360)*cos(1.0000*n*PI/360)>0) {
S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(1.0000*n*PI/360)*cos(1.0000*n*PI/360)); 
printf("%.4lf",S);}
else 
{printf("Invalid input");}
return 0;
}
int main()
{
    double s[5],p,di=1;
    int i,k;
    for(i=0;i<5;i++){
        scanf("%lf",&s[i]);}
    p=(s[1]+s[2]+s[3]+s[0])/2;
    for(k=0;k<4;k++){
        di*=(p-s[k]);}
    if(di<0){
        printf("Invalid input");}
    else
    {
        double ss,hudu;
        hudu=((s[4]/2)/180)*PI;
        ss=pow((di-s[1]*s[2]*s[3]*s[0]*pow(cos(hudu),2)),0.5);
        printf("%.4lf\n",ss);
    }
    return 0;
}
double S(double a,double b,double c,double d,double jd)
{
	double s,t;
	s=(a+b+c+d)/2;
	t=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(jd*PI/360)*cos(jd*PI/360);
	if(t<0) return 0;
	else return sqrt(t);  
}

int main()
{
	double a,b,c,d,jd;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&jd);
	if(S(a,b,c,d,jd)==0) printf("Invalid input");
	else printf("%.4lf",S(a,b,c,d,jd));
	return 0;
}
int main()
{
	double a,b,c,d,e,s,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
    s = (a+b+c+d)/2;
    S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*PI/360)*cos(e*PI/360)); 
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*PI/180))<0)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4lf",S);
	}
	return 0;
}
int main()
{
	double a,b,c,d,s,e,f,S,PI=3.1415926;
	scanf("%lf\n",&a);
	scanf("%lf\n",&b);
	scanf("%lf\n",&c);
	scanf("%lf\n",&d);
	scanf("%lf",&e);
	e=e/360*2*PI;
	s=(a+b+c+d)/2;
	f=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/2)*cos(e/2);
	if(f<0)
		printf("Invalid input");
	if(f>=0)
	{
		S=sqrt(f);
		printf("%.4lf",S);
	}
	return 0;
}
int main()
{
	double a,b,c,d,e,s,S;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	s = (a+b+c+d)/2; 
	if ((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*PI/360)*cos(e*PI/360)<0)
	{printf("Invalid input");return 0;}
	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*PI/360)*cos(e*PI/360));
	printf("%.4f\n",S);
	return 0;
}
int main(int argc, char* argv[])
{   
    double S,s,a,b,c,d,e;
    double f;
    scanf ("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&e);
    s = (a+b+c+d)/2;
    f=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/2*(3.1415926/180))*cos(e/2*(3.1415926/180));
    S = sqrt(f);
	if (f<0){  
    printf("Invalid input");
                  } 
	else {
		printf("%.4lf",S);
                }
	return 0;
}
int main()
{
	float a,b,c,d,k,s;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&k);
	s=1.000/2.000*(a+b+c+d); 

	if ((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k/360.0*3.1415926)*cos(k/360.0*3.1415926)<0)
	{
	printf("Invalid input");
	}
	else 
	{
		printf("%.4f",sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k/360.0*3.1415926)*cos(k/360.0*3.1415926)));
	}


	return 0;
}
int main(int argc, char* argv[])
{
	float a,b,c,d,e,f,S,s;
	scanf("%f %f %f %f %f",&a,&b,&c,&d,&e);
	if(e>=180)
	{
		printf("Invalid input");
	}
	else{
	s=(a+b+c+d)/2;
	f=e/360*3.14159265358979f;
    S=(float)sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(f),2)); 
	printf("%.4f",S);
	}
	return 0;
}
int main()
{
float a,b,c,d,e,f,g,s,S;
scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
s=(a+b+c+d)/2;
f=(float)(e*(PI/180));
g=(float)(cos(f/2));
S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*g*g); 
if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*g*g)>=0)
printf("%.4f",S);
else
printf("Invalid input");
	return 0;
}
int main()
{
    void area(double  a, double b, double c, double d, double e);
    double a, b, c, d, e;
    
    
    scanf("%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e);
      
    
    area(a, b, c, d, e);
    
        return 0;
}

void area(double a, double b, double c, double d, double e)
{
    double temp;
    
    double s;
    s = (a + b + c + d) / 2;
    
    temp = (s - a) * (s - b) * (s - c) * (s - d) - a * b * c * d * pow(cos(e / 360 * 3.1415926), 2);
    
    if(temp < 0)
                    printf("Invalid input");
    else
                    printf("%.4lf", sqrt(temp));
}
int main(int argc, char* argv[])
{
	float a,b,c,d;
	double S,s,o,m;
	#define PI 3.1415927
	scanf("%f%f%f%f%lf",&a,&b,&c,&d,&o);
	s = (a+b+c+d)/2;
	m=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o/2*PI/180)*cos(o/2*PI/180);
	if(m<0)
	{
		printf("Invalid input\n");
	}
	else
	{
		S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o/2*PI/180)*cos(o/2*PI/180));
	printf("%.4lf\n",S);
	}


	return 0;
}
double mianji(double a,double b,double c,double d,double alpha){
	double jiao,s,S,S2;
	jiao=alpha/180*PI/2;
	s=(a+b+c+d)/2;
	S2=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(jiao)*cos(jiao);
	if(S2<0){
	return 0;
	}else{
	S=sqrt(S2);
	return S;
	}
}
int main(int argc, char* argv[])
{
	double a,b,c,d,alpha;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&alpha);
	if(mianji(a,b,c,d,alpha)==0){
		printf("Invalid input\n");
	}else{
		printf("%.4lf\n",mianji(a,b,c,d,alpha));
	}
	return 0;
}
int main()
{
	double a,b,c,d,e,f,s,t,S;
	double area(double);
	scanf("%lf%lf%lf%lf%lf", &a,&b,&c,&d,&e);
	f=e*PI/360;
	s=(a+b+c+d)/2;
	t=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f)*cos(f);
	if(t<0)
		printf("Invalid input");
	else{
		S=area(t);
		printf("%.4lf", S);}
	return 0;
}

double area(double t)
{
	double S;
	S = sqrt(t); 
	return S;
}
int main()
{
	float a,b,c,d,e,s,S,t;
	scanf("%f",&a);
	scanf("%f",&b);
	scanf("%f",&c);
    scanf("%f",&d);
	scanf("%f",&e);
	s=(a+b+c+d)/2.0;
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/2/180*PI)*cos(e/2/180*PI));
	t=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/2/180*PI)*cos(e/2/180*PI);
	if (t>0)
	   printf("%.4f\n",S);
	else
		printf("Invalid input");
	return 0;
}
int main()
{
	double a;
	double b;
	double c;
	double d;
	double e;
	double S;
	double s;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	e=e/180*3.1415926;
	s = (a+b+c+d)/2;

	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(pow(cos(e/2),2)));
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(pow(cos(e/2),2)))<0)
	{
		printf("Invalid input");
	}
	else
	{
		
		printf("%.4lf",S);
	}
	return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d,t,s,p;
	scanf("%lf",&a);
    scanf("%lf",&b);
    scanf("%lf",&c);
    scanf("%lf",&d);
    scanf("%lf",&t);
	p=(0.5*(a+b+c+d)-a)*(0.5*(a+b+c+d)-b)*(0.5*(a+b+c+d)-c)*(0.5*(a+b+c+d)-d) - a*b*c*d*cos(t/360*3.1415926)*cos(t/360*3.1415926);
	if(p>=0)
	{
	s=sqrt(p);
	printf("%.4lf\n",s);
	}
	else 
		printf("Invalid input\n");
	return 0;
}
int main(){
	double a,b,c,d,e,s,m,t;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&e);
		m=(a+b+c+d)/2;
		t=(m-a)*(m-b)*(m-c)*(m-d)-a*b*c*d*cos(e/2*(3.1415926/180))*cos(e/2*(3.1415926/180));
			if(t>0){
	s=sqrt(t);
	printf("%.4lf",s);
			}else if(t<0){
				printf("Invalid input");
			}
			return 0;
}
int main()
{
	double a,b,c,d,e,f,s;
	double squar;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(double)(a+b+c+d)/2;
	f=(double)e/360*PI;
	squar=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(f),2));
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(e),2))>=0)
	{
	printf("%.4lf\n",squar);
	}
	else
	{
		printf("Invalid input");
	}
	return 0;
    
}