semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	double a[5],S,s,q,w;
	scanf("%lf%lf%lf%lf%lf",&(a[1]),&(a[2]),&(a[3]),&(a[4]),&(a[5]));
	s=(a[1]+a[2]+a[3]+a[4])/2;
	w=(a[5]*PI)/360;
	q=(s-a[1])*(s-a[2])*(s-a[3])*(s-a[4])-a[1]*a[2]*a[3]*a[4]*cos(w)*cos(w);
	if(q>=0)
	{
		S=sqrt(q);
		printf("%.4lf",S);
	}
	else
	{
		printf("Invalid input");
	}
	return 0;
}
main()
{float a,b,c,d,s,p,k,i,j,m,n,g;
 float pi=3.1415926;i=180;
 scanf("%f",&a);scanf("%f",&b); scanf("%f",&c); scanf("%f",&d); scanf("%f",&k);  
 s=(a+b+c+d)/2;
 j=(k/i)*pi;m=j/2;
 p=(cos(m))*(cos(m));
 n=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*p;
 if(n<0) printf("Invalid input");
 else {g=sqrt(n);
      printf("%.4f",g);
      
      }
 
}
float s2(float a,float b,float c,float d,float anglesum);

int main(int argc, char* argv[])
{
	float a,b,c,d,anglesum,s,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&anglesum);
	s=s2(a,b,c,d,anglesum);
	if(s<0){
		printf("Invalid input\n");
	}else{
		S=sqrt(s);
		printf("%.4lf",S);
	}
	return 0;
}

float s2(float a,float b,float c,float d,float anglesum)
{
	float s2,s;
	s=(a+b+c+d)/2;
	s2=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(anglesum*PI/360)*cos(anglesum*PI/360); 
	return s2;
}
void main()
{
	void mianji(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);
	mianji(a,b,c,d,e);
}

void mianji(double a,double b,double c,double d,double e)
{
	double s,genghaonei;
	s=(a+b+c+d)/2; 
	genghaonei=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*3.1415926)*cos(e/360*3.1415926);
	if(genghaonei<0)
		printf("Invalid input");
	else
	{
		double jieguo;
		jieguo=sqrt(genghaonei);
		printf("%.4lf",jieguo);
	}
}
double f(double a, double b, double c, double d, double e)
{
double s, S;
s=(a+b+c+d)/2;
e=e/180*3.1415926;
S=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/2)*cos(e/2);
return S;
}
void main()
{
	double nun;
	double a,b,c,d,e;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
	if(f(a,b,c,d,e)<0) 
	{
		printf("Invalid input");
	}
	else
	{
		nun=sqrt(f(a,b,c,d,e));
		printf("%.4lf",nun);
	}
}
float m(float,float,float,float,float);
void main()
{
float a,b,c,d,an,s;
scanf("%f%f%f%f%f",&a,&b,&c,&d,&an);
if(m(a,b,c,d,an)<0)
printf("Invalid input\n");
else 
{s=sqrt(m(a,b,c,d,an));
printf("%.4f\n",s);
}
}


float m(float a,float b,float c,float d,float an)
{float s,e;
e=(a+b+c+d)/2;
s=(e-a)*(e-b)*(e-c)*(e-d)-a*b*c*d*pow(cos(an*3.1415926/360),2);
return s;
}
double pi=3.1415926;
int main()
{
    double sq(double a,double b,double c,double d,double o);
    double a,b,c,d,j,o;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&j);
    double q,p,s;
    o=j*pi/180;
    o=o/2;
    s=(a+b+c+d)/2;
    p=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o)*cos(o);
    if(p<0){
            printf("Invalid input");
            }
    else {
          q=sq(a,b,c,d,o);
          printf("%.4f",q);
          }
    return 0;
}
double sq(double a,double b,double c,double d,double o)
{
      double s=0,g=0;
      s=(a+b+c+d)/2;
      g=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o)*cos(o));
      return g;
}
int main()
{
	double a,b,c,d,i;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&i);
    double s,m;
    s=(a+b+c+d)/2;
	double h = a*b*c*d*cos(i*PI/360)*cos(i*PI/360);
    m=(s-a)*(s-b)*(s-c)*(s-d)-h;
		if(m<0)
		{
			printf("Invalid input");
		}
		double S;
		if(m>=0){
		S = sqrt(m); 
	printf("%.4lf",S);
		}
	return 0;
}
void main()
{
	double a,b,c,d,q;
	double area(double a,double b,double c,double d,double q);
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&q);
	area(a,b,c,d,q);
}

