semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
double space(double l1,double l2,double l3,double l4,double a)
{
	double l0,pi=3.1415926;
	l0=(l1+l2+l3+l4)/2;
	return (sqrt((l0-l1)*(l0-l2)*(l0-l3)*(l0-l4)-l1*l2*l3*l4*cos(a*pi/360)*cos(a*pi/360)) );
}

int main ( )
{
	double l1,l2,l3,l4,a,l0,pi=3.1415926;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&l1,&l2,&l3,&l4,&a);
	l0=(l1+l2+l3+l4)/2;
	if((l0-l1)*(l0-l2)*(l0-l3)*(l0-l4)-l1*l2*l3*l4*cos(a*pi/360)*cos(a*pi/360)>0)
		printf("%.4lf\n",space(l1,l2,l3,l4,a));
	else
		printf("Invalid input\n");
	return 0;
}
double PI=3.1415926;
double f(double a,double b,double c,double d,double alpha)
{
 double s=(a+b+c+d)/2;
double tmp=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(alpha*PI/360),2));
if (tmp<0)
return -1;
else 
return sqrt(tmp);
}
int main()
{
 double a,b,c,d,alpha;
 scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&alpha);
if (f(a,b,c,d,alpha)<0)
printf("Invalid input");
else
printf("%.4lf",f(a,b,c,d,alpha));
}
int main (int argc, char *argv[])
{
  double a,b,c,d,e;
  double s=0;
  double S=0;
  scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
  s=(a+b+c+d)*(1.0/2);
  S= sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(e*3.1415926/360),2));
  if(0<=(s-a)*(s-b)*(s-c)*(s-d))
  { 
     printf("%.4lf\n",S);
  }
  else
  {
      printf("Invalid input");
  }
  return 0;
}
double s(double a,double b,double c,double d,double du); 
int main()
{
	double a,b,c,d,du,s2;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&du);
	s2=s(a,b,c,d,du);
	if(s2==0)
		printf("Invalid input");
	else
		printf("%.4f",s2);
	return 0;
}
double s(double a,double b,double c,double d,double du)
{
	double ps,ss,rad;
	rad=du*PI/360;
	ss=(a+b+c+d)/2;
	if(((ss-a)*(ss-b)*(ss-c)*(ss-d)-a*b*c*d*cos(rad)*cos(rad))<0)
		return 0;
	else
	{
		ps=sqrt((ss-a)*(ss-b)*(ss-c)*(ss-d)-a*b*c*d*cos(rad)*cos(rad));
		return ps;
	}

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

double squ(double a,double b,double c,double d,double e)
{
	double s,m,n,f;
	s=(a+b+c+d)/2;
	f=e*3.1415926/360;
	n=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f);
	m=sqrt(n);
	return (m);
}
int main()
{
	double a,b,c,d,e,s,S,t,f;
    #define PI 3.1415926
	e=f*PI/180;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&f);
	s=(a+b+c+d)/2;
	e=f*PI/180;
	t=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e/2)*cos(e/2);
	if(t<0){
		printf("Invalid input");
	}
	else if(t>=0){
		S=sqrt(t);
		printf("%.4lf",S);
	}
	return 0;
}
int main ()
{
	double a,b,c,d,x,s,y,mj;
	double const pi=3.1415926;
	cin>>a>>b>>c>>d>>x;
	s=(a+b+c+d)/2;
	 y=x/360.0*pi;
	 if ((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y)<0)
		 cout<<"Invalid input"<<endl;
	 else
		 {
		 mj=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y));
		cout<<fixed<<setprecision(4)<<mj<<endl;
		 }
	return 0;
}
double mj(float a,float b,float c,float d,float z)
{
  double y,s;
  s=(a+b+c+d)/2;
	  y=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(z)*cos(z));
  return(y);
}
double main()
{
	double a,b,c,d,x,z,PI=3.1415926,S,s,m;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	s=(a+b+c+d)/2;
	z=((x/2)*PI)/180;
	m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(z)*cos(z);
	if(m<0)
		printf("Invalid input");
	else
	{
		S=mj(a,b,c,d,z);
	printf("%.4lf",S);
	}
}
int main()
{   
	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);
	double f=3.1415926*e/360;
	S=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(3.1415926*e/2/180)*cos(3.1415926*e/2/180))<0)
	printf("Invalid input\n");
	else
	printf("%.4lf",S);
	return 0;
}
int main(){
double   a,b,c,d;
double  al;
double s,s0;
scanf("%lf",&a);
scanf("%lf",&b);
scanf("%lf",&c);
scanf("%lf",&d);
s= (a+b+c+d)/2;
scanf("%lf",&al);
al=al/2;
al=3.1415926/180*al;
 
if (((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(al)*cos(al))<0) {
                            printf( "Invalid input");
                            }
                            else {
                                 s0= sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(al)*cos(al)); 
                                 printf("%.4lf",s0);
                                 }

return 0;
}
int main(int argc, char* argv[])
{

	double p, a, b, c, d, s, v, x;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&x);
	x=x*3.1415926/360;
	s= (a+b+c+d)/2; 	
	p=cos(x);
    v= sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*p*p);
	if(v>=0)
    printf("%6.4f\n", v);
    else
		printf("Invalid input");	
	return 0;

}
int main ()
{
  double a,b,c,d,s,e,m,n,f;
  double p=3.1415926;
  scanf("%lf",&a);
  scanf("%lf",&b);
  scanf("%lf",&c);
  scanf("%lf",&d);
  scanf("%lf",&e);
  e=e*p/360;
  s=(a+b+c+d)/2;
  m=(s-a)*(s-b)*(s-c)*(s-d);
  f=m-a*b*c*d*cos(e)*cos(e);
 
  if(f<0) 
  {
 printf("Invalid input");
  }
  else
  {  
    n=sqrt(f);
  printf("%.4lf",n);
  }
 return 0;
}
double square(double a,double b,double c,double d,double angel)
{
	double ans,s;
	s=(a+b+c+d)/2;
	ans=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angel)*cos(angel));
	return(ans);
}
void main()
{
	double square(double,double,double,double,double);
	double a,b,c,d,angel,ans,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angel);
	s=(a+b+c+d)/2;
	angel=angel*PI/360;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angel)*cos(angel)<0)
		printf("Invalid input");
	else
	{
		ans=square(a,b,c,d,angel);
	    printf("%.4f",ans);
	}
}
int main ()
{
    double a,b,c,d,e,s,ss;
    cin>>a>>b>>c>>d>>e;
    s=(a+b+c+d)/2;
    ss=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*3.1415926/360)*cos(e*3.1415926/360);
    if (ss>=0)
    {printf("%.4f",sqrt(ss));
}
else printf("Invalid input");
    }
