semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	float a,b,c,d,A,B;
	scanf("%f",&a);
	scanf("%f",&b);
	scanf("%f",&c);
	scanf("%f",&d);
	scanf("%f",&B);
	float s,S;
	A=(B/180)*PI;
	s=(a+b+c+d)/2;
	S=(float)sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(A/2)*cos(A/2));
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(A/2)*cos(A/2))<0)
		printf("Invalid input");
	else if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(A/2)*cos(A/2))>=0)
		printf("%.4f",S);
	return (0);
}
double mianji(double a,double b,double c,double d,double s,double ww)
{
    double www;
    double PI=3.1415926;
    www= (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(ww*PI/360)*cos(ww*PI/360);
    if(www<0)
    {
             
             return(-1);}
    else
    return(sqrt(www));
} 
main()
{
      double a,b,c,d;
      scanf("%lf %lf %lf %lf",&a,&b,&c,&d);
      double s=(a+b+c+d)/2;
      double ww;
      scanf("%lf",&ww);
      ww=ww;
      double ss=-1;
      ss=mianji(a,b,c,d,s,ww);
      if(ss>=0)
      printf("%.4lf",ss);
      else
      printf("Invalid input");
}
int main(){
   double a,b,c,d;
   double e,S,s,n;
   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/360*PI)*cos(e/360*PI);
   if(n>=0)  printf("%.4lf",sqrt(n));            
   else printf("Invalid input");
  return 0;
}
double abc(double x,double y,double z,double w)
{
	double s;
	s=(x+y+z+w)/2;
	return s;
}
double abcd(double x,double y,double z,double w,double e)
{
	double S,d;
	d=abc(x,y,z,w);
	S=sqrt((d-x)*(d-y)*(d-z)*(d-w) - x*y*z*w*cos(e/180*pi)*cos(e/180*pi)); 
	return S;
}
void main()
{
	double a,b,c,d,h,e,j;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&h);
	e=h/2.0;
	
	j=abcd(a,b,c,d,e);
	if(j>=0)
	printf("%.4lf",j);
	else 
	printf("Invalid input");
}
float area(float a,float b,float c,float d,float angle){
	float s,e;
	s=(a+b+c+d)/2;
	e=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle/2/180*3.1415926)*cos(angle/2/180*3.1415926);
	if(e<0){
		return -1;
	}
	else{
		return sqrt(e);
	}
}

