semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
double area(double a,double b,double c,double d,double e);
int main()
{
	double a,b,c,d,e;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
	area(a,b,c,d,e);
	return 0;
}

double area(double a,double b,double c,double d,double e){
	double y,s;
	s=(a+b+c+d)/2;
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*90/PI))<0){
		printf("Invalid input");
	}
	else{
		y=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*PI/360)*cos(e*PI/360)); 
		printf("%.4lf\n",y);;
	}
	return 0;
}
double f(double a,double b,double c,double d,double pr)
{
	double s,area,r,PI;
	PI=3.1415926;
	r=pr*PI/180;
	s=(a+b+c+d)/2;
	area=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(r/2)*cos(r/2)); 
	return(area);
}
void main()
{
	double a,b,c,d,pr,s,PI=3.1415926,r;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&pr);
	s=(a+b+c+d)/2;
	r=pr*PI/180;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(r/2)*cos(r/2)<0)
		printf("Invalid input");
	else
		printf("%.4lf",f(a,b,c,d,pr));
}
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*PI/360;
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(2*f))<0) 
		printf("Invalid input");
	else 
	{
		S =sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f)*cos(f));
		printf("%.4lf",S);
	}
	return 0;
}
double mjs(double a,double b,double c,double d,double r)
{
  double s;
	s=(a+b+c+d)/2;
    return (s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(3.1415926*r/360),2);
}
 double mjS(double a,double b,double c,double d,double r)
{
   double s;
   s=(a+b+c+d)/2;
  return sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(3.1415926*r/360),2));	
}
 int main ()
 {
   double a,b,c,d,r;
   scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&r);
   if(mjs(a,b,c,d,r)<0)
	   printf("Invalid input\n");
	  else    printf("%.4lf\n",mjS(a,b,c,d,r));
	  return 0;
 }
int main()
{
	double PI,a,b,c,d,s,S,p,o;
	PI=3.1415926;

scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&p);
s=(a+b+c+d)/2;
o=p/360*2*PI/2;
double x=(s-a)*(s-b)*(s-c)*(s-d);
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(o)*cos(o));
	if(x<0)
	{printf("Invalid input");
	}
else
{printf("%.4lf",S);}
return 0;
}
int main()
{
	double a,b,c,d,e,s,t,pi,ang;
	scanf("%lf\n",&a);
	scanf("%lf\n",&b);
	scanf("%lf\n",&c);
	scanf("%lf\n",&d);
	scanf("%lf",&ang);
	pi=3.1415926;
	s=(a+b+c+d)/2;
	e=ang*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
	printf("%.4lf\n",sqrt(t));
}
void 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;

S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(3.1415926*e/360)*cos(3.1415926*e/360)); 
    
S>0?printf("%.4lf",S):printf("Invalid input");

}
int main()
{
	double a[4];
	double angle;
	double s=0.0;
	double S=0;
	int i;
	for(i=0;i<4;i++)
	{
		scanf("%lf",&a[i]);
		s+=a[i];
	}
	s/=2;
	scanf("%lf",&angle);
	angle=angle/360*PI;
	S=(s-a[0])*(s-a[1])*(s-a[2])*(s-a[3])-a[0]*a[1]*a[2]*a[3]*cos(angle)*cos(angle);
	if(S<0)
	{
		printf("Invalid input");
		return 0;
	}
	S=sqrt(S);
	printf("%.4lf",S);
	return 0;
}
double area(double a1, double b1 ,double c1, double d1, double e1);
int main()
{
	double a,b,c,d,e;
	double S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	S=area(a,b,c,d,e);
	if(S==-1)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4lf",S);
	}
	return 0;
}
double area(double a1, double b1,double c1, double d1, double e1)
{
	double s,y,S;
	s = (a1+b1+c1+d1)/2; 
	y=(double)(s-a1)*(s-b1)*(s-c1)*(s-d1) - a1*b1*c1*d1*cos(e1/360.0*PI)*cos(e1/360.0*PI);
	if(y<0)
	{
		S=-1;
	}
	else
	{
		S=(double)sqrt((s-a1)*(s-b1)*(s-c1)*(s-d1) - a1*b1*c1*d1*cos(e1/360.0*PI)*cos(e1/360.0*PI)); 
	}
	return S;
}
main()
{
      double a,b,c,d;
      scanf("%lf %lf %lf %lf",&a,&b,&c,&d);
      double s=(a+b+c+d)/2;
      double m;
      scanf("%lf",&m);
      double co=(m/180)*PI;
      double p;
      double q;
      q= (s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(co/2)*cos(co/2);
      if(q<0)
      printf("Invalid input");
      else
      {p=sqrt(q);
      printf("%.4lf",p);}
      
           
}
int main()
{
    float a,b,c,d,e,s,r;
    scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
    s=(a+b+c+d)/2;
    r=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e/180*p/2)*cos(e/180*p/2);
    if(r<0)
    {
        printf("Invalid input");
    }
    if(r>=0)
    {
        printf("%.4f",sqrt(r));
    }
    return 0;
}
int main()
{
   double a,b,c,d,e,s,S;
   scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
   s=(a+b+c+d)/2;
   if((s-a)*(s-b)*(s-c)*(s-d)>=a*b*c*d*pow(cos(e*PI/360),2)){
   S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(e*PI/360),2));
   printf("%.4lf",S);
   }