void main()
{
	double square(double x,double y,double z,double w,double m);
	double S,a,b,c,d,M;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&M);
	S=square(a,b,c,d,M);
	if(S>0){
	    printf("%.4lf",sqrt(S));
	}else{
	    printf("Invalid input");
	}
}

double square(double x,double y,double z,double w,double m)
{
	double k;
	double SQUARE;
	k=(x+y+z+w)/2;
	double p,q;
	p=(k-x)*(k-y)*(k-z)*(k-w);
         double hudu;
	hudu=PI*m/180;
	q=x*y*z*w*cos(hudu/2)*cos(hudu/2);
	SQUARE=p-q;
	return SQUARE;
}
double mianji(double a,double b,double c,double d,double e){
	double s,m,n,p;
	s=1/2.0*(a+b+c+d);
	p=e/180*pai;
	m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(p/2.0),2);
	if(m<0)
		printf("Invalid input\n");
	else{
               n=sqrt(m);
	      return n;
         }
}
int main(){
	double a,b,c,d,e;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	double n;
	n=mianji(a,b,c,d,e);
	printf("%.4lf",n);
	return 0;
}
void main()
{   


	void S(double a,double b,double c,double d,double jiao);
	double a,b,c,d,jiao;
	scanf("%lf",&a);
    scanf("%lf",&b);
    scanf("%lf",&c);
    scanf("%lf",&d);
    scanf("%lf",&jiao);
    S(a,b,c,d,jiao);
	


}

   void S(double a,double b,double c,double d,double jiao)
   {    double PI,s,m;

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




	return 0;
}
double area(double a,double b,double c,double d,double e)
{
	double s,q,S;
	s=(a+b+c+d)/(2.0);
	q=cos(e*(3.1415926)/(180.0)/(2.0));
        return sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*q*q);
}
int main()
{
	double n1,n2,n3,n4,m;
	scanf("%lf%lf%lf%lf%lf",&n1,&n2,&n3,&n4,&m);
    if(area(n1,n2,n3,n4,m)>=0) 
	{
		printf("%.4lf",area(n1,n2,n3,n4,m));
	}
	else printf("Invalid input");
	return 0;
}
int main ()
{
    float a,b,c,d,k,s,x;
    int e;
    scanf("%f",&a);
    scanf("%f",&b);
    scanf("%f",&c);
    scanf("%f",&d);
    scanf("%d",&e);
    k=(float)e*pi/180;
    k=k/2;
    s=a+b+c+d;
    s=s/2;
    x=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k)*cos(k);
    if (x<0) printf("Invalid input\n");
    else printf("%.4f\n",sqrt(x));
    return 0;
}
int main()
{
	double a,b,c,d,s=0.00,n=0.00,m=0.00,j=0.00,k=0.00;
	scanf("%lf\n",&a);
	scanf("%lf\n",&b);
	scanf("%lf\n",&c);
	scanf("%lf\n",&d);
	scanf("%lf",&m);
	s=(a+b+c+d)/2;
    k=cos(m*3.1415926/360)*cos(m*3.1415926/360);
	n=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*k;
	if(n<0)
		printf("Invalid input");
	else
	{j=sqrt(n);
	printf("%.4f",j);}
	return 0;
}
int main(int argc, char* argv[])
{
float a,b,c,d;
double e,f,g,h,i,s;
scanf("%f%f%f%f%lf",&a,&b,&c,&d,&e);
s=(a+b+c+d)/2;
h=e/360*pi;
f=cos(h);
i=f*f;
if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*i<0)
printf("Invalid input\n");
else
{
g=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*i); 
printf("%.4f\n",g);
}
return 0;
}
float find(float a,float b,float c,float d,float p)
{
    float s=(a+b+c+d)/2,k,temp,q;
    q=p*asin(1)/180;
    temp=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(q)*cos(q);
    if(temp>=0)
    {
        k=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(q)*cos(q)); 
    }
    else
    {
        k=0;
    }
    return k;
}
int main()
{
    float a,b,c,d,p,k;
    scanf("%f",&a);
    scanf("%f",&b);
    scanf("%f",&c);
    scanf("%f",&d);
    scanf("%f",&p);
    k=find(a,b,c,d,p);
    if(k==0)
    {
        printf("Invalid input");
    }
    else
    {
        printf("%.4f",k);
    }
    return 0;
}
double mj(float a,float b,float c,float d,float e)
{
    
	double t,s,k;
    k=(double)3.1415926*e/360;
	s=(a+b+c+d)/2;
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k)*cos(k))<0)
	{
		t=-1;
	}
	else
    {
	t=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k)*cos(k));
	}
	return(t);
}
void main()
{

	double f;
    float a,b,c,d,e;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
	f=mj(a,b,c,d,e);
	if(f<0)
	{printf("Invalid input");}
	else
	{printf("%.4f",f);}
}
int main(int argc, char* argv[])
{
	double a,b,c,d,angle,s,area;
	double m;

	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
	
	s = (a+b+c+d)/2;
	angle=angle/720*2*PI;
	m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle)*cos(angle);

	if(m<0)
		printf("Invalid input");
	else
	{
		area=sqrt(m);
		printf("%.4lf\n",area);
	}

	return 0;
}
int main()
{
    double a,b,c,d,s,t,x,S;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
    s=(a+b+c+d)/2.0;
    t=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x/2*2*PI/360)*cos(x/2*2*PI/360);
    if(t>=0){
        S=sqrt(t);
        printf("%.4lf",S);
    }
    if(t<0){
        printf("Invalid input");
    }
