semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	double a,b,c,d,e,s,S,f,D;

	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2; 
	f=e*3.1415926/(2*180);
    D=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f)*cos(f);
    if(D>=0)
	{
	    S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f)*cos(f));	
		printf("%.4lf",S);
	}
	if(D<0)
	{
		printf("Invalid input");
	}
return 0;
}
int main()
{
	double A,B,C,D,E,F;
	double s(double a,double b,double c,double d,double e);
	scanf("%lf%lf%lf%lf%lf",&A,&B,&C,&D,&E);
	F=s(A,B,C,D,E);
	if (F==0)
		printf("Invalid input");
	else
	    printf("%.4lf",F);
	return 0;
}
double s(double a,double b,double c,double d,double e)
{
	double g,h,z;
	g=(a+b+c+d)/2;
	h=e/360*PI;
	if (((g-a)*(g-b)*(g-c)*(g-d))>=0)
		z=sqrt((g-a)*(g-b)*(g-c)*(g-d)-a*b*c*d*(cos(h))*(cos(h)));
	else
		z=0;
	return z;
}
int main(int argc, char* argv[])
{
	double a,b,c,d,m,n;
	
	scanf("%lf\n%lf\n%lf\n%lf\n%lf\n",&a,&b,&c,&d,&n);
    double s=(a+c+d+b)/2;
	m=(n/360)*p;
	double S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(m)*cos(m));
         if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(m)*cos(m)>=0)
            {
	     printf("%.4f",S);
            }
         else
            {
            printf("Invalid input");
            }
	return 0;
}
double S(double a,double b,double c,double d,double m);
double max(double a,double b,double c,double d);
int main(int argc, char* argv[])
{
	double a,b,c,d,m,ans;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&m);
	if(max(a,b,c,d)<(a+b+c+d)/2)
	{
		m=m*3.1415926/180/2;
		ans=S(a,b,c,d,m);
		printf("%.4lf",ans);
	}
	else printf("Invalid input");
	return 0;
}
double S(double a,double b,double c,double d,double m)
{
	double S=0;
	S=sqrt(((a+b+c+d)/2-a)*((a+b+c+d)/2-b)*((a+b+c+d)/2-c)*((a+b+c+d)/2-d)-a*b*c*d*cos(m)*cos(m));
	return S;
}
double max(double a,double b,double c,double d)
{
	if(a<b)
	{
		a=b;
	}
	if(c<d)
	{
		c=d;
	}
	if(a<c)
	{
		a=c;
	}
	return a;
}
double s,final;
void main()
{
        double a,b,c,d,aa;
        void four(double,double,double,double,double,double);
        scanf("%lf",&a);
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&aa);
        s=(a+b+c+d)/2;
        aa=aa/360*3.1415926;
		four(a,b,c,d,s,aa);
		

}

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

     else  
	 {
		 S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*p); 

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

scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
s=(a+b+c+d)/2.0;
if (((s-a)*(s-b)*(s-c)*(s-d))<=0) {
	printf("Invalid input\n");
}
else{
S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(PI*e/360.0)*cos(PI*e/360.0)); 
printf("%.4lf\n",S);
}
return 0;
}
double S(double,double,double,double,double);
int main()
{
    double a,b,c,d,jiaodu,pingjun,hudu,mianji,genhaonei,PI=3.1415926;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&jiaodu);
    hudu=jiaodu*2*PI/360/2;
    pingjun=(a+b+c+d)/2;
    S(a,b,c,d,hudu);
    return 0;
}
double S(double a,double b,double c,double d,double hudu)
{    double pingjun,mianji,genhaonei;
     pingjun=(a+b+c+d)/2;
     genhaonei=(pingjun-a)*(pingjun-b)*(pingjun-c)*(pingjun-d) - a*b*c*d*cos(hudu)*cos(hudu);
     if(genhaonei<0)
	 {printf("Invalid input");}
     else 
	 {mianji=sqrt(genhaonei);
     printf("%.4lf",mianji);}
     return 0;
}
double s(double a,double b,double c,double d,double q);
void main()
{
	double a,b,c,d,q,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&q);
	S=s(a,b,c,d,q);
	if (S==-1) printf("Invalid input");
	else printf("%.4f",S);
}
double s(double a,double b,double c,double d,double q)
{
   double m,angle,r,n;
   angle=q/360*3.1415926;
   m=(a+b+c+d)/2;
   n=(m-a)*(m-b)*(m-c)*(m-d)-a*b*c*d*cos(angle)*cos(angle);
   if(n<0)  r=-1;
   else {r=sqrt(n);}
   return r;
}
int main()
{
    float a,b,c,d,e;
    float s;
    float m,n,p,q;
    float t;
    scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
    s=a+b+c+d;
    s=s/2;
    m=s-a;
    n=s-b;
    p=s-c;
    q=s-d;
    t=m*n*p*q-a*b*c*d*(cos(e*PI/360.0))*(cos(e*PI/360.0));
    if (t<0)
    printf("Invalid input");
    else
    {
        t=sqrt(t);
        printf("%.4f",t);
    }
    return 0;
}
int main(int argc, char* argv[])
{   double a,b,c,d,s,e,f,g,PI=3.1415926,S;
    scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&e);
    f=e/360.0*PI;
    s=1.0/2.0*(a+b+c+d);
	g=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f);
    if(g<0){
		printf("Invalid input");
	}
	else{
		S=sqrt(g);
		printf("%.4f",S);
    }
    
	return 0;
}
double s(double a,double b,double c,double d,double f);
int main()
{
	double a,b,c,d,e,f;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	f=e*3.1415926/180;
	if(s(a,b,c,d,f)==-1)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4lf",s(a,b,c,d,f));
	}

}
double s(double a,double b,double c,double d,double f)
{
	double p,t,m,n;
	m=f/2;
	t=(a+b+c+d)/2;
	n=(t-a)*(t-b)*(t-c)*(t-d) - a*b*c*d*cos(m)*cos(m);
	if(n>=0)
	{
		p=sqrt(n);
	    return(p);
	}
	else
	{
		return(-1);
	}
}
int main()
{
	double a,b,c,d,e,s,x;
	scanf("%lf\n%lf\n%lf\n%lf\n",&a,&b,&c,&d);
	scanf("%lf",&x);
	e=a/2+b/2+c/2+d/2;
	s=sqrt((e-a)*(e-b)*(e-c)*(e-d)-a*b*c*d*((cos(x/180*PI)+1)/2));
	if((e-a)*(e-b)*(e-c)*(e-d)-a*b*c*d*((cos(x/180*PI)+1)/2)<0)
		printf("Invalid input");
	else
	printf("%.4lf",s);
	return 0;
}
int main()
{
	double a,b,c,d,e,f,t,h,s,m,z;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&m);
	f=3.1415926;
	e=(a+b+c+d)*1.0/2;
	
	h=m*f/360;
	
	t=a*b*c*d*cos(h)*cos(h);
	z=(e-a)*(e-b)*(e-c)*(e-d)-t;
	if(z>0){
	s=sqrt((e-a)*(e-b)*(e-c)*(e-d)-t);
	printf("%.4lf\n",s);}
	else
		printf("Invalid input");
	return 0;}