int main(){
	float a,b,c,d,angle;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&angle);
	if(area(a,b,c,d,angle)==-1){
		printf("Invalid input");
	}else{
		printf("%.4f",area(a,b,c,d,angle));
	}
	return 0;
}
int main()
{
	float a,b,c,d,e;
	double t,n,m;
	scanf("%f %f %f %f\n",&a,&b,&c,&d);
	scanf("%lf",&t);
	e= (a+b+c+d)/2;
	n = sqrt((e-a)*(e-b)*(e-c)*(e-d) - a*b*c*d*cos(t*PI/360)*cos(t*PI/360));
    m=(e-a)*(e-b)*(e-c)*(e-d) - a*b*c*d*cos(t*PI/360)*cos(t*PI/360);
	if(m<0)
	{
		printf("Invalid input");
	}
	if(m>=0)
	{ 
		printf("%.4lf",n);
	}
	return 0;
}
double f(double a,double b,double c,double d,double jiaodu){
       double x,y,s;
       s=(a+b+c+d)/2;
       x=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(jiaodu*pi/360)*cos(jiaodu*pi/360);
       if(x<0){
         y=-1;
         }else{
            y=sqrt(x);
            }
       return y;
}
int main(){
    double a,b,c,d;
    double jiaodu;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&jiaodu);
    double square;
    square=f(a,b,c,d,jiaodu);
    if(square==-1){
      printf("Invalid input");
      }else{
         printf("%.4lf",square);
         }
    return 0;
}
int main()
{
	double a,b,c,d,s,S,k,t;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf\n",&a,&b,&c,&d,&k);
    s = (a+b+c+d)/2;
	t=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(k*PI/2/180)*cos(k*PI/2/180);
    S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(k*PI/2/180)*cos(k*PI/2/180));
	if(t>0)
	{
		printf("%.4lf",S);
	}
	else if(t<0)
	{
		printf("Invalid input");
	}
	return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d,A,S;
	cin>>a>>b>>c>>d;
	cin>>A;
	const double s=(a+b+c+d)/2;
	const double pi=3.1415926;
	if (((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(A/180*pi/2),2))<0) cout<<"Invalid input"<<endl;
	else
	{S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(A/180*pi/2),2));
	cout<<fixed<<setprecision(4)<<S<<endl;}
	
	return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d,y,x,S,s,m;
	scanf ("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	s=(a+b+c+d)/2;
    y=x*PI/180;
	m=cos(y/2);
	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\n",S);
	}
	return 0;
}
int main(){
	double sqrt(double);
	double a,b,c,d,e;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&e);
	double S;
	double t;
	 t=(e/180)*p;
	 if(m>=0){
   S=sqrt(m);
	printf("%.4lf",S);
	 }
	else{
		printf("Invalid input");
	}
   return 0;
}
int main()
{
    double a,b,c,d,e,f,s,m;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s = (a+b+c+d)/2;
	f=e*PI/180;
	if( (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f/2)*cos(f/2)>0)
	{
			m = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f/2)*cos(f/2));
			printf("%.4lf\n",m);
	}
	else 
	{
		printf("Invalid input");
	}
	return 0 ;
}
int main()
{
	float a,b,c,d,s,ans;
	double m,n;
    cin>>a>>b>>c>>d>>n;
	s=(a+b+c+d)/2;
	m=(n/2)*3.1415926/180;
	ans =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("Invalid input\n");
	}
	else
	{
		
		printf("%.4f",ans);
	}
	return 0;
}
double f(double a,double b,double c,double d,double w )
{
       double q;
       q=w/2.0* 3.1415926/180.0;
       double s,ss;
       s=(a+b+c+d)/2.0;
       ss=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q));
       return (ss);
}
main()
{
     double a;
     double b;
     double c;
     double d;
     double w;
     double z,s; 
     scanf("%lf",&a);
     scanf("%lf",&b);
     scanf("%lf",&c);
     scanf("%lf",&d);
     scanf("%lf",&w);
     s=(a+b+c+d)/2.0; 
      double q,g;
       q=w/2.0*3.1415926/180.0;
     z=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q);
     if(z<0)
     {
            printf("Invalid input");
     }
     else
     {
         g=f(a,b,c,d,w);
     printf("%.4lf",g);
     }
     getchar();
     getchar();
}
int main()
{
	double a,b,c,d,s,x,y,S;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&x);
	s=1.0/2.0*(a+b+c+d);
	y = x/360*3.1415926;
	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(y)*cos(y)));
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(y)*cos(y))<0)
		printf("Invalid input");
	else
		printf("%.4lf",S);
	return 0;
}
double area(double a,double b,double c,double d,double e)
 {
  double s,k;
  s=(a+b+c+d)/2;
  e=cos(e/360*PI);
  e=e*e;
  s=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*e);
  if (s>=0)
  k=sqrt(s);
  else k=-1;
  return k;
 }

int main()
{
 double a1,b1,c1,d1,e1,s1;
 scanf("%lf%lf%lf%lf%lf",&a1,&b1,&c1,&d1,&e1);
 s1=area(a1,b1,c1,d1,e1);
 if (s1==-1)
  printf("Invalid input");
 else
  printf("%.4lf",s1);
  return 0;
}
double area(double x,double y,double z,double p,double q);
int main()
{
	double a,b,c,d,e,result;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&e);
	result=area(a,b,c,d,PI*e/360);
	if(result==0){
	printf("Invalid input");
	}else{
	printf("%.4lf",result);
	}
	return 0;
}
double area(double x,double y,double z,double p,double q){
double s;
s=(x+y+z+p)/2;
if((s-x)*(s-y)*(s-z)*(s-p)-x*y*z*p*cos(q)*cos(q)<0){
return 0;
}else{
return sqrt((s-x)*(s-y)*(s-z)*(s-p)-x*y*z*p*cos(q)*cos(q));
}
}
main()
{
float a,b,c,d,s,S,J,j;
scanf("%f\n%f\n%f\n%f\n%f",&a,&b,&c,&d,&J);
j=(float)(3.1415926*J)/360;
s=(a+b+c+d)/2;
if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(j)*cos(j))>1e-6)
{S=(float)sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(j)*cos(j));
printf("%.4f",S);
}
else
printf("Invalid input");
 }