return 0;
}
int main()
{
    int i;
    double a[4],c,s,S,l;
    for(i=0;i<4;i++)
    {
       scanf("%lf",&a[i]);
    }
    scanf("%lf",&c);
    c=c*PI/180;
    s=(a[0]+a[1]+a[2]+a[3])/2;
    l=(s-a[0])*(s-a[1])*(s-a[2])*(s-a[3])-a[0]*a[1]*a[2]*a[3]*cos(c/2)*cos(c/2);
    if(l<0)
       printf("Invalid input\n");
    else
    {
       S=sqrt(l); 
       printf("%.4lf\n",S);
    }
}
void main()
{
	double a[4],p,s=0,q,m;
	int i;
	for(i=0;i<4;i++)
	{
		scanf("%lf",&a[i]);
		s+=a[i];
	}
	s=s/2;
	scanf("%lf",&p);
	p=p*Pi/360;
	q=((s-a[0])*(s-a[2])*(s-a[3])*(s-a[1])-a[0]*a[1]*a[3]*a[2]*cos(p)*cos(p));
	if(q<0) 
	{
		printf("Invalid input");
		return;
	}
	else m=sqrt(q);
	printf("%.4lf",m);
}
int main()
{
	double s,a,b,c,d,k,m;
	cin>>a>>b>>c>>d>>k;
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow((cos(3.1415926*k/360)),2)<0)
		cout<<"Invalid input";
	else{
m = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow((cos(3.1415926*k/360)),2)); 
printf("%.4f",m);
	}