double area(double a,double b,double c,double d,double q)
{ double s,panduan,are,t;
	t=q/(2*180)*PI;
	s=(a+b+d+c)/2;
	panduan=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(t)*cos(t);
	if (panduan<0)
		printf("Invalid input");
	else { are=sqrt(panduan);
	printf("%.4lf",are);
	}
  return(0);
}
int main()
{
	float a,b,c,d,e;
	double s,S,Q;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
	s = (double)(a+b+c+d)/2;
	Q = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(pow(cos(e*3.1415926/360),2));
	if (Q>=0){
		S = sqrt(Q);
		printf("%.4lf",S);
	}
	else
		printf("Invalid input");
	return 0;
}
int main()
{
	double a,b,c,d,e,A,s,S;
	scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
	scanf("%lf",&A);
	A=A/2/180*PI;
	e=cos(A);
	s = (a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*e*e<0)
		printf("Invalid input\n");
	else 
	{
		S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*e*e); 
		printf("%.4f",S);
	}	
	return 0;
}
int main(int argc, char* argv[])
{
	
	double a=0,b=0,c=0,d=0,n=0;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
    scanf("%lf",&n);
double	s=1.0/2*(a+b+c+d);    
double g=n/360*PI;
double f=cos(g);
double S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*f*f); 
if((s-a)*(s-b)*(s-c)*(s-d)<0){
	printf("Invalid input");}
else{
	printf("%.4f",S);};
	return 0;
}
double S(double a ,double b,double c,double d,double x);
int main()
{
	double a,b,c,d,x;
	double result;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	result = S(a,b,c,d,x);
	if(result<0)
	{
		printf("Invalid input\n");
	}
	else
	{
	printf("%.4lf\n",result);
	}
	return 0;
}