else
 {
   printf("Invalid input");
}
   
   return 0;
}
void main()
{
	float a,b,c,d,s,m;
	double e,f,g,h,i,j,k;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&m);
	s=(a+b+c+d)/2;
	e=(s-a)*(s-b)*(s-c)*(s-d);
	k=m*3.1415926/180;
	f=cos(k);
	g=(f+1)/2;
	h=a*b*c*d*g;
	i=e-h;
	if(i<0)
		printf("Invalid input\n");
	else
	{
		j=sqrt(i);
		printf("%.4f\n",j);
	}
}
double i,h,a,b,c,d,e;
double f(double a,double b,double c,double d,double h)
{
	double g;
	g=sqrt((i-a)*(i-b)*(i-c)*(i-d)-a*b*c*d*cos(h)*cos(h));
	return(g);
}
void main()
{
	double s;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
    i=(a+b+c+d)/2;
    h=e/2/180*3.1415926;
	if((i-a)*(i-b)*(i-c)*(i-d)<a*b*c*d*cos(h)*cos(h))printf("Invalid input");
	else
	{
		s=f(a,b,c,d,h);
	    printf("%.4lf",s);
	}
}
main()
{
	double a,b,c,d,e,f,g,h,i,l;

	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&g);
	0<g<360;
    l=PI*g/180/2;
	e=(a+b+c+d)/2;
	h=pow(cos(l),2);
	i=(e-a)*(e-b)*(e-c)*(e-d)-a*b*c*d*h;
    if( i<0)
		printf("Invalid input\n"); 
	else
	{f=sqrt((e-a)*(e-b)*(e-c)*(e-d)-a*b*c*d*h);

    printf("%.4lf\n",f);}
    
    return 0;
}
int main()
{

    double a,b,c,d,x,y,z;
    double s;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
    #define PI 3.1415926
	y=(double)cos(PI*x/360);
	z=(double)(a+b+c+d)/2;
	if((z-a)*(z-b)*(z-c)*(z-d)-a*b*c*d*y>=0)
	{
	    s=(double)sqrt((z-a)*(z-b)*(z-c)*(z-d)-a*b*c*d*y*y);
		printf("%.4lf",s);
	}
	else
	{
		printf("Invalid input");
	}
	return 0;
}
void main()
{
	int i,n;double *p;
	p=(double *)calloc(1,5*sizeof(double));
	scanf("%lf %lf %lf %lf %lf",p,p+1,p+2,p+3,p+4);

	double x,s=0;
	for(i=0;i<4;i++)
	{s+=*(p+i);}
	s=s/2;
	x=(s-*p)*(s-*(p+1))*(s-*(p+2))*(s-*(p+3))-*p**(p+1)**(p+2)**(p+3)*cos(*(p+4)/360*3.1415926)*cos(*(p+4)/360*3.1415926);
	if(x<0) printf("Invalid input");
	else{x=sqrt((s-*p)*(s-*(p+1))*(s-*(p+2))*(s-*(p+3))-*p**(p+1)**(p+2)**(p+3)*cos(*(p+4)/360*3.1415926)*cos(*(p+4)/360*3.1415926));
    printf("%.4lf",x);}
}
int main()
{
double a ,b,c,d,n,m,q,s;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&n);
m=n/2;
s=(a+b+c+d)/2;
q=3.1415926*m/180;
if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q)<0){
printf("Invalid input");
}else if ((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q)>0){
s=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q));
printf("%.4lf",s);
}
return 0;
}
int main()
{ double a=0,b=0,c=0,d=0,t=0,s=0,h=0,S=0,pi=3.1415926;
  scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&t);
  t=t/2;
  h=t*pi/180;
  s = (a+b+c+d)/2;
  if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(h)*cos(h)>=0)
  {S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(h)*cos(h)); 
  printf("%.4lf",S);}
  else if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(h)*cos(h)<0)
  printf("Invalid input");
    return(0); 
  
	
	
}
double a,b,c,d,s,S,f,PI=3.1415926;
void abc()
{
	s=(a+b+c+d)/2;
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f/360*PI)*cos(f/360*PI))>0)
	{
    S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f/360*PI)*cos(f/360*PI));
	printf("%.4lf",S);
	}
	else
	{
	printf("Invalid input");
	}
	
}
void main()
{
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&f);
    abc();
	
	
}
int main()
{
	float a,b,c,d,e,s,S;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
	s=1.0/2*(a+b+c+d); 
	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 {
S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*3.1415926/360)*cos(e*3.1415926/360)); 
	printf("%.4lf",S);}
	return 0;
}
double area(double a,double b,double c,double d,double p)
{
       double s=(a+b+c+d)/2;
       double PI=3.1415926;
       double S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(p*PI/360)*cos(p*PI/360));
       return S;
}
main()
{
      double a,b,c,d,p,S;
      double PI=3.1415926;
      scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&p);
      double s=(a+b+c+d)/2;
      double m=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(p*PI/360)*cos(p*PI/360);
      if(m<0)
      {
             printf("Invalid input");
      }
      else
      {
          S=area(a,b,c,d,p);
          printf("%.4lf",S);          
      }
}
int main()
{
	double a,b,c,d,r,s,S;
	double result(double,double,double,double,double);
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&r);
	S=result(a,b,c,d,r);
	if(S!=0)
		printf("%.4lf",S);
	return 0;
}
double result(double a,double b,double c,double d,double r)
{
	double s,S;
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(PI*r/360)*cos(PI*r/360)>=0)
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(PI*r/360)*cos(PI*r/360));
	else
	{
		printf("Invalid input");
		S=0;
	}
	return S;
}
double s,s2;
double size(double x);

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

	s=(a+b+c+d)/2;
    
	s2=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(jd/180*PI/2)*cos(jd/2/180*PI);

	if(s2>=0)
		printf("%.4lf",size(s2));
	else
		printf("Invalid input");
	
	return 0;
}