return 0;
}
int main()
{
    double a,b,c,d,s,e,S;
    scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
    s=(a+b+c+d)/2;
    double x,y;
    x=e*(3.1415926)/360;
    y=cos(x);
      if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*y*y)<0)
   { printf("Invalid input");}
        else
   { S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*y*y);
    printf("%.4lf",S);}
    getchar();
    getchar();
    return 0;
}
double S(double a, double b, double c, double d, double e)
{
    double s=(a+b+c+d)/2;
    double p=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(e),2);

    if(p<0)
        return -1;
    else
        return sqrt(p);
}

int main()
{
    double a, b, c, d, e, j;
    scanf("%lf%lf%lf%lf%lf", &a, &b, &c, &d, &j);

    e=j/2*PI/180;

    if(S(a, b, c, d, e)==-1)
        printf("Invalid input\n");
    else
        printf("%.4f\n", S(a, b, c, d, e));
 
    return 0;
}
int main()
{
	double a,b,c,d;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	double hh;
	scanf("%lf",&hh);
	double s;
	s = (a+b+c+d)/2;
	hh=hh/360*3.141592;
	hh=cos(hh);
	double S;
	double SS=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*hh*hh;
	if (SS<0)
	{
		printf("Invalid input");
		return 0;
	}
	S = sqrt(SS);
	printf ("%0.4lf",S);
	return 0;
	
}
int main()
{
	double a,b,c,d,e,z,s,S,L;
	double cos(double x);
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	z=e*PI/360;
	s=(a+b+c+d)/2;
	L=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(z)*cos(z);
	if(L<0)
	{
		printf("Invalid input\n");
    }
	else
	{
    S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(z)*cos(z));
	printf("%.4f\n",S);
	}
}
double S(double a, double b, double c, double d, double hudu)
{
	double s=(a+b+c+d)/2;
	double S2=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(hudu)*cos(hudu);
	if(S2<0){
		return 1;
	}else{
		return sqrt(S2);
	}
}
int main()
{
	double a,b,c,d,e;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	double hudu=e/360*PI;
	if(S(a,b,c,d,hudu)==1){
		printf("Invalid input");
	}else{
		printf("%.4lf",S(a,b,c,d,hudu));
	}
	return 0;
}
int main(){
	float a,b,c,d,e;
	scanf("%f",&a);
	scanf("%f",&b);
	scanf("%f",&c);
	scanf("%f",&d);
	scanf("%f",&e);
	double s,h;
	h=(((b+c+d-a)/2)*((a-b+c+d)/2)*((a+b-c+d)/2)*((a+b+c-d)/2)-a*b*c*d*(cos(e*3.1415926/360))*(cos(e*3.1415926/360)));
	if(h<0) printf("Invalid input");
	else{ s=sqrt(h); 
	printf("%.4f",s);}}