double S(double a,double b,double c,double d,double x)
{
	double result = 0;
	double s,y;
	s=(a+b+c+d)/2;
	y=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x/2/180*PI)*cos(x/2/180*PI);
	if(y<0)
		{
			result=-1;
		}
	else
		{
			result=sqrt(y);
		}
	return result;
}
int main()
{
    double a,b,c,d,angle,s,sqr;
    scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&angle);
    s = (a+b+c+d)/2;
    angle = (angle /180)*PI;
    sqr=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(angle/2)*cos(angle/2);
    if (sqr>0)
      {
          printf("%.4lf\n",sqrt(sqr));
      }
      else
      if (sqr<0)
      printf("Invalid input\n");
      else printf("0\n");

}
double S(double a,double b,double c,double d,double e);
int main()
{
	double a,b,c,d,e;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
    if(S(a,b,c,d,e)==-1) 
	{
		printf("Invalid input\n");
	}
	else 
	{
		printf("%.4lf",S(a,b,c,d,e));
	}
}
double S(double a,double b,double c,double d,double e)
{
	double s,f,t,m;
	s=(a+b+c+d)/2;
	f=e*3.1415926/(180*2);
	t=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f);
	if(t>=0) 
	{
		m=sqrt(t);
		return(m);
	}
	else 
	{
		return (-1);
	}
}
int main()
{
	double a,b,c,d,angel,sq;
	scanf("%lf %lf %lf %lf %lf", &a, &b, &c, &d, &angel);
	sq = (b+c+d-a)/2*(c+d+a-b)/2*(d+a+b-c)/2*(a+b+c-d)/2-a*b*c*d*pow(cos(angel/2*PI/180),2);
	if (sq<0) printf("Invalid input");
	else {
		sq = sqrt(sq);
		printf("%.4lf", sq);
	}
	return 0;
}
int main(int argc, char* argv[])
{
double a,b,c,d,e,s,S,f;
scanf("%lf",&a);
scanf("%lf",&b);
scanf("%lf",&c);
scanf("%lf",&d);
scanf("%lf",&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);
if (f>0)
{
	S = sqrt(f); 
printf("%.4lf",S);
}
else
printf("Invalid input");
}
int main()
{
	double s,a,b,c,d,o,S;
	scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
	scanf("%lf",&o);
	s=1.0/2.0*(a+b+c+d);
	if (((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o*3.1415926/180/2)*cos(o*3.1415926/180/2))<0)
	{printf("Invalid input");
	return 0;}
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o*3.1415926/180/2)*cos(o*3.1415926/180/2));
	printf("%.4lf\n",S);
	return 0;
}
int main()
{
	double a,b,c,d,s,ds;
	double e;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	e=(double)e*3.1415926/180;
	e=(double)e/2;
	s=(double)(a+b+c+d)/2;
	ds=(double)((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e)*cos(e));
	if(ds<0)
	{
		printf("Invalid input");
	}
	else
	{
		ds=sqrt(ds);
		printf("%.4lf",ds);
	}
	return 0;
}
int main()
{   double a,b,c,d,e,s;
    double ss(double a1,double b1,double c1,double d1,double e1);
         scanf("%lf",&a);
	scanf("%lf",&b); 
	scanf("%lf",&c);  
	scanf("%lf",&d);  
         scanf("%lf",&e);
	s=ss(a,b,c,d,e);
    if(s==-1){
		printf("Invalid input");
	}else{
     	         printf("%.4lf",s);
	}
	return 0;
}
    double ss(double a1,double b1,double c1,double d1,double e1)
	{  double S,s,n;
	   s=(a1+b1+c1+d1)/2;
	   e1=PI*e1/360;
	   n=(s-a1)*(s-b1)*(s-c1)*(s-d1)-a1*b1*c1*d1*cos(e1)*cos(e1); 
	   if(n>0){
	   S=sqrt(n);
	   return S;
	   }else if(n<0){
	   return -1;
	   }		
}
int main(){
	float a,b,c,d,m,jd;
	float s,S;
	scanf("%f %f %f %f",&a,&b,&c,&d);
	scanf("%f",&m);
	jd=m*PI/360;
	s=(a+b+c+d)/2;
	S=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(jd)*cos(jd);
	if (S<0)
		printf("Invalid input");
	else
		printf("%.4f\n",sqrt(S));
	return 0;
}
void main()
{   
        double f(double,double,double,double,double);
        double a,b,c,d,x,y,s;
        scanf("%lf",&a);
        scanf("%lf",&b);
        scanf("%lf",&c);
        scanf("%lf",&d);
        scanf("%lf",&x);
        y=f(a,b,c,d,x);
        if (y>=0)
               { s=sqrt (y);
                 printf("%.4lf",s);
                }
        else
               printf("Invalid input\n");
}
double f(double a,double b,double c,double d,double x)
{
        double s,y,PI=3.1415926;
        s=(a+b+c+d)/2;
        x=(x/360)*PI;
        y=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x));
        return(y);
}
void main()
{
	double a,b,c,d,j,s,S;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&j);
	j=j/360*3.1415926;
	j=cos(j);
	j=j*j*a*b*c*d;
	s=(a+b+c+d)/2;
	S=(s-a)*(s-b)*(s-c)*(s-d)-j;
	if(S<0) printf("Invalid input");
	else
	{
		S=sqrt(S);
		printf("%.4lf",S);
	}
}
/* Note:Your choice is C IDE */
void main()
{   double a,b,c,d,s;
	double ri,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&ri);
	ri*=3.1415926/180;
	ri/=2;
	s=(a+b+c+d)/2;
	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(ri)*cos(ri)); 
  if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(ri)*cos(ri)<0) printf("Invalid input");
   else printf("%.4f",S);}