const double pi=3.1415926; 

int main()
{
    double t , a , b , c , d , x  , s ;
    cin>>a>>b>>c>>d>>x;
    s=(a+b+c+d)/2;
    t=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos( x*pi/360 )*cos( x*pi/360 );
    if( t<0 ) cout<<"Invalid input";
     else printf("%.4f",sqrt(t));
}
void main()
{
	double a,b,c,d,e;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	void square(double,double,double,double,double);
	square(a,b,c,d,e);

}

void square(double a,double b,double c,double d,double e)
{
	double s,o,S,f;
	f=e/2;
	s=(a+b+c+d)/2;
	o=(PI*f)/180;
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o)*cos(o))<0)
		printf("Invalid input\n");
	else
	{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o)*cos(o));
		printf("%.4lf",S);}
}
void main()
{
	double a, b, c, d, S, s, k, t;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf", &a, &b, &c, &d, &k);
	s = (a+b+c+d)/2;
	t = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(k*(PI)/180/2)*cos(k*(PI)/180/2);
	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(k*(PI)/180/2)*cos(k*(PI)/180/2));
    if (t < 0)
		printf("Invalid input");
	else
		printf("%.4lf", S);
}
main()
{
	double mianji(double a,double b,double c,double d,double e);
	double A,B,C,D,E,g,S,F,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=mianji(A,B,C,D,E);
	printf("%.4lf",g);}

}
    double mianji(double a,double b,double c,double d,double e)
	{
	double s,f,i,h;
	
	s=0.5*(a+b+c+d); 
	h=e/360*3.1415926;
	f=cos(h);
	
	    


	i=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*f*f);
    return (i);
	
	}
int main()
{
	double a,b,c,d,e,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	e=3.1415926*e/360;
	e=cos(e);
	s=(a+b+c+d)/2;
	s=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*e*e;
	if(s<0)
		printf("Invalid input");
	else{
		s=sqrt(s);
		printf("%.4lf",s);
	}
	return 0;
}
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=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*PI/360)*cos(e*PI/360);
	if(f>=0)
	{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*PI/360)*cos(e*PI/360)); 
	    printf("%.4lf\n",S);
	}
	else
		printf("Invalid input");
	return 0;
}
void main()
{
	double a[5],o,s,S;
	int i;
	for (i=1;i<=4;i++) scanf("%lf",&a[i]);
	scanf("%lf",&o);
	o=o/2;
	o=o/360*2*3.1415926;
	s=(a[1]+a[2]+a[3]+a[4])/2;
	S=(s-a[1])*(s-a[2])*(s-a[3])*(s-a[4])-a[1]*a[2]*a[3]*a[4]*cos(o)*cos(o);
	if (S<0) printf("%s","Invalid input");
	  else 
	  {
			S=sqrt(S);
			printf("%.4lf",S);
	  }
	
}
int main ()
{
	
	
	double a,b,c,d,m,S;
	double s,n;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&m);

    s = (a+b+c+d)/2;
	n=m*PI/360;
    S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(n))*(cos(n)));
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(n))*(cos(n))>=0){
	
		printf("%.4f",S);
	}

		if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(n))*(cos(n))<0){
			printf("Invalid input");
		}
		return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d,jiaodu,hudu,s,square,pingfang;
	double zhuanhuan(double);
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&jiaodu);
	s=(a+b+c+d)/2;
	pingfang=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(zhuanhuan(jiaodu))*cos(zhuanhuan(jiaodu)); 
	if(pingfang<0){
		printf("Invalid input");
	}else{
		square=sqrt(pingfang);
		printf("%.4lf",square);
	}

	return 0;
}