double size(double x){
	return sqrt(s2);
}
main()
{
    double a=0, b=0, c=0, d=0;
    double angle=0;
          scanf("%lf",&a);
          scanf("%lf",&b);
          scanf("%lf",&c);
          scanf("%lf",&d);
          scanf("%lf",&angle);
    double 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\n");
    }
    else
    {        
          printf("%.4lf\n",sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(angle/360*pi)*cos(angle/360*pi)));
    }
    
	return 0;

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

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

int main()
{
    double a,b,c,d,e,f,g,s,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=0.5*(a+b+c+d);
    g=e*PI/360;
	f=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(g),2));
    if(f>=0){
     S=sqrt(f); 
	 printf("%0.4lf",S);
	}
	else {
		printf("Invalid input");
	}
	return 0;
}
int main()
{
	double S,s,a,b,c,d,angle,angle2;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&angle);

	s=(a+b+c+d)/2;
	angle2=((angle/(double)2)/((double)180))*pi;

	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((angle/180)*pi))<0)
	{
		printf("Invalid input");
	}

	else 
	{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle2)*cos(angle2));
		printf("%.4lf",S);
	}

    return 0;
}
int main()
{
    double S(double a,double b,double c,double d,double e);
    double a1,b1,c1,d1,e1,e2;
    scanf("%lf%lf%lf%lf%lf",&a1,&b1,&c1,&d1,&e1);
    e2=e1/360*PI;
    if(S(a1,b1,c1,d1,e2)==0){
                             printf("Invalid input\n");
                             }
    else{
         printf("%.4lf\n",S(a1,b1,c1,d1,e2));
         }
   
    return 0;
    }
double S(double a,double b,double c,double d,double e)
{
       double delta,s,S;
       s=(a+b+c+d)/2;
       delta=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e)*cos(e);
       if(delta<0){
                   S=0;
                   }
       else{
            S=sqrt(delta);
            }
       return S;
       }