double a,b,c,d,o;
double s(double a,double b,double c,double d,double o)
{
	double y,z,w;
	y=o*PI/360;
	z=(a+b+c+d)/2;
	w=(z-a)*(z-b)*(z-c)*(z-d)-a*b*c*d*cos(y)*cos(y);
	if(w<0) return(-1);
	else return (double)sqrt(w);
}
void main()
{
	double t;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&o);
	t=s(a,b,c,d,o);
	if(t==-1) printf("Invalid input");
	else printf("%.4lf",t);
}
double pai=3.1415926;
void main()
{
	double a, b, c, d, x, y_hudu;
	double s, S;
	scanf("%lf", &a);
	scanf("%lf", &b);
	scanf("%lf", &c);
	scanf("%lf", &d);
	scanf("%lf", &x);
	s = (a+b+c+d)/2;
	y_hudu=(x/360)*pai;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(y_hudu)*cos(y_hudu)<0) printf("Invalid input");
	else {S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(y_hudu)*cos(y_hudu));printf("%.4f",S);};
}
double area(double a,double b,double c,double d,double jiaodu){
	double s,delta,area,t;
	t=PI*jiaodu/360.0;
	s=(a+b+c+d)/2;
	delta=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(t)*cos(t);
	if(delta<0){
		return -1;
	}
	if(delta>=0){
		area=sqrt(delta);
		return area;
	}
}
int main()
{
	double a,b,c,d,jiaodu;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&jiaodu);
	if(area(a,b,c,d,jiaodu)==-1){
		printf("Invalid input\n");
	}else{
		printf("%.4lf\n",area(a,b,c,d,jiaodu));
	}
	return 0;
}
int main()
{
	float PI=3.1415926;
	float a,b,c,d,y;
	scanf("%f",&a);
	scanf("%f",&b);
	scanf("%f",&c);
	scanf("%f",&d);
	scanf("%f",&y);
	double x=y/2.0;
	double s=(a+b+c+d)/2;
    double ss=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x*PI/180)*cos(x*PI/180);
	if(ss<0)
	{
		printf("Invalid input\n");
	}
	else
	{
		double mianji=sqrt(ss);
		printf("%.4f\n",mianji);
	}
	return 1;
}
int main()
{   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;

}
void main()
{double SS(double a,double b,double c,double d,double jiao);
double a,b,c,d,jiao,s,j,pi=3.1415926,mianji;
scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&jiao);
s=1.0/2.0*(a+b+c+d);
j=jiao*pi/360.0;
if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(j)*cos(j))<0)
printf("Invalid input");
else {mianji=SS(a,b,c,d,jiao);printf("%.4lf",mianji);}
}
double SS(double a,double b,double c,double d,double jiao)
{double j,s,mianji,pi=3.1415926;
s=1.0/2.0*(a+b+c+d);
j=jiao*pi/360.0;
mianji=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(j)*cos(j)); 
return(mianji);
}
double m(double a,double b,double c,double d,double e)
{
	double pi,s,sq;
	s=(a+b+c+d)/2;
	pi=3.1415926;
	sq=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(pi*e/360)*cos(pi*e/360));
	return(sq);
}

void main()
{
	double m(double a,double b,double c,double d,double e);
	double a,b,c,d,e,p,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)<0)
		printf("Invalid input");
	else
	{p=m(a,b,c,d,e);
	printf("%.4lf\n",p);}
}
double area1(double a,double b,double c,double d,double j);
int main()
{  
	double e,f,g,h,i,j,y;
	scanf("%lf%lf%lf%lf%lf",&e,&f,&g,&h,&i);
	if(i>0&&i<360){
	    j=PI*i/360;
	    y=area1(e,f,g,h,j);
	    if(y!=-1){
	    printf("%.4lf",y);
		}else{
	    	printf("Invalid input");
		}
	}
	return 0;
}double area1(double a,double b,double c,double d,double j)
{
	double s,S;
	s=(a+b+c+d)/2.0;
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(j)*cos(j));
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(j)*cos(j)<0){S=-1;}
	return S;
}
double PI=3.1415926;
double area(double a,double b,double c,double d,double e);
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*cos(e/360*PI)*cos(e/360*PI)<0)
	{printf("Invalid input");
	}
	else
	{S=area(a,b,c,d,e);
    printf("%.4lf",S);
	}
    return 0;
}
double area(double a,double b,double c,double d,double e){
	double S,s;
    s=(a+b+c+d)/2;
    S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*PI)*cos(e/360*PI));
    return S;
}
double sqare(double a,double b,double c,double d,double angle);
void main()
{
	double a,b,c,d,angle;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
	double s=sqare(a,b,c,d,angle);
	if(sqare(a,b,c,d,angle)==-1)
		printf("Invalid input\n");
	else
		printf("%.4lf\n",s);
}