double zhuanhuan(double jiaodu)
{
	double e;
	e=PI*jiaodu/360;
	return e;
}
int main()
{
	float a[4];
	float s,S,angle,t;
	int i;
	for(i=0;i<4;i++)
		scanf("%f\n",&a[i]);
	scanf("%f",&angle);
	s=(a[0]+a[1]+a[2]+a[3])/2;
	t=cos(angle*pi/360);
	S=sqrt((s-a[0])*(s-a[1])*(s-a[2])*(s-a[3])-a[0]*a[1]*a[2]*a[3]*t*t);
if((s-a[0])*(s-a[1])*(s-a[2])*(s-a[3])-a[0]*a[1]*a[2]*a[3]*t*t<0)printf("Invalid input");
	else printf("%.4f",S);
}
int main()
{

double a, b, c, d, s;
scanf("%lf%lf%lf%lf",&a, &b, &c, &d);
s = (a+b+c+d)/2;

double w, x, W, X;
scanf("%lf%lf", &w, &x);
W = w / 180 * PI;
X = x / 180 * PI;

double R, M;
M =(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(W/2+X/2)*cos(W/2+X/2);

if(M<0)
	printf("Invalid input");
else
	{
	R = sqrt(M);
	printf("%.4lf", R);
	}

return 0;
}
int main()
{
	double a,b,c,d;
	double al,af;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&al);
	af = al / 180 * pai;
	double s = 0.5*(a+b+c+d); 
	if( (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(af/2)*cos(af/2) >= 0)
	{
		double S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(af*0.5)*cos(af*0.5));
		printf("%.4lf\n",S);
	}
	else
	{
		printf("Invalid input");
	}
	return 0;
}
int main(){
double a, b, c ,d , s ;
double S=0;
double f;
f>0&&f<360;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&f);
s = (a+b+c+d)/2;
     S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f*PI/360)*cos(f*PI/360)); 
      
if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f*PI/180)*cos(f*PI/180))>0)
     {printf("%.4lf\n",S) ;}

else{printf("Invalid input\n");}
return 0;
}
double getArea(double);
double getcos(double);
int main()
{
	double a,b,c,d,i,j;
    double S,s;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&i);
	s=(a+b+c+d)/2;
	j=i*PI/360;
	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(i)*cos(j)>0)
	{
		printf("%.4lf\n",S);
	}
	else
	{
	    printf("Invalid input");
	}
	return 0;
}
void jisuan(double a,double b,double c,double d,double hudu)
{
	double s,h,mianji;
	s=(a+b+c+d)/2;
    h=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(hudu)*cos(hudu);
	if(h<0)
		printf("Invalid input");
	else
	{mianji=sqrt(h);
	printf("%.4lf",mianji);}}