void main()
{
	double S(double ,double ,double ,double ,double );
	double a,b,c,d,sq,angle;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
	sq=S(a,b,c,d,angle);
	if(sq==0) printf("Invalid input");
	else
	printf("%.4f",sq);
}
double S(double a,double b,double c,double d,double angle)
{
	double s,S,x,y;
	s=(a+b+c+d)/2;
	x=cos(angle/360*3.1415926);
	y=x*x;
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*y)<0) return(0);
	else
	{
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*y);
	return(S);
	}
}
void main()
{
   double a=0,b=0,c=0,d=0,t=0;
   scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&t);
   double p=0,s=0;
   t=t/360*PAI;
   p=(a+b+c+d)/2;
   s=(p-a)*(p-b)*(p-c)*(p-d)-a*b*c*d*cos(t)*cos(t);
   if(s<0)
	   printf("Invalid input");
   else
   {
	   s=sqrt(s);
       printf("%.4lf",s);
   }
}
float area(float a,float b,float c,float d,float s,float p);
	float a,b,c,d,m;
	float r,s,p=0,S;
int main()
{
    scanf("%f\n%f\n%f\n%f\n%f",&a,&b,&c,&d,&m);
    S=area(a, b, c, d, s, p);
	if (S<0)
		printf("Invalid input\n");
	else
		printf("%.4f\n",S);
	return 0;
}
float area(float a,float b,float c,float d,float s,float p)
{
    p=(m* PI)/(2*180);
    s = (a+b+c+d)/2;
   if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(p)*cos(p))<0)
return -1;
    S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(p)*cos(p));
    return S;
}
int main(){
    float a,b,c,d;
    float an;
    scanf("%f\n %f\n %f\n %f\n %f\n",&a,&b,&c,&d,&an);
    float s;
    s = (a+b+c+d)/2;
    float angel=an*2*3.1415926/360;
    double S;
    S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(angel/2))*(cos(angel/2)));
    if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(angel/2))*(cos(angel/2))<0){
             printf("Invalid input");
    }
    else{
          printf("%.4lf",S);
    }
    return 0;
}
double area(double a,double b,double c,double d,double arpha)
{
    double s,S,temp;
    s=(a+b+c+d)/2;
    arpha*=0.5*PI/180;
    temp=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(arpha)*cos(arpha);
    if (temp<0)
    return -1;
    else
    {
        S=sqrt(temp);
        return S;
    }
}
main()
{
    double a,b,c,d,arpha,S,temp;
    scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&arpha);
    temp=area(a,b,c,d,arpha);
    if (temp<0)
    printf("Invalid input");
    else
    {
        printf("%.4f",temp);
    }
}
int main()
{
	double a,b,c,d,du,s,t;
	scanf("%lf",&a);
    scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&du);
	s=(a+b+c+d)/2;
	t=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(du*3.1415926/360)*cos(du*3.1415926/360);
	if(t<0)
		printf("Invalid input");
	else
		printf("%.4lf",sqrt(t));
	return 0;
}
int main()
{
	double a,b,c,d,s=1,zzz,area;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&zzz);
	zzz=zzz*PI/360;
	s=0.5*(a+b+c+d);
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(zzz)*cos(zzz))<0)
	{
		printf("Invalid input");
		return 0;
	}
	area = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(zzz)*cos(zzz));
	printf("%.4lf\n",area);


	return 0;
}
int main(int argc, char* argv[])
{
double a,b,c,d,e,f,h,s,i,j,S;
    scanf("%lf",&a);
	scanf("%lf",&b);
    scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	f=e/2;
	h=cos ((f/360)*2*3.1415926);
    s =(a+b+c+d)/2; 
	i=(s-a)*(s-b)*(s-c)*(s-d);
	j=(a*b*c*d*h*h);
	if( i-j<0){
	printf("Invalid input\n");
	}
else
    {S = sqrt(i-j); 
	printf("%.4lf\n",S);}
	return 0;
}
void main()
{
 double s(double a,double b,double c,double d,double t);
 int i;
 double l[5];
 for(i=0;i<=4;i++)
  scanf("%lf",&l[i]);
 if(s(l[0],l[1],l[2],l[3],l[4])<0)
  printf("Invalid input");
 else 
  printf("%.4lf",sqrt(s(l[0],l[1],l[2],l[3],l[4])));
}
double s(double a,double b,double c,double d,double t)
{
 double x,m;
 t=t/360*3.1415926;
 m=(a+b+c+d)/2;
 x=(m-a)*(m-b)*(m-c)*(m-d)-a*b*c*d*cos(t)*cos(t);
 return(x);
}
int main()
{
	double a,b,c,d,e,f,s,S,g;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
	f=e/180*3.1415926;
	g=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f/2)*cos(f/2);
	if(g<0)
		printf("Invalid input");
	else
	{
		S=sqrt(g);

	printf("%.4lf",S);
	}
	
	return 0;
}
int main()
{
	void mian(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);
	mian(a,b,c,d,e);
	return 0;
}