double sqare(double a,double b,double c,double d,double angle)
{
	double sq,s,alfa;
	alfa=PI*angle/360;
	s=(a+b+c+d)/2;
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(alfa),2))<0)
		return -1;
	else
	{
		sq=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(alfa),2));
		return sq;
	}
}
int main()
{
double a,b,c,d,s,S,e;
double m,n;
scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&m);
n = 3.1415926*m/360;
s = (a+b+c+d)/2;
e = ((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(n)*cos(n)); 
if (e>=0)
{
S = sqrt(e);
printf("%.4lf",S);
}
else{
printf("Invalid input");
}
return 0;
}
int main()
{
	double a,b,c,d,s,S,k,e;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&k);
	k=k/2;
	k=k/180*PI;
	s=(a+b+c+d)/2;
	e=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(k)*cos(k);
	if(e<0)
		printf("Invalid input");
	else
	{S = sqrt(e); 
	printf("%.4f",S);
	}
	return 0;
}
//struct
main()
{
    float a,b,c,d,e;
    scanf("%f",&a);
    scanf("%f",&b);
    scanf("%f",&c);
    scanf("%f",&d);
    scanf("%f",&e);
    double r;
    r=e/360*3.1415926;
    float s,S;
    s = (a+b+c+d)/2;
    double w;
    w=cos(r);
    if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*w*w)>=0)
    {
        S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*w*w);
    printf("%.4f",S);
    }
    else
    printf("Invalid input");

}
int main(int argc, char* argv[])
{
    double a,b,c,d,t,s,S,h;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&t);
	s = 0.5*(a+b+c+d); 
    h=(t/180.0)*3.1415926;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(h/2)*cos(h/2)<0)
	    printf("Invalid input\n");
	else
	{
	    S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(h/2)*cos(h/2));
	    printf("%.4f",S);
	}
	return 0;
}
double f(double a,double b,double c,double d,double r)
{
    double s,s1,s2,co;
    s=0.5*(a+b+c+d);
	r=r/180;
	r=r/2;
	r=r*PI;
	co=cos(r);
	s1=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*co*co;
	if(s1<0) return 0;
	s2=sqrt(s1);
    return (s2);
}
int main()
{
    double a,b,c,d,s1;
    double r,s;
    scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&r);
    s1=f(a,b,c,d,r);
    if(s1==0) printf("Invalid input");
    else
    printf("%.4f",s1);
}
int main(int argc, char* argv[])
{
    double a, b, c, d, e, f, s, S, g;
	scanf("%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e);
    #define  pi  3.1415926
	s=1.0/2*(a+b+c+d);
         f=(e/2)*pi/180;	
	g = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f)*cos(f);
	if (g>0)
	{
	S = sqrt(g); 
    printf("%.4lf\n", S);
	}
	else
	{
		printf("Invalid input\n");
	}
	return 0;
}
int main()
{
	double a,b,c,d,s,e,S1;
	scanf("%lf",&a);
	scanf("%lf",&b);
    scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	s=(a+b+c+d)/2;
    S1=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*PI)*cos(e/360*PI));
	if(S1>=0)
	     printf("%.4lf",sqrt(S1));
             else
              printf("Invalid input");
	
}
double PI=3.1415926;
double area(double a,double b,double c,double d,double e);
int main(){
	double x,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(e/2*PI/180)*cos(e/2*PI/180)>=0){
    x=area(a,b,c,d,e);
	printf("%.4lf",x);
	}else{
		printf("Invalid input");
	}