main()
{     float a,b,c,d,oo,S;
      scanf("%f",&a);
      scanf("%f",&b);
      scanf("%f",&c);
      scanf("%f",&d);
      scanf("%f",&oo);
      float s=(a+b+c+d)/2;
      float o=(oo*3.1415926)/(2*180);
      if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*(cos(o))*(cos(o))<0)
      printf("Invalid input");
      else
      {S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*(cos(o))*(cos(o)));
       printf("%.4f",S);
      }      
    
}
int main(int argc, char* argv[])
{   
	double a,b,c,d,sum;
	double s,S;
	scanf ("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&sum);
	s=(a+b+c+d)/2;
	S=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(sum*3.1415926/360)*cos(sum*3.1415926/360);
	if(S>0)
	{
		printf("%.4lf",sqrt(S));
	}
	else
	{
		printf("Invalid input");
	}
}
double S(double x,double y,double z,double w,double m);
int main()
{
double a,b,c,d,e,f,genhaonei,mianji;
scanf ("%lf",&a);
scanf ("%lf",&b);
scanf ("%lf",&c);
scanf ("%lf",&d);
scanf ("%lf",&e);
genhaonei=S(a,b,c,d,e);
if (genhaonei<0)
{
	printf("Invalid input");
}
else 
{
	mianji=sqrt(genhaonei);
    printf ("%.4lf\n",mianji);
}
return 0;
}
double S(double x,double y,double z,double w,double m)
{
	double s,genxia,ff;
	s=0.5000*(x+y+z+w);
	ff=0.5000*m/180.0000*PI;
	genxia=(s-x)*(s-y)*(s-z)*(s-w)-x*y*z*w*cos(ff)*cos(ff);
	return genxia;
}
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 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;
}
int main()
{
    double a,b,c,d,x,s,S;
    scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&x);
    x=3.1415926*x/180/2;
    s=(a+b+c+d)/2; 
    if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x)<0)
    printf("Invalid input");
    else
    printf("%.4lf",sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x)));
    return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d,e,s,m;
	scanf("%lf\n%lf\n%lf\n%lf\n%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(3.1415926*e/360)*cos(3.1415926*e/360);
;
	if(m>=0){
		printf("%.4lf",sqrt(m));
	}
	else {
		printf("Invalid input");
	}
	return 0;
}
int main()
{
 double a,b,c,d,e,i;
 scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
 e=e/180*3.1415926;
 i=(a+b+c+d)/2;
 if((i-a)*(i-b)*(i-c)*(i-d)-a*b*c*d*cos(e/2)*cos(e/2)>=0)
 printf("%.4lf",sqrt((i-a)*(i-b)*(i-c)*(i-d)-a*b*c*d*cos(e/2)*cos(e/2)));
 else
	 printf("Invalid input");
 return 0;

}
double mianji(double a,double b,double c,double d,double e)
{
	double S;
double s=(a+b+c+d)/2;

double t=(e/180)*PI;
S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(t/2)*cos(t/2)); 
return S;
}

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

	s=(a+b+c+d)/2;
    t=(e/180)*PI;
  if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(t/2)*cos(t/2)>=0)
{
 	n=mianji(a,b,c,d,e);
	printf("%.4lf",n);                                           
}
else if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(t/2)*cos(t/2)<0)
{
    printf("Invalid input");
}
return 0;                          
}
int main()
{
	double a,b,c,d,v;
	double s,S;
    double P;
	P=3.1415926;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&v);
	s = (double)1/2*(a+b+c+d);
	if((s-a)*(s-b)*(s-c)*(s-d)- a*b*c*d*cos(v*P/360)<0)//CXX0017: Error: symbol "cos" not found

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

	return 0;
}
float mianji(float a,float b,float c,float d,float e);
int main()
{
	float a,b,c,d,e,f;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
	f=mianji(a,b,c,d,e);
	if(f==-1)
		printf("Invalid input");
	else
		printf("%.4f",f);
	return 0;
}