void mian(double a,double b,double c,double d,double e)
{
	double s;
	s=(a+b+c+d)/2; 
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*PI/360)*cos(e*PI/360))<0)
		printf("Invalid input");
	else printf("%.4lf",sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*PI/360)*cos(e*PI/360)));
}
int main()
{
	double a,b,c,d,s,p,q,size;			/*p???????????*/
	double sumangel,angel;
	const double PI=3.1415926;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&sumangel);
	s=(a+b+c+d)/2;
	angel=sumangel/180*PI/2;
	q=cos(angel);
	p=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*q*q;
	if(p>=0)
	{
		size=sqrt(p);
		printf("%.4f\n",size);
	}
	else
		printf("Invalid input");
	return 0;
}
int main()
{
	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;
}
// ????????????.cpp : ??????????????
//


int main()
{//declaration
	double a,b,c,d,s,S,angle2,angle,S2;
	const double Pi=3.1415926;
//input
	scanf("%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d);
	scanf("%lf",&angle2);
//process
	angle=angle2/2*2*Pi/360;
	s=(a+b+c+d)/2;
	S2=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle)*cos(angle);
	if(S2>0)printf("%.4f",sqrt(S2));
	else printf("Invalid input");
	return 0;
}
int main()
{double a,b,c,d,e,s,l,k;
 scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);

s = (a+b+c+d)/2;
k=e/180*3.1415926;
if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(k/2)*cos(k/2)<0)
printf("Invalid input");
if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(k/2)*cos(k/2)>0)
{l = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(k/2)*cos(k/2)); 
printf("%.4lf",l);}
return 0;
}
main()
{
      float s,a,b,c,d,e,f,g;
      scanf("%f",&a);
      scanf("%f",&b);
      scanf("%f",&c);
      scanf("%f",&d);
      scanf("%f",&e);
      s=(a+b+c+d)/2;
      f=(e/180)*PI;
      g=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f/2)*cos(f/2); 
      if(g<0)
      {printf("Invalid input");}
      else
      {
          s=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f/2)*cos(f/2));
          printf("%.4f",s);}
          getchar();
          getchar();
          getchar();
}
main()
{
  double a,b,c,d,s,x,y,z;
  const double PI=3.1415926;
  scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&x);
  s=(a+b+c+d)/2;
  x=x*PI/360;
  y=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x);
  if(y>0)
    {
   z=sqrt(y);
  printf("%.4lf\n",z);  
}
  else
    printf("Invalid input\n");
  getchar();getchar();getchar();getchar();        
}
void main()
{
	double a,b,c,d,m,s,S,t;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&m);
	m=m/360*pi;
    s=(a+b+c+d)/2;
	t=cos(m)*cos(m);
    if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*t<0)
		printf("Invalid input\n");
	else
	{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*t);
		printf("%.4lf\n",S);
	}
}
double area(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(area(a,b,c,d,e)==-1)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4lf",area(a,b,c,d,e));
	}
}
double area(double a,double b,double c ,double d,double e )
{
	double S,s,x,y;
	s=(a+b+c+d)/2.0;
	y=e*3.1415926/360.0;
	x=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y);
	if (x>=0)
	{
		S=sqrt(x);
		return S;
	}
	else 
	{
		return(-1);
	}
		
	
	
}
void main ()
{
	double rtrt(double a,double b,double c,double d,double angle);
	double area,p,a,b,c,d,angle;
	scanf ("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&angle);
	p=rtrt(a,b,c,d,angle);
	if (p<0)
		printf("Invalid input");
	else 
	{
		area=sqrt(p);
		printf("%.4lf",area);
	}
}
double rtrt(double a,double b,double c,double d,double angle)
{
	double pi=3.1415926;
	double s,p;
	s=(a+b+c+d)/2;
	angle=(angle*pi)/360.0;
	p=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle)*cos(angle);
	return p;
}
int main()
{
	double a,b,c,d,s,e,x,y;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
	x=e*PI/360;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x)<0){
		printf("Invalid input");
	}
	else
	{
		y= sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x));
		printf("%.4lf",y);
	}
	return 0;
}
void area(double a,double b,double c,double d,double r);

int main()
{
   double a[5],S;
   int i;

   for(i=0;i<5;i++)
   {
      scanf("%lf",&a[i]);
   }

   area(a[0],a[1],a[2],a[3],a[4]);
   
  return 0;
}

void area(double a,double b,double c,double d,double r)
{
   double s,t,S;

   s=(a+b+c+d)/2;
   t=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(r*PI/360)*cos(r*PI/360);

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

double mianji(double X){
       double S2;
       S2=sqrt(X);
       return (S2);
       }