return 0;
}
double area(double a,double b,double c,double d,double e){
	double S;
	double s;
	double PI=3.1415926;
	s=(a+b+c+d)/2;
    S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e/2*PI/180)*cos(e/2*PI/180));
	return S;
}
int main()
{

	double a,b,c,d,t,s,f,n,x;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&t);
	s =(double) 1/2*(a+b+c+d);
	n=(double)3.1415926*2*t/360;
    x=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(1+cos(n))/2;
	if (x>=0)
	{
	f=(double) sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(1+cos(n))/2); 
	printf("%.4lf",f);
	}
	else printf("Invalid input");
	return 0;
}
double a,b,c,d,angle,S,s;
int main(int argc, char* argv[])
{
	double square(double x1,double x2,double x3,double x4,double beta);
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
    angle=angle/180*PI;
	s=(a+b+c+d)/2; 
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle/2)*cos(angle/2)<0){
	printf("Invalid input");}
	else printf("%.4lf",square(a,b,c,d,angle));

	return 0;
}
double square(double x1,double x2,double x3,double x4,double beta){
	S=sqrt((s-x1)*(s-x2)*(s-x3)*(s-x4)-x1*x2*x3*x4*cos(beta/2)*cos(beta/2));
	return S;
}
double s(double a,double b,double c,double d,double r)
{
	double result;
	result=((a+b+c+d)/2-a)*((a+b+c+d)/2-b)*((a+b+c+d)/2-c)*((a+b+c+d)/2-d)-a*b*c*d*cos(3.1415926/180*r/2)*cos(3.1415926/180*r/2);
	if(result>=0)
	result=sqrt(((a+b+c+d)/2-a)*((a+b+c+d)/2-b)*((a+b+c+d)/2-c)*((a+b+c+d)/2-d)-a*b*c*d*cos(3.1415926/180*r/2)*cos(3.1415926/180*r/2));
	return result;
}
int main()
{                             
	double mj, a, b, c, d, r;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&r);
	mj=s(a, b, c, d ,r);
	if (mj>=0)
		printf("%.4lf",mj);
	else 
		printf("Invalid input");
	return 0;
}
//??????????????a?b?c?d????????2?,?????? 
//S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos2?); 
//??s = (a+b+c+d)/2; 
//?????????????????????????????????????????
//????? 
//?????????????????????????? 
//???????0?360????????????????????????
//????4???? 
//???????????????????Invalid input????
//?? 
//cos()??????????, PI = 3.1415926?????double???
main()
{
      double a,b,c,d,alfa1,s;
      scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&alfa1);
      double alfa2=(alfa1/2)*(PI)/180;
      s=(a+b+c+d)/2; 
      double delta= (s-a)*(s-b)*(s-c)*(s-d);
      if(delta<0||a<0||b<0||c<0||d<0||alfa1<=0||alfa1>=360)printf("Invalid input\n"); 
      else 
      {
           double S=delta-a*b*c*d*cos(alfa2)*cos(alfa2);
           if (S<=0)printf("Invalid input\n"); 
           else printf("%.4lf",sqrt(S)); 
      } 
      
      
       
       
}
double Area(double a, double b, double c, double d, double alpha);

int main()
{
	double a, b, c, d, alpha0, area;
	scanf("%lf %lf %lf %lf %lf", &a, &b, &c, &d, &alpha0);
	area = Area(a, b, c, d, alpha0*(PI/360));
	if (area==-1)
		printf("Invalid input\n");
	else
		printf("%0.4lf\n", area);
	return 0;
}

double Area(double a, double b, double c, double d, double alpha)
{
	double s, sqarea, area;
	s = 0.5*(a+b+c+d); 
	sqarea = (s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(alpha),2);
	if (sqarea>=0)
		area = sqrt(sqarea);
	else
		return -1;
	return area;
}
double Area(double a,double b,double c,double d,double s,double y);
int main()
{
     double a,b,c,d,x,y,s,S;
     scanf("%lf",&a);
     scanf("%lf",&b);
     scanf("%lf",&c);
     scanf("%lf",&d);
     scanf("%lf",&x);
     s=(a+b+c+d)/2;
     y=PI*(x/2)/180;
     if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(y)*cos(y))<0){
                                 printf("Invalid input\n");
                                 }else{
                                     S=Area(a,b,c,d,s,y);
                                     printf("%.4lf\n",S);
                                     }
     return 0;
}
double Area(double a,double b,double c,double d,double s,double y){
     double S;
     S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(y)*cos(y));
     return S;
}
int main()
{
		double a,b,c,d,e;
		scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
		double n=(a+b+c+d)/2;
		double p=cos((e*3.1415926)/360);
		double m=(n-a)*(n-b)*(n-c)*(n-d);
	if(m<0)
	{
		printf("Invalid input");
	}
	else
	{
      double S=sqrt(m-(a*b*c*d*p*p));
		printf("%.4lf",S);
	}
		return 0;
	}
main()
{
    double a,b,c,d,angle,pi,alpha;
      scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
      pi=3.1415926;
      alpha=angle*pi/360;
      if(angle==0||angle==180)
      printf("Invalid input");
      else
      {
    double area,s;
      s=(a+b+c+d)/2;
      area=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(alpha)*cos(alpha));
      printf("%.4lf",area);
      }
      getchar();
      getchar();
    }
double S(double a,double b,double c,double d,double e);