void main()
{
    double a,b,c,d,jiaodu,s,hudu;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&jiaodu);
	hudu=jiaodu/2*3.1415926/180;
	jisuan(a,b,c,d,hudu);
}
double f(double,double,double,double,double);
void main()
{
	double a,b,c,d,p,m;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&p);
	p=p/360*3.1415926;
	m=f(a,b,c,d,p);
	if(m>0) printf("%.4lf",sqrt(m));
	else printf("Invalid input");
}
double f(double a,double b,double c,double d,double p)
{
	double s=(a+b+c+d)/2;
	return((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(p)*cos(p));
}
int main()
{
	double a,b,c,d,x;
	double S(double a,double b,double c,double d,double x);
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&x);
	if(S(a,b,c,d,x)>=0)
		printf("%5.4lf",S(a,b,c,d,x));
	else
		printf("Invalid input");
	return 0;	
}
double S(double A,double B,double C,double D,double X)
{
    double s,y,z;
	s=(A+B+C+D)/2;
	y=X*P/360;
	if((s-A)*(s-B)*(s-C)*(s-D)-A*B*C*D*cos(y)*cos(y)<0)
		z=-1.0;
	else 
		z=sqrt((s-A)*(s-B)*(s-C)*(s-D)-A*B*C*D*cos(y)*cos(y));
	return z;
}
int main()
{
    double a,b,c,d;
    scanf("%lf%lf%lf%lf", &a, &b, &c, &d);
    double e;
    scanf("%lf", &e);
    double area;
    double s;
    s=(a+b+c+d)/2;
    area=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(PI*e/180/2)*cos(PI*e/180/2);
    if(area<0)
    printf("Invalid input");
    else
    printf("%.4lf", sqrt(area));
    return 0;
}
void main()
{
 float a,b,c,d,D,S,s;
 float sums(float a,float b,float c,float d,float D);
 scanf("%f%f%f%f%f",&a,&b,&c,&d,&D);
 s=sums(a,b,c,d,D);
 if(s==0)printf("Invalid input");
	 else printf("%.4f",s);
}
float sums(float a,float b,float c,float d,float D)
{
 double Pi=3.1415926;
 float z,s,y;
 z=D/360*Pi;
 s=(a+b+c+d)/2;
 y=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*(float)cos(z)*(float)cos(z);
 if(y<0)return 0;
 else return sqrt(y);
}
int main()
{
	float a,b,c,d,e,s;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
	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(e*3.1415926/360)*cos(e*3.1415926/360));
	if(((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(e*3.1415926/360)*cos(e*3.1415926/360)>=0)	
	printf("%.4f",s);
		if(((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(e*3.1415926/360)*cos(e*3.1415926/360)<0)
			printf("Invalid input");
return 0;
}
int main()
{
	double S(double a,double b,double c, double d,double e);
	double a,b,c,d,e,t,g,s;
    scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
	t=S(a,b,c,d,e);	
	e=e/180*3.1415926;
    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));
    if(g<0)
	{
		printf("Invalid input");
	}else{
		printf("%.4lf",t);
	
	}
	return 0;
}

	double S(double a,double b,double c, double d,double e)
	{
		double s,g;
		e=e/180*3.1415926;
		s=(a+b+c+d)/2;
		g=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*(cos(e/2)*cos(e/2)));
		return(g);
	}
int main(int argc, char* argv[])
{
    double a,b,c,d,s,S;
	double x;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
    s=(a+b+c+d)/2;
    S=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x*3.1415926/2/180)*cos(x*3.1415926/2/180);
	if(S<0){
		printf("Invalid input\n");
	}
	else{
	printf("%.4lf\n",sqrt(S));
	}
	return 0;
}
int main(){
	double a,b,c,d,s,k,n;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&n);
	n=n/360*2*PI;
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(n/2)*cos(n/2)<0){
		printf("Invalid input");
		return 0;
	}
	k=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(n/2)*cos(n/2));
	printf("%.4lf",k);
	return 0;
}
int main()
{
	double S,s,a,b,c,d,e;
	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*3.1415926/360)*cos(e*3.1415926/360)<0)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4lf",sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*3.1415926)*cos(e/360*3.1415926)));
	}
	return 0;
}
int main()
{
    double a, b, c, d, p, q, s, x;
    scanf("%lf", &a);
    scanf("%lf", &b);
    scanf("%lf", &c);
    scanf("%lf", &d);
    scanf("%lf", &p);
    q=2*3.1415926*p/720;
    x=(a+b+c-d)*(a+b-c+d)*(a-b+c+d)*(-a+b+c+d)/16-a*b*c*d*pow(cos(q),2);
    if(x<0){
            printf("Invalid input");
            }
    if(x>=0){
             s=sqrt(x);
             printf("%.4lf", s);
             }        
    return 0;         
    }