float mianji(float a,float b,float c,float d,float e)
{
	float s,m,q,S;
	e=e/360*PI;
	s=(a+b+c+d)/2;
	q=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e)*cos(e);
	if(q<=0) return -1;
	else S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e)*cos(e));
	return S;
	
}
int main()
{
    double a,b,c,d,e;
    double s,S,x;
    scanf("%lf",&a);
    scanf("%lf",&b);
    scanf("%lf",&c);
    scanf("%lf",&d);
    scanf("%lf",&e);
    s=(a+b+c+d)/2;
    x=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*3.1415926)*cos(e/360*3.1415926);
    if(x<0)  printf("Invalid input\n");
    else {
    S=sqrt(x);
    printf("%.4lf\n",S);
}
    return 0;
}
int main()
{
    double squart(double a,double b,double c,double d,double e);
	double x1,x2,x3,x4,y;
	scanf("%lf",&x1);
	scanf("%lf",&x2);
	scanf("%lf",&x3);
	scanf("%lf",&x4);
	scanf("%lf",&y);
	double genhao,s,e1,sum;
	s=(x1+x2+x3+x4)/2; e1=y*pi/360;
    genhao=(s-x1)*(s-x2)*(s-x3)*(s-x4)-x1*x2*x3*x4*cos(e1)*cos(e1);
	if(genhao<0)
		printf("Invalid input\n");
	else
	{
		sum=squart(x1,x2,x3,x4,y);
	    printf("%.4lf",sum);
	}
	return 0;
}
double squart(double a,double b,double c,double d,double e)
{
	double m,s1;
	double n;
	n=e*pi/360;
	s1=(a+b+c+d)/2;
	m=sqrt((s1-a)*(s1-b)*(s1-c)*(s1-d)-a*b*c*d*cos(n)*cos(n));
	return m;
}
double mianji (double a,double b,double c,double d,double q)
{
double s,p;
p=(a+b+c+d)/2;
p=(p-a)*(p-b)*(p-c)*(p-d);
if (p<0)
{
printf ("Invalid input");
}
else 
{
s=sqrt(p-a*b*c*d*(cos(q))*(cos(q)));

printf ("%.4lf",s);
 
}
return 0;


}
int main(int argc, char* argv[])
{
  double a,b,c,d,p;
  scanf ("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&p);
  p=p/360*3.1415926;
  mianji (a,b,c,d,p);

    
	return 0;
}
double a,b,c,d,a1;
void main()
{
	double sq,s,m;
	double S();
	scanf("%lf",&a);
	scanf("\n");
	scanf("%lf",&b);
	scanf("\n");
	scanf("%lf",&c);
	scanf("\n");
	scanf("%lf",&d);
	scanf("\n");
	scanf("%lf",&a1);
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*m*m<0)
		printf("Invalid input");
	else
	
	{sq=S();
	printf("%.4lf",sq);
	}
}


	double S()
	{
		double a2,s,sq,m;
		a2=(a1*PI)/360;
		m=cos(a2);
		s=(a+b+c+d)/2;
		sq=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*m*m);
		return sq;
	}
main()
{
    double a[4];
    double b,s;
    for(int i=0;i<4;i++)
    scanf("%lf",&a[i]);
    scanf("%lf",&b);
    b=PI*b/180/2;
    s=0.5*(a[0]+a[1]+a[2]+a[3]);
    s=(s-a[0])*(s-a[1])*(s-a[2])*(s-a[3])-a[0]*a[1]*a[2]*a[3]*cos(b)*cos(b);
    if(s<0)
    printf("Invalid input");
    else
    printf("%.4lf",sqrt(s));
}
int main()
{
  double a,b,c,d,A,S;
  scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&A);
    if((b+c+d-a)*(a+c+d-b)*(a+b+d-c)*(a+b+c-d)/16-a*b*c*d*cos(A*3.1415926/360)*cos(A*3.1415926/360)<0){
       printf("Invalid input");
        }
  else{
         S=sqrt((b+c+d-a)*(a+c+d-b)*(a+b+d-c)*(a+b+c-d)/16-a*b*c*d*cos(A*3.1415926/360)*cos(A*3.1415926/360)); 
        printf("%.4lf\n",S);
        }
  return 0;
}
int main(){
    double a, b, c, d, e, k, s, S;
    scanf("%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e);
    s = (a+b+c+d)/2;
    #define q 3.1415926
	S = sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*q/360)*cos(e*q/360));
	k =(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*q/360)*cos(e*q/360);
	if(k>0){
		printf("%.4lf", S);
	}
	else if(k<0){
		printf("Invalid input");
	}
     return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d;
	scanf("%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d);
	double n;
	scanf("%lf",&n);
	double s,N;
	s=(a+b+c+d)/2;
	N=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(PI*n/360)*cos(PI*n/360);
	if(N<0)printf("Invalid input");
	else{
         double S;
	     S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(PI*n/360)*cos(PI*n/360));
	     printf("%.4f",S);
	}
	return 0;
}
int main(void)
{
    double a,b,c,d,af,s,S,k;
 
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&af);
    s=(a+b+c+d)/2.0;
    af=cos(af/2.0*3.1415926/180.0);
    k=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*af*af;
    if(k<0)
      printf("Invalid input\n");
    else
		S=sqrt(k),
      printf("%.4lf\n",S);
 return 0;
}
int pd=0;