int main(){
	double bian[4],jiao,banjiao;
	double z;
	int i;
	for(i=0;i<4;i++){
		scanf("%lf",&bian[i]);
	}
	scanf("%lf",&jiao);
	banjiao=jiao/360.0*PI;
	z=S(bian[1],bian[2],bian[3],bian[0],banjiao);
	if(z>0){
		printf("%.4lf",z);
	}else{
		printf("Invalid input");
	}
	return 0;
}
double S(double a,double b,double c,double d,double e){
	double jieguo,s,zhi;
	s=(a+b+c+d)/2.0;
	zhi=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(e),2);
	jieguo=sqrt(zhi);
	
	return(jieguo);
}
void main()
{
	double a=0,b=0,c=0,d=0,s=0,S_1=0,S_2=0,alpha_2=0;

	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&alpha_2);
	s=(a+b+c+d)/2;
	S_2=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(alpha_2/360*PI)*cos(alpha_2/360*PI);

	if(S_2<0)
		{printf("Invalid input\n");}
	else
	{
		S_1=sqrt(S_2);
		printf("%.4f",S_1);
	}
}
main()
{
      double a,b,c,d,s,e,n,m;
      scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
      s=(a+b+c+d)/2;
      m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*3.141592653)*cos(e/360*3.141592653);
      if(m<0)printf("Invalid input\n");
      else if(m>=0)
      printf("%.4lf",sqrt(m));
}
double a[4],S,j,k=0;
int i;
const double Pi=3.1415926;
int main(void)
{
    for (i=0;i<4;i++)
    {
        scanf("%lf",&a[i]);
        k=k+a[i]/2;
        printf("\n");
    }
    scanf("%lf",&j);
    S=((k-a[0])*(k-a[1])*(k-a[2])*(k-a[3]) - a[0]*a[1]*a[2]*a[3]*cos(j/360*Pi)*cos(j/360*Pi));
    if (S>=0)
        printf("%.4f",sqrt(S));
    else
        printf("Invalid input");
return 0;
}
int main(int argc, char* argv[])
{
	float a,b,c,d;
	float alf;
	double halfa;
	float s;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&alf);
	s=(a+b+c+d)/2;
	halfa=p*alf/360;
	double S;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(halfa),2)>=0){
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(halfa),2));
	printf("%.4f",S);
	}
	else 
		printf("Invalid input");
	return 0;
}
double area(double a,double b,double c,double d,double e);
int main(){
	double a,b,c,d,e,f,s,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
	f=e/180*PI/2;
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f))*cos(f)<0){
		printf("Invalid input");}
	else{

	S=area(a,b,c,d,e);
	printf("%.4lf",S);
	}
	return 0;
	}
	double area(double a,double b,double c,double d,double e){
	    double f,s,S;
		s=(a+b+c+d)/2;
		f=e/180*PI/2;
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f));
		return S;
	}
double ji(double a,double b,double c,double d,double jiao);
int main()
{
	double x,y,z,k,du,guo;
	scanf("%lf%lf%lf%lf%lf",&x,&y,&z,&k,&du);
	if((guo=ji(x,y,z,k,du))!=0)
	printf("%.4lf",guo);
	return 0;
}
double ji(double a,double b,double c,double d,double jiao)
{
	double s=0,S;
	S=(a+b+c+d)/2.0;
	jiao=jiao/360.0*PI;
	if(sqrt((S-a)*(S-b)*(S-c)*(S-d) - a*b*c*d*cos(jiao)*cos(jiao))>=0)
		s= sqrt((S-a)*(S-b)*(S-c)*(S-d) - a*b*c*d*cos(jiao)*cos(jiao)); 
	else
	{
		printf("Invalid input");
		return 0;
	}
	return s;
}
double f(double a,double b,double c,double d,double A)
{double s,S,M;
  s=(a+b+c+d)/2;
  M=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(A*3.1415926/360)*cos(A*3.1415926/360);
  if(M<0) S=-1;
 else S=sqrt(M); 
  return(S);
}
void main()
{ 
	double f(double a,double b,double c,double d,double A);
	double a,b,c,d,A,x;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&A);
	x=f(a,b,c,d,A);
	if(x<0) printf("Invalid input");
	else printf("%.4lf",x);
}
int main()
{
	double a,b,c,d,r,w,s,S;
	a=b=c=d=r=0;
	r>0&&r<360;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&r);
	s=(a+b+c+d)/2;
	w=3.1415926*r/360;
	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(w)*cos(w));
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(w)*cos(w))<0)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4lf",S);
	}
	return 0;
}