int main()
{
	double PI=3.1415926;
	double a, b, c, d, s, x, y, S;
	scanf("%lf\n%lf\n%lf\n%lf\n", &a, &b, &c, &d);
	s=(a+b+c+d)/2;
	scanf("%lf", &x);
	y=x*PI/360;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y)<0)
	{
		printf("Invalid input");
	}
	else
	{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y));
		printf("%.4lf", S);
	}
	return 0;
}
main()
{
      double a[4],j,s,S;
      int i=0;
      for(i=0;i<4;i++)
      {
        scanf("%lf",&a[i]);
      }
      scanf("%lf",&j);
      j=(j/180)*3.1415926/2;
      s=(a[0]+a[1]+a[2]+a[3])/2;
      if((s-a[0])*(s-a[1])*(s-a[2])*(s-a[3]) - a[0]*a[1]*a[2]*a[3]*cos(j)*cos(j)>=0)
      {
      S = sqrt((s-a[0])*(s-a[1])*(s-a[2])*(s-a[3]) - a[0]*a[1]*a[2]*a[3]*cos(j)*cos(j));
      printf("%.4lf\n",S);
      }
      else printf("Invalid input");
      
}
void main()
{
	double a,b,c,d,s,t,r,o,m;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&t);
	r=t/360*PI;
	s=(a+b+c+d)/2;
	o=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(r)*cos(r);
	m=sqrt(o);
	if(o<0)printf("Invalid input");
	else printf("%.4lf",m);
}
int main()
{
	const double PI=3.1415926;
	double a,b,c,d,alpha,s,sum,radalpha,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&alpha);
	a=(double)a;
	b=(double)b;
	c=(double)c;
	d=(double)d;
	alpha=(double)alpha;
	s=(a+b+c+d)/2;
	radalpha=alpha*PI/360.0;
	sum=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(radalpha)*cos(radalpha);
	if(sum<0)
		printf("Invalid input");
	else
		{
			S=sqrt(sum);
			printf("%.4f",S);
		}
	return 0;
}
int main()
{ double a,b,c,d,jiao;int fanhui;
  double mianji(double aa,double bb,double cc,double dd,double jiaojiao);
  scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&jiao);
  c=mianji(a,b,c,d,jiao);
  if(c==0)printf("Invalid input");
  else printf("%.4f",c);
  getchar();
  getchar();
}
double mianji(double aa,double bb,double cc,double dd,double jiaojiao)
{ double s,ban,panduan,fanhui;
  ban=(jiaojiao*0.01745329)/2.0000;
  s=(aa+bb+cc+dd)/2.0000;
  panduan=(s-aa)*(s-bb)*(s-cc)*(s-dd)-aa*bb*cc*dd*cos(ban)*cos(ban);
  if(panduan>0)fanhui=sqrt(panduan);
  else fanhui=0;
  return fanhui;}
float f(float x1,float x2,float x3,float x4);
main()
{
	double S,a,b,c,d,x,s;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&x);
	x=x/360*3.1415926;
	s=f(a,b,c,d);
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x)<0)printf("Invalid input");
	else
	{
	    S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x)); 
        printf("%.4lf",S);
	}
}
float f(float x1,float x2,float x3,float x4)
{
	float u;
	u=(x1+x2+x3+x4)/2;
	return(u);
}
double S (double a,double b,double c,double d,double rad,double s){
    s = (a+b+c+d)/2;
    return sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(rad)*cos(rad));
}

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

double US(double a, double b, double c, double d, double alpha)
{
 double SF;
 SF=(s(a, b, c, d)-a)*(s(a, b, c, d)-b)*(s(a, b, c, d)-c)*(s(a, b, c, d)-d)-a*b*c*d*cos(alpha)*cos(alpha); 
 return SF;
}