double S(double a,double b,double c,double d,double angle)
{
	double s,t;
	s = (a+b+c+d)/2;
	t = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(angle)*cos(angle);
	if (t<0)
	{
		pd = 1;
		return 0;
	}
	else
		return (sqrt(t));
}

int main()
{
	double a,b,c,d,angle,ans;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
	angle = angle * PI / 360;
	ans = S(a,b,c,d,angle);

	if (pd)
		printf("Invalid input");
	else
		printf("%.4lf",ans);

	return 0;
}
main()
{
	double surface(double a,double b,double c,double d,double e,double s);
    double a,b,c,d,e,s,S;
    scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&e);
    S=surface(a,b,c,d,e,s);
    	
}
double surface(double a,double b,double c,double d,double e,double s)
{
	double S;
	s=0.5*(a+b+c+d); 
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*3.1415926/360)*cos(e*3.1415926/360)); 
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*3.1415926/360)*cos(e*3.1415926/360)<0)printf("Invalid input");
    else printf("%.4lf",S);
    return S;
}
double area(double a,double b,double c,double d,double angle)
{double s,sum;
	s=(a+b+c+d)/2; 
	sum=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(3.1415926*angle/360)*cos(3.1415926*angle/360)); 
return sum;
}

int main(int argc, char* argv[])
{double a,b,c,d,angle,k;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
k=area(a,b,c,d,angle);
if(k>=0)
	printf("%.4lf\n",k);
else 
	printf("Invalid input");
	
	return 0;
}
void main()
{
  double cal(double,double,double,double,double,double);
  double S,a,b,c,d,s,x;
  scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&x);
  s=(a+b+c+d)/2;
  S=cal(a,b,c,d,s,x);
  if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos((x/360)*3.1415926)*cos((x/360)*3.1415926)<-0.00001)
	  printf("Invalid input");
  else 
	  printf("%.4lf",S);
}

double cal(double a,double b,double c,double d,double s,double x)
{    
	 double S;
	 s=(a+b+c+d)/2;
	 S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos((x/360)*3.1415926)*cos((x/360)*3.1415926)); 
	 return(S);
}
int main ()
{
	double pi=3.1415926,f,s=0,a[4],sum;
	int i;
	for(i=0;i<4;i++)
		scanf("%lf",&a[i]);
	scanf("%lf",&f);
	f=pi/360*f;
	for(i=0;i<4;i++)
		s=s+(a[i])/2;
    sum=(s-a[0])*(s-a[1])*(s-a[2])*(s-a[3])-a[0]*a[1]*a[2]*a[3]*cos(f)*cos(f);
	if(sum<0) printf("Invalid input");
	else
	{
		sum=sqrt(sum);
		printf("%.4f",sum);
	}
}
int main()
{
	double a,b,c,d,e;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	double s=(a+b+c+d)/2;
	double q=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*3.1415926)*cos(e/360*3.1415926));
	if(q<0)
		printf("Invalid input");
	else
	{
		double r=sqrt(q);
		printf("%.4lf",r);
	}
	
}
void main()
{
	int i;
	double a[5],s,q;
	for(i=0;i<5;i++)
		scanf("%lf\n",&a[i]);
	q=(a[1]+a[2]+a[3]+a[0])/2;
    s=(q-a[0])*(q-a[1])*(q-a[2])*(q-a[3])-a[0]*a[1]*a[2]*a[3]*cos(a[4]*PI/(double)360)*cos(a[4]*PI/(double)360);
		if(s<0)printf("Invalid input");
		else printf("%.4lf",sqrt(s));
}
double area(double a,double b,double c,double d,double e)
{
	double s=(a+b+c+d)/2;
	double x=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(e*PI/360),2); 
	return x;
}
int main()
{
	double a,b,c,d,e;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	if(area(a,b,c,d,e)<0)
	{
		printf("Invalid input");
	}
	else
	{
	     double S=sqrt(area(a,b,c,d,e));
			 printf("%.4lf",S);
	}
	return 0;
}
float sss(float a,float b,float c,float d,float alpha)
{
	float s=(a+b+c+d)/2;
	return (float)sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(alpha/180*3.1415926/2)*cos(alpha/180*3.1415926/2));
}