int main()
{
	double a,b,c,d,e,f,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
    s=0.5*(a+b+c+d);
	e=e/2*3.1415926/180;
	f=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e)*cos(e);
	if (f<0) 
	{printf("Invalid input");
	 return 0;
	}
	printf("%.4lf",sqrt(f));
	return 0;
}
double areo(double a,double b,double c,double d,double w)
      {double s=0.5*(a+b+c+d);
      s=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(w)*cos(w);
      if(s<0)
      return 0;
      else
      return sqrt(s);
      }
      main()
{
      double a,b,c,d,s,w,S;
      
      
      scanf("%lf",&a);
      scanf("%lf",&b);
      scanf("%lf",&c);
      scanf("%lf",&d);
      scanf("%lf",&w);
      w=3.1415926*w/180/2;
      s=0.5*(a+b+c+d);
      
      if(areo(a,b,c,d,w)==0)
      printf("Invalid input");
     else
      printf("%.4lf",areo(a,b,c,d,w));
      
      }
int main(){
	double a,b,c,d,e,g;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	g=e/180*PI;
    double f,s,S;
	s=(double)1/2*(a+b+c+d);
	f=(double)(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(g/2)*cos(g/2);
	if(f>=0){S=(double)sqrt(f);
	printf("%.4lf",S);}
	else {printf("Invalid input");}
	return 0;
}
double calarea(double a,double b,double c,double d,double alpha2);

int main() {
	double A,B,C,D,ALPHA2;
	double area;
	scanf("%lf%lf%lf%lf%lf",&A,&B,&C,&D,&ALPHA2);
	area=calarea(A,B,C,D,ALPHA2);
	if(area!=0){
		printf("%.4lf\n",area);
	}  
	return 0;
}

double calarea(double a,double b,double c,double d,double alpha2){
	double s,S,alpha;
	s=(double)(a+b+c+d)/2;
	alpha=((alpha2*PI)/(180*2));
	S=((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(alpha)*cos(alpha)); 
	if(S>0){
		return sqrt(S);
	}
	else {
		printf("Invalid input\n");
		return 0;
	}
}
int main()
{
	double a,b,c,d,tah,s,tot,tahc;
	int ta;
	scanf("%lf%lf%lf%lf%d",&a,&b,&c,&d,&ta);
	tah=((double)ta)/360*PI;
	s = 0.5*(a+b+c+d); 
	tahc=cos(tah);
	tot = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*tahc*tahc; 
	if (tot>=0)
		printf("%.4lf",sqrt(tot));
	else printf("Invalid input");
	return 0;
}
double S(double x,double y,double z,double k,double l);
int main()
{
	double a,b,c,d,e,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*cos((PI*e)/360)*cos((PI*e)/360))>0)
	{
       printf("%.4lf",S(a,b,c,d,e));
	}else
	{
		printf("Invalid input");
	}
	return 0;


}
double S(double x,double y,double z,double k,double l)
{
	double c,s;
	s = (x+y+z+k)/2; 
	c = sqrt((s-x)*(s-y)*(s-z)*(s-k) - x*y*z*k*cos((PI*l)/360)*cos((PI*l)/360)); 
	return(c);
    

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

int main(){
double a,b,c,d,alpha,s,sum;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&alpha);
s = (a+b+c+d)/2;
sum=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos2(alpha);
if(sum<0)
 printf("Invalid input\n");
else 
 printf("%.4lf\n",sqrt(sum));
}
int main(int argc, char* argv[])
{
	double a,b,c,d,p,q,s,y;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&p);
	s=0.5*(a+b+c+d);
	q=0.5*p/180*3.1415926;
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q))>=0){
		y=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q));
	    printf("%.4lf\n",y);
	}
	else{
		printf("Invalid input\n");
	}
	return 0;
}
int main()
{
	double a,b,c,d,alf,s,S;
	scanf("%lf", &a);
	scanf("%lf", &b);
	scanf("%lf", &c);
	scanf("%lf", &d);
	scanf("%lf", &alf);
	s=(a+b+c+d)/2;
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(alf/360*3.1415926)*cos(alf/360*3.1415926));
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(alf/360*3.1415926)*cos(alf/360*3.1415926)<0)
		printf("Invalid input");
	else 
	printf("%.4lf", S);
	return 0;
}
//?????????????????
int main()
{
         double mianji(double a,double b,double c,double d,double jiao);
	double a,b,c,d,jiao,shuchu;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&jiao);
	shuchu=mianji(a,b,c,d,jiao);
	if(shuchu==-1)                                 /*?????????????*/
		printf("Invalid input");
	else
		printf("%.4lf",shuchu);
	return 0;
}
//??????????????????
double mianji(double a,double b,double c,double d,double jiao)
{
	double result,hu,s,panduan;
	hu=jiao/180*PI/2;
	s=(a+b+c+d)/2;
	panduan=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(hu)*cos(hu);
	if(panduan<0)                                  /*????????????????*/
		result=-1;
	else
		result=sqrt(panduan);
	return result;
}
int main()
{
	double s,S,a,b,c,d,e,f,g;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2.0;
	f=PI*e/360.0;
	g=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f);
	if(g>0||g==0){
	    S=sqrt(g);
	    printf("%.4lf",S);
	}
	if(g<0)
        printf("Invalid input");
	return 0;
}
int main (int argc,char*argv[])
{
	double a,b,c,d,e,s,pi, f,t,N;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
    pi=3.1415926;
	f=e*pi/360;
	N=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f)*cos(f);
    t = sqrt(N); 
	if(N<0)
		printf("Invalid input\n");
	  
	else
	   printf("%.4lf",t);
	


	return 0;
}
int main(){
	double A,B,C,D,E;
	double f(double a,double b,double c,double d,double e);
	scanf("%lf%lf%lf%lf%lf",&A,&B,&C,&D,&E);
	double SS;
	SS=f(A,B,C,D,E);
	if(SS!=0){
		printf("%.4lf",SS);
	}
	return 0;
}
double f(double a,double b,double c,double d,double e){
	double S,s;
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*p/360)*cos(e*p/360)<0){
		printf("Invalid input");
		return 0;
	}
	else{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*p/360)*cos(e*p/360));
		return S;
	}
}
main()
{
      float a[4];
      float k;
      float c;
      int i;
      for(i=0;i<4;i++)
      {
                      scanf("%f",&a[i]);
      }
      scanf("%f",&c);
      c=2*3.1415926*c/360;
      k=(a[0]+a[1]+a[2]+a[3])/2;
      double s,sq;
      sq=(k-a[0])*(k-a[1])*(k-a[2])*(k-a[3]) - a[0]*a[1]*a[2]*a[3]*(double)cos(c/2)*(double)cos(c/2);
    
      if(sq<0)
      printf("Invalid input");
      else
      {
          s=sqrt(sq);
          printf("%.4f",s);
      }
    
}
int main(int argc, char* argv[])
{
	double a1,a2,a3,a4,b;
	double s,sum;
	scanf("%lf%lf%lf%lf%lf",&a1,&a2,&a3,&a4,&b);
    s=0.5*(a1+a2+a3+a4);
	sum=sqrt((s-a1)*(s-a2)*(s-a3)*(s-a4)-a1*a2*a3*a4*cos(b*3.1415926/360)*cos(b*3.1415926/360));
	if((s-a1)*(s-a2)*(s-a3)*(s-a4)<0)
		printf("Invalid input");
	else
	printf("%.4lf",sum);
	return 0;
}
int main()
{
	double a,b,c,d,pi=3.1415926,S,s,j,m;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&j);
	j=pi*j/360;
	s=(a+b+c+d)/2;
	m=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(j)*cos(j);
	if(m<0)printf("Invalid input");
	else
		{
			S=sqrt(m);
			printf("%.4lf\n",S);
		}
	return 0;
}
int main(int argc, char* argv[])
{   double a,b,c,d;
    int jiaohe;
    scanf("%lf%lf%lf%lf",&a,&b,&c,&d);	
	scanf("%d",&jiaohe);
    if(((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(((double)jiaohe/180/2)*3.1415926)*cos(((double)jiaohe/180/2)*3.1415926))<0){printf("Invalid input");}
	if(((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(((double)jiaohe/180/2)*3.1415926)*cos(((double)jiaohe/180/2)*3.1415926))>0)
	{	printf("%.4lf\n", sqrt((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(((double)jiaohe/180/2)*3.1415926)*cos(((double)jiaohe/180/2)*3.1415926)));}
	return 0;
}
int main(){
double a,b,c,d,e,n,s,x1,x2;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
s=(a+b+c+d)/2;
n=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos((e*PI)/360)*cos((e*PI)/360);
if(n>=0){
x1=1;
x2=(x1+n/x1)/2;
while(x2-x1>JINGDU||x1-x2>JINGDU){
x1=x2;
x2=(x1+n/x1)/2;
}
printf("%.4lf",x2);
}
else if(n<0){
printf("Invalid input");
}
return 0;
}
void 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.0;
e=e/2.0;
e=e*PI/180;
S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e)*cos(e));

if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e)*cos(e)>0)
printf("%.4lf\n", S);

else
printf("Invalid input\n");

}
int main()
{
	double s,S;
	double a,b,c,d,A,aerfa;
	double kaifang(double a,double b,double c,double d,double aerfa);
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&A);
	aerfa=A/180*PI/2;
	s=(a+b+c+d)/2;
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(aerfa)*cos(aerfa))<0)
		printf("Invalid input");
	else
	{
		S=kaifang(a,b,c,d,aerfa);
		printf("%.4lf\n",S);
	}
	return 0;
}

double kaifang(double a,double b,double c,double d,double aerfa)
{
	double s,S;
	s=(a+b+c+d)/2;
	while(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(aerfa)*cos(aerfa))>=0)
	{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(aerfa)*cos(aerfa));
		break;
	}
	return S;
}
void main()
{
	double f(double a,double b,double c,double d,double x);
	double a,b,c,d,x,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
    f(a,b,c,d,x);
}
   double f(double a,double b,double c,double d,double x)
   {
	   double y,s,S,PI=3.1415926;
       y=x/360*PI;
       s=(a+b+c+d)/2.0;
       S=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y);
	   if(S<0)
		   printf("Invalid input");
	  else
       
		printf("%.4lf",sqrt(S));
	  
   }