int main()
{
double a, b, c, d;
double alpha, jiao;
scanf("%lf %lf %lf %lf %lf", &a, &b, &c, &d, &jiao);
alpha=(jiao/2)/180*PI;
double final;
if(alpha<0) printf("Invalid input");
if(US(a, b, c, d, alpha)<0) printf("Invalid input");
else
    {
     final=sqrt(US(a, b, c, d, alpha));
     printf("%.4lf", final);
    }
return 0;
}
int main()
{
    double a,b,c,d,e,s;
	double S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	
    s = 0.5*(a+b+c+d); 
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((e/2)/180.00*3.1415926)*cos((e/2)/180.00*3.1415926));
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((e/2)/180.00*3.1415926)*cos((e/2)/180.00*3.1415926)>0)
	    printf("%.4lf\n",S);
	else if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((e/2)/180.00*3.1415926)*cos((e/2)/180.00*3.1415926)<=0)
		printf("Invalid input\n");



	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);
	e=e*PI/360;
	s=(a+b+c+d)/2;
	S=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e)*cos(e); 
	if(S<0)
		printf("Invalid input\n");
	else
	{S=sqrt(S);
	    printf("%.4lf\n",S);
	}
	return 0;
}
int main()
{
	double a,b,c,d,x,s,S,y,m;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	double f(double a,double b,double c,double d,double m);
	y=(PI*x)/360;
	m=cos(y);
	if(m<0||(int)(10000*m)==0)
		printf("Invalid input\n");
	else
	{
		S=f(a,b,c,d,m);
		printf("%.4lf\n",S);
	}
	return 0;
}
double f(double a,double b,double c,double d,double m)
{
	double s,S;
	s=(a+b+c+d)/2;
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*m*m); 
	return S;
}
void main()
{
	double a,b,c,d,j,J,S,s,m,pi=3.1415926;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&j);
	s=(a+b+c+d)/2;
	J=j/360*pi;
	m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(J)*cos(J);
	if(m>0)
		printf("%.4lf",sqrt(m));
	else
		printf("Invalid input");
}
int main(int argc, char* argv[])
{
	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;
   S=sqrt((s-a)*(s-b)*(s-c)*(s-d)
	   -a*b*c*d*cos(x*3.1415926/360)*cos(x*3.1415926/360));
   if((s-a)*(s-b)*(s-c)*(s-d)
	   -a*b*c*d*cos(x*3.1415926/360)*cos(x*3.1415926/360)<0)
   printf("Invalid input");
   else 
   printf("%.4lf",S);
  return 0;


}
const double pi=3.1415926;
double Area(double a,double b,double c,double d,double angle)
{
    double s=(a+b+c+d)/2;
    angle=(angle/2)/360*2*pi;
    double square=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle)*cos(angle);
    if (square<0) return -1;
    return sqrt(square);
}
int main()
{
  double a,b,c,d,angle,ans;
  scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
  ans=Area(a,b,c,d,angle);
  if (ans>=0) printf("%.4lf",ans);
  else printf("Invalid input");
  return 0;
}
int main()
{
	double a, b, c, d, q;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&q);
	
	if ((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(q*3.1415926/360)*cos(q*3.1415926/360)<0)
		printf("Invalid input");
	else{
	double ss = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(q*3.1415926/360)*cos(q*3.1415926/360)); 
	printf("%.4lf", ss);
	}
	return 0;
}
int main()
{
	double a,b,c,d,x;
	scanf("%lf",&a);
		printf("\n");
	scanf("%lf",&b);
		printf("\n");
	scanf("%lf",&c);
		printf("\n");
	scanf("%lf",&d);
		printf("\n");
	scanf("%lf",&x);
		printf("\n");
	x=x*PI/360;
	float s;
	double S;
	s = (float)1/2*(a+b+c+d);
	S=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(x),2);
	if (S<=0)
	{
		printf("Invalid input");
	}
	else
	{
		S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(x),2)); 
	 	printf("%.4f",S);
	}
	return 0;
}
int main(int argc, char *argv[])
{
  float a,b,c,d,e,s,t=0,m;
   scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
   s=(a+b+c+d)/2;
   m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos((e*3.1415926)/360),2);
   if(m<0)
   printf("Invalid input");
   else {t=sqrt(m); 
  printf("%.4f",t);}
  return 0;
}
main (){
	double a,b,c,d,A,B,s,S;
	
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&A);
	B=((A/2)/360)*2*pi;
    s = (double)1/2*(a+b+c+d); 
	if ((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(B)*cos(B)>=0)
	{S = (double)sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(B)*cos(B)); 
	printf("%.4f",S);}
	else printf("Invalid input\n");
return 0;
}