int main()
{
	float a,b,c,d,alpha;
	scanf("%f %f %f %f %f",&a,&b,&c,&d,&alpha);
	float result;
	result=sss(a,b,c,d,alpha);
	if(result>0) printf("%.4f\n",result);
	else printf("Invalid input\n");
	return 0;
}
main()
{
      double a,b,c,d,s,ang;
      scanf("%lf",&a);
      scanf("%lf",&b);
      scanf("%lf",&c);
      scanf("%lf",&d);
      scanf("%lf",&ang);
      s=(a+b+c+d)/2;
      ang=ang*3.1415926/180;
      if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(ang/2)*cos(ang/2)<0)
          printf("Invalid input");
      else
          printf("%.4lf",sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(ang/2)*cos(ang/2)));
      getchar();
      getchar();
}
int main ()
{
	double a, b, c, d, e ,s, S,PI = 3.1415926;
	cin >> a >> b >> c >> d >> e;
	e = e * PI / 180;
	s = ( a + b + c + d ) / 2;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e / 2) * cos (e / 2) <= 0)
		cout << "Invalid input" << endl;
	else
	{
		S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e / 2) * cos (e / 2));
		cout << fixed << setprecision(4) << S << endl;
	}
	return 0;
}
void main()
	{
		float a,b,c,d,e,S(float f,float g,float h,float i,float j),z;
		scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
		z=S(a,b,c,d,e);
		if(z>0)
		printf("%.4f",z);
		else
             printf("Invalid input");
	}
	float S(float f,float g,float h,float i,float j)
	{
		double sq,s;
        s = (f+g+h+i)/2;
		if(((s-f)*(s-g)*(s-h)*(s-i) - f*g*h*i*cos(j/720*2*PI)*cos(j/720*2*PI))>0)
			
		
		sq=sqrt((s-f)*(s-g)*(s-h)*(s-i) - f*g*h*i*cos(j/720*2*PI)*cos(j/720*2*PI));
		return(sq);
	}
int main(void)
{
	float a=0,b=0,c=0,d=0;
	float aa=180;
	scanf("%f",&a);
	scanf("%f",&b);
	scanf("%f",&c);
	scanf("%f",&d);
	scanf("%f",&aa);

	aa=aa/180*3.1415926;
	float S=0;
	float s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((double)aa/2)*cos((double)aa/2)<0)
	printf("Invalid input");
	else
	{
	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((double)aa/2)*cos((double)aa/2));
	printf("%.4f",S);
	}
	return 0;
}
void main()
{
	float a,b,c,d,s,angle2;
	double S,sum,PI=3.1415926,angle;
	scanf("%f%f%f%f",&a,&b,&c,&d);
	s=(a+b+c+d)/2;
	scanf("%f",&angle2);
	angle=angle2/2/180*PI;
	sum=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(angle)*cos(angle);
	if(sum>=0)
	{
    	S = sqrt(sum);
		printf("%.4f",S);
	}
	else printf("Invalid input");

}
int main()
{
double a,b,c,d,e,s,g;
double q=cos((60*PI/180));
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
s=(a+b+c+d)/2;
g=((s-a)*(s-b)*(s-c)*(s-d))-(a*b*c*d*cos(e*PI/360)*cos(e*PI/360));
if (g<0) printf("Invalid input"); else printf("%.4lf",sqrt(g));
}
int main()
{
	double a,b,c,d,angle,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
	s=(a+b+c+d)/2; 

	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(angle/360*PI)*cos(angle/360*PI))<0)
		printf("Invalid input");
	else
		printf("%.4lf",sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(angle/360*PI)*cos(angle/360*PI)));
	return 0;
}
int main()
{
	double a,b,c,d,al,o;
	double f(double A,double B,double C,double D,double AL);
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&al);
	o=f(a,b,c,d,al);
	if(o==-1){
		printf("Invalid input");
	}else{
		printf("%.4lf",o);
	}
	return 0;
}

double f(double A,double B,double C,double D,double AL)
{
	double s,S;
	s=(A+B+C+D)*0.5;
	if(A*B*C*D*cos(AL*Pi/360)*cos(AL*Pi/360)>(s-A)*(s-B)*(s-C)*(s-D)){
		S=-1;
	}else{
		S=sqrt((s-A)*(s-B)*(s-C)*(s-D)-A*B*C*D*cos(AL*Pi/360)*cos(AL*Pi/360)); 
	}
	return (S);
}