semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main ()
{
    double a, b, c, d,  m, s;
	scanf("%lf%lf%lf%lf%lf",  &a, &b, &c, &d, &m); 
    m=m/360*3.1415926;
	s=1.0/2*(a+b+c+d); 
	s= (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(m)*cos(m);
	if (s<0)
		printf("Invalid input\n");
		else printf("%.4f\n", sqrt(s));
	return 0;
}
float getSqrt(float S);

int main(int argc, char* argv[])
{
	double a,b,c,d,e,s,S,f;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	f=360;
	s=(a+b+c+d)/2;
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*PI/f)*cos(e*PI/f));
	if (((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*PI/f)*cos(e*PI/f))>0)
       printf("%.4lf\n",S);
    else
		printf("Invalid input\n");
	
	return 0;
}
int main()
{
	double a,b,c,d;
	double u,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&u);
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(u/2*PI/180)*cos(u/2*PI/180));
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(u/2*PI/180)*cos(u/2*PI/180))<0)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4lf",S);
	}
	return 0;
}
void main(int argc,char*argv[])
{
	double a,b,c,d,e,s,area,temp,angle;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	angle=pi*(e/360);
	s=(a+b+c+d)/2;
	temp=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle)*cos(angle);
	if(temp<0)
	  printf("Invalid input");
	else
	{
		area=sqrt(temp);
		printf("%.4f\n",area);
	}
}
void main()
{
	double a,b,c,d,e,f,s,S,t;
	int i;
	double g[5];
	for(i=0;i<5;i++)
		scanf("%lf",&g[i]);
	s=(double)(g[0]+g[1]+g[2]+g[3])/(double)2;
	f=(double)g[4]/(double)180*3.1415926;
	t=(s-g[0])*(s-g[1])*(s-g[2])*(s-g[3])-g[0]*g[1]*g[2]*g[3]*cos(f/2)*cos(f/2);
	if(t<0) printf("Invalid input");
	else 
	{
		S=sqrt(t);
		printf("%.4lf",S);
	}
}
int main(){
double a,b,c,d,f,S,s;
scanf("%lf",&a);
scanf("%lf",&b);
scanf("%lf",&c);
scanf("%lf",&d);
scanf("%lf",&f);
S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((f/2)/180*PI)*cos((f/2)/180*PI)); 
if ((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f/2)*cos(f/2)<0){
    printf("Invalid input");
}else{
    printf("%.4lf",S);
}
return 0;
}
int main()
{
	float a,b,c,d;
	float e,S,s,g,m;
	scanf("%f%f%f%f",&a,&b,&c,&d);
	scanf("%f",&e);
	g=(float)e/360*3.1415926;
    s=(float)1.0/2*(a+b+c+d);
	m=(float)(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(g)*cos(g);		
    if (m<0)
	{
		printf("Invalid input");
	}
	else
	{S=(float)sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(g)*cos(g));
	printf("%.4f",S);}
	return 0;
}
main()
{
  double a,b,c,d,w,s;
  scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&w);
  w=PI*w/180/2;
  s=0.5*(a+b+c+d);
  s=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(w)*cos(w);
  if(s<0) printf("Invalid input");
  else printf("%.4lf",sqrt(s));
  getchar();
  getchar();
  getchar();
}
int main()
{
double a,b,c,d;
double A;
scanf("%lf",&a);
scanf("%lf",&b);
scanf("%lf",&c);
scanf("%lf",&d);
scanf("%lf",&A); 
double s=(a+b+c+d)/2; 
double B=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(A/360*PI)*cos(A/360*PI);
if(B<0)
printf("Invalid input");
else
{
double H=(double)sqrt(B);
printf("%.4lf",H);
}    
return(0);          
}
double getarea(double a,double b,double c,double d,double e,double jiaodu);
int main ()
{
    double k,l,m,n,s,jiao;
    double area,zanshi;
    scanf("%lf%lf%lf%lf%lf",&k,&l,&m,&n,&jiao);
    s=(k+l+m+n)/2;
    jiao=jiao/360*PI;
    jiao=cos(jiao);
    zanshi=getarea(k,l,m,n,s,jiao);
    if(zanshi<0){
     printf("Invalid input");
    }
    else{
          area=sqrt(zanshi);
          printf("%.4lf",area);
    }
    

    return 0;
}
 double getarea(double a,double b,double c,double d,double e,double jiaodu)
{
       double zanshimianji;
       zanshimianji=(double)((e-a)*(e-b)*(e-c)*(e-d)-a*b*c*d*jiaodu*jiaodu);
       return zanshimianji;
}
int main(){
double a,b,c,d,s,x,Y;

scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
s=1.0/2*(a+b+c+d); 
x/=2;
Y=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(x*3.1415926/180)*cos(x*3.1415926/180)); 
if((s-a)*(s-b)*(s-c)*(s-d) < a*b*c*d*cos(x*3.1415926/180)*cos(x*3.1415926/180)){
printf("Invalid input");
}else{
	printf("%.4lf",Y);
}
return 0;
}
int main()
{
    double a,b,c,d,s,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)>0)
    {S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*3.1415926)*cos(e/360*3.1415926));
    printf("%.4lf",S);}
    else
    printf("Invalid input");
    return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d;
	double inside;
	double s;
	double rad,S;
	double angle;
	scanf("%lf""%lf""%lf""%lf",&a,&b,&c,&d);
	scanf("%lf",&angle);
	s=(a+b+c+d)/2;
	rad=angle/360*PI;
    inside=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(rad)*cos(rad); 
	if (inside>=0)
	{ 
	S=sqrt(inside);
	printf("%.4lf",S);
	}
    else 
	{
		printf("Invalid input\n");
	}
return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d,ang,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&ang);
    double rad=ang/2/180*3.1415926;
    double s=(a+b+c+d)/2;
	double gen=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(rad)*cos(rad);
	if(gen<0)
	{
		printf("Invalid input");
	}
	else
	{
        S=sqrt(gen);
		printf("%.4f",S);
	}
	return 0;
}
void main()
{
	const double PI = 3.1415926;
	double S, a, b, c, d;
	double s, alpha, inTheSqrt;
	scanf( "%lf", &a);
	scanf( "%lf", &b);
	scanf( "%lf", &c);
	scanf( "%lf", &d);
	s = ( a + b + c + d ) / 2;
	scanf( "%lf", &alpha);
	inTheSqrt = (s-a) * (s-b) * (s-c) * (s-d) - a * b * c * d * pow( cos(alpha/360*PI), 2);
	if( inTheSqrt < 0) {
		printf( "Invalid input\n");
		return;
	}
	S = sqrt( inTheSqrt); 
	printf("%.4lf\n", S);
}
int main()
{
	double a,b,c,d,e,s,g,h,i;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	i = e*PI/180;
	s = (a+b+c+d)/2;
	g = (s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(i/2)*cos(i/2);
    h = sqrt(g);
	if(e>0&&e<360)
		if(g>0)
		  printf("%.4lf\n",h);
	    else printf("Invalid input");
	return 0;
}
int main(int argc, char* argv[])
{
    double a,b,c,d,x,s,S,y,m;
    double PI=3.1415926;
    scanf("%lf %lf %lf %lf %lf", &a, &b, &c, &d, &x);
      s=(a+b+c+d)/2;
      y=(x * PI)/360;
    S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y));
    m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y);
    if(m<0)
       printf("Invalid input");  
    else 
       printf("%.4lf\n",S);
    return 0;
}
int main()
{
    float a,b,c,d,s,S;
    float K;
	double A,B;
    scanf("%f%f%f%f",&a,&b,&c,&d);
    scanf("%f",&K);
    s = (a+b+c+d)/2;
    A= K*PI/360;
    B = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(A),2); 
    if(B>=0)
    {  S = (B); 
    printf("%.4f\n",sqrt(S));
    }
    else 
    {  printf("Invalid input\n");
    }
    return 0;
}
int main()
{
	int i;
	double a[5],s,S,e;
	for(i=0;i<5;i++){
		scanf("%lf",&a[i]);}
	s=(a[1]+a[2]+a[3]+a[0])/2;
	e=((s-a[1])*(s-a[2])*(s-a[3])*(s-a[0])-a[1]*a[2]*a[3]*a[0]*cos(a[4]/2*3.1415926/180)*cos(a[4]/2*3.1415926/180));
	if(e<0){
		printf("Invalid input");}
	else{
		S=sqrt(e);
		printf("%.4lf",S);}
	return 0;
}
main()
{
      double a,b,c,d,k;
      scanf("%lf",&a);
      scanf("%lf",&b);
      scanf("%lf",&c);
      scanf("%lf",&d);
      scanf("%lf",&k);
      double s=(a+b+c+d)/2;
      double t=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*(cos(k*PI/360))*(cos(k*PI/360)));
      if(t<0) printf("Invalid input\n");
      else printf("%.4lf\n",sqrt(t));
}
void S(double a,double b,double c,double d,double angle)
{
	double s;
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle*PI/360)*cos(angle*PI/360)>=0)
	{
		printf("%.4lf",pow(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle*PI/360)*cos(angle*PI/360)),0.5));
	}else{
		printf("Invalid input");
	}
	
}

int main(int argc, char* argv[])
{
	double a,b,c,d,angle;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
	S(a,b,c,d,angle);
	return 0;
}
double s(double a,double b,double c,double d,double q)
{
	double area,k,w,i;
	w=(a+b+c+d)/2;
	k=q*0.5*3.1415926/180;
	i=(w-a)*(w-b)*(w-c)*(w-d)-a*b*c*d*cos(k)*cos(k);
	if(i<0)
		area=-1;
	else
		area=sqrt(i);
	return (area);
}
int main()
{
    double s(double a,double b,double c,double d,double q);
	double a,b,c,d,q,k;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&q);
	k=s(a,b,c,d,q);
	if(k<0)
	printf("Invalid input");
	else
    printf("%.4lf",k);
}
int main(int argc, char* argv[])
{
	double a,b,c,d,x,y;
	double s;
	double S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	s = (a+b+c+d)/2;
	y=x/360*PI;
	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(y)*cos(y)); 
	if(S>=0){
	printf("%.4lf",S);
	}
	else{
		printf("Invalid input");}
	return 0;
}
double mianji(double a,double b,double c,double d,double O)
{
	double S,s;
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(O)*cos(O)>=0)
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(O)*cos(O));
	else
		S=-1;
	return S;
}

main()
{
	double a,b,c,d,o,O;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&o);
	O=2*PI*(o/2)/360;
	if(mianji(a,b,c,d,O)==-1)
		printf("Invalid input\n");
	else
		printf("%.4lf\n",mianji(a,b,c,d,O));
}
main()
{
      double a,b,c,d,e,s;
      scanf("%lf\n%lf\n%lf\n%lf\n%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*3.141592653)*cos(e/360*3.141592653)<0)
      printf("Invalid input\n");
      else if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*3.141592653)*cos(e/360*3.141592653)>=0)
      printf("%.4f\n",sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/360*3.141592653)*cos(e/360*3.141592653)));
}
main()
{
      int i,j;
      float a,b,c,d,s,angle,S,delta;
      scanf("%f\n%f\n%f\n%f\n%f\n",&a,&b,&c,&d,&angle);
      angle/=2;
      angle/=360;
      angle*=(2*3.1415926);
      s=(a+b+c+d)/2;
      delta=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle)*cos(angle);
      if(delta<0)
           printf("Invalid input");
      else
      {
           S=sqrt(delta);
           printf("%.4f",S);
      }
      }
int main()
{
	double a,b,c,d,e,s,S;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf\n",&a,&b,&c,&d,&e);
	if(0<=e&&e<=360)
	{
		s = (a+b+c+d)/2;
		S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((e*PI)/(180*2))*cos((e*PI)/(180*2))); 
		if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((e*PI)/(180*2))*cos((e*PI)/(180*2))<0)
		{printf("Invalid input");}
		else
		{	printf("%.4lf",S);}
	}
	return 0;
}
int main()
{
double a=0,b=0,c=0,d=0,e=0,f=0,s=0;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
f=(a+b+c+d)/2;
s=sqrt((f-a)*(f-b)*(f-c)*(f-d)-a*b*c*d*cos(e/360*pi)*cos(e/360*pi));
if(s>=0)
printf("%.4lf",s);
else
printf("Invalid input\n");

return 0;
}
double MyComputeArea();
int main()
{
	double MyQuadrangleArea=0;
	MyQuadrangleArea=MyComputeArea();
	if(MyQuadrangleArea<0)
	{
		printf("Invalid input\n");
	}
	else
	{
		printf("%.4lf\n",MyQuadrangleArea);
	}
	return 0;
}

double MyComputeArea()
{
	double MyQuadrangleArea=0;
	
	double side1=0,side2=0,side3=0,side4=0,angle=0;
	scanf("%lf",&side1);
	scanf("%lf",&side2);
	scanf("%lf",&side3);
	scanf("%lf",&side4);
	scanf("%lf",&angle);

	double MyAngle=angle*PI/180.0;
    //printf("%.4lf\n",MyAngle);
	double s=0;
	s=(side1+side2+side3+side4)/2.0;
	//S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos2?);
	if((s-side1)*(s-side2)*(s-side3)*(s-side4)-side1*side2*side3*side4*(1+cos(MyAngle))/2>=0)
	{
		MyQuadrangleArea=sqrt((s-side1)*(s-side2)*(s-side3)*(s-side4)-side1*side2*side3*side4*(1+cos(MyAngle))/2);
	}
	else
	{
		return -1;
	}
	return MyQuadrangleArea;
}
int main()
{
double a,b,c,d,angle;
 double s,m,n,p,q,o;
scanf("%lf\n%lf\n%lf\n%lf\n%lf\n",&a,&b,&c,&d,&angle);
s=(a+b+c+d)/2;
m=s-a;
n=s-b;
p=s-c;
q=s-d;
o=angle/2;
double x,y,S,hudu;
hudu=3.1415926*o/180;
y=a*b*c*d*cos(hudu)*cos(hudu);
x=m*n*p*q;
S=x-y;
if(S>0)
{s=sqrt(S);
printf("%.4lf",s);
}
else{printf("Invalid input\n");}
return 0;
}
int main()
{
double a=0,b=0,c=0,d=0,q=0,s=0,e=0,t=0;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&q);
s=(a+b+c+d)/2;
t=q/2/180*PI;
e=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(t)*cos(t);
if (e>=0){
s = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(t)*cos(t));
printf("%.4lf",s) ;
}
else printf("Invalid input");
return 0;
}
int main()
{
	double a[5],s,S,c,b;
	int i;
	for(i=0;i<5;i++)
	{
		scanf("%lf",&a[i]);
	}
	b=a[0]*a[1]*a[2]*a[3]*cos(a[4]/2*pai/180)*cos(a[4]/2*pai/180);
	s=1.0/2*(a[0]+a[1]+a[2]+a[3]);
	c=(s-a[0])*(s-a[1])*(s-a[2])*(s-a[3]);
	if(c<b)
	{
		printf("Invalid input");
	}
	else
	{
		S=sqrt(c-b);
	printf("%.4lf\n",S);
	}
	return 0;
	
}
int main()
{

double a,b,c,d,de;
scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&de);

double aa;
aa=( de/2 )* PI / 180;

double S,s;


s = (a+b+c+d)/2; 

S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(aa)*cos(aa)); 


if((s-a)*(s-b)*(s-c)*(s-d)>=0)
printf("%.4f\n",S);
else
printf("Invalid input");

	return 0;
}
double s,a,b,c,d,angle;
int main()
{
	double area(double x,double y,double z,double w,double foot);
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&angle);
	if(area(a,b,c,d,angle)>=0)printf("%.4lf",area(a,b,c,d,angle));
	else printf("Invalid input");
}
double area(double x,double y,double z,double w,double foot)
{
	double AREA,s,num,PI=3.1415926;
	s=(x+y+z+w)/2;
	num=(s-x)*(s-y)*(s-z)*(s-w)-x*y*z*w*cos(foot/360*PI)*cos(foot/360*PI);
	if(num>=0)return(sqrt(num));
	else return(-1);
}
double sqrt(double p);
double cos(double j);
int main(){
	double p;
	double a,b,c,d;
	double j;
    double S,s;
	scanf("%lf %lf %lf %lf",&a,&b,&c,&d);
	scanf("%lf",&j);
	s = (a+b+c+d)/2;
	p=((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(j*3.1415926/360)*cos(j*3.1415926/360)); 
	
if(p>0)	{S = sqrt(p);
	printf("%.4lf",S);}
else{
printf("Invalid input");}
    return 0;
}
int main()
{
	double a,b,c,d,e,e1,s,s1,s2;
         scanf("%lf",&a);
         scanf("%lf",&b);
         scanf("%lf",&c);
         scanf("%lf",&d);
         scanf("%lf",&e);
        e1=3.1415926*e/180;
        s = (a+b+c+d)/2;
        s2 = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((e1)/2)*cos((e1)/2); 
 
if(s2<=0){
printf("Invalid input");

}
else{
s1 = sqrt ((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((e1)/2)*cos((e1)/2)); 
printf("%.4f", s1); 
	}
return 0;
}
int main(int argc, char* argv[])
{
	double a;
	double b;
	double c;
    double d;
	double x;
	double S;
	double s;
	scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
	scanf("%lf",&x);
	s = 1.0/2*(a+b+c+d);
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(x/2*PI/180)*cos(x/2*PI/180)<0)
	{
		printf("Invalid input");
	}
	else 
	{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(x/2*PI/180)*cos(x/2*PI/180)); 
        printf("%.4lf\n",S);
	}
	return 0;
}
int main()
{
	float a, b, c, d, s;
	double S, m, e;
	scanf("%f%f%f%f", &a, &b, &c, &d);
	scanf("%lf", &e);
    m = (e*3.1415926)/(2*180);
	s = 0.5*(a+b+c+d);
         if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(m)*cos(m)<0 )
         {  
         printf("Invalid input");
         } 
         else
         {
          S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(m)*cos(m)); 
           printf("%.4lf", S);
          }
	return 0;
}
double s(double a,double b,double c,double d,double t)
{
	double s,u,ar;
	s=(a+b+c+d)/2;
	u=(t*PI)/360;
    ar=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(u)*cos(u);
	return(ar);
}
int main()
{
	double a,b,c,d,t,area;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&t);
	area=s(a,b,c,d,t);
	if(area<0) printf("Invalid input");
	else 
	{
		area=sqrt(area);
		printf("%.4lf",area);
	}
return 0;
}
void main()
{
	double mian(double a,double b,double c,double d,double j);
	double a,b,c,d,j,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&j);
	s=mian(a,b,c,d,j);
	if(s==0)printf("Invalid input");
	else printf("%.4lf",s);
}
double mian(double a,double b,double c,double d,double j)
{
  double q,w,s,e;
  q=j/2/180*3.1415926;
  s=(a+b+c+d)/2;
  w=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d* cos(q)*cos(q);
  if(w<0)return(0);
  else
  {
	  e=sqrt(w);
  return(e);
  }
}
void main()
{
	double a,b,c,d,x,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
    x=3.1415926*x/360;
	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("%.4f",sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x)) );
}
int main()
{
  double a,b,c,d,x,s,y;
  scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&x);
  s=(a+b+c+d)/2;
  y=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x*PI/360)*cos(x*PI/360));
   if((s-a)*(s-b)*(s-c)*(s-d)<a*b*c*d*cos(x*PI/360)*cos(x*PI/360))
  printf("Invalid input");
  else
   printf("%.4lf",y);
  return 0;
}
int main(){
float a,b,c,d,s,A;
double X,S;
scanf("%f%f%f%f",&a,&b,&c,&d);
s=(a+b+c+d)/2;
scanf("%f",&A);
A=A/180*PI;
X=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(A/2)*cos(A/2);
if(X<0){
printf("Invalid input");
}
else{
S = sqrt(X);
printf("%.4lf",S); 
}
return 0;
}
void asdf()
{
  double a,b,c,d,t,s,S;
  scanf("%lf",&a);
  scanf("%lf",&b);
  scanf("%lf",&c);
  scanf("%lf",&d);
  scanf("%lf",&t);
  t=t*3.1415926/360;
  s=(a+b+c+d)/2;
  if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(t)*cos(t))>=0)
  {
   S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(t)*cos(t));
   printf("%.4lf",S); 
  }
  else printf("Invalid input");
}

void main()
{
 void asdf();
 asdf();
}
void main()
{
	double area(double a,double b,double c,double d,double m);
	double S,s,a,b,c,d,m;
	void print();
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&m);
    s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d)<a*b*c*d*cos(m*PI/360)*cos(m*PI/360))
		print();

	else
	{
		S=area(a,b,c,d,m);
	    printf("%.4lf",S);
	}
}
void print()
{
	printf("Invalid input");
}
double area(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*cos(m*PI/360)*cos(m*PI/360));
	return(S);
}
int main(int argc, char* argv[])
{
	double a,b,c,d,v,s,S,PI=3.1415926;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&v);
	s=(double)(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(PI*v/360)*cos(PI*v/360)<0)
	{
		printf("Invalid input");
	}
	else
	{
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(PI*v/360)*cos(PI*v/360));
    printf("%.4lf",S);
	}
	return 0;
}
void main()
{
	float a,b,c,d,x,s;	
	scanf("%f\n",&a);
	scanf("%f\n",&b);
	scanf("%f\n",&c);
	scanf("%f\n",&d);
	scanf("%f",&x);
	float y,z;
	y=x*PI/360;
	z=(a+b+c+d)/2; 
	if( sqrt((z-a)*(z-b)*(z-c)*(z-d) - a*b*c*d*cos(y)*cos(y))>=0)
	{
		s=sqrt((z-a)*(z-b)*(z-c)*(z-d) - a*b*c*d*cos(y)*cos(y));
	    printf("%.4f",s);
	}
	else
		printf("Invalid input\n");
}
int main()
{
    double s,a,b,c,d,angle,S,x;
    scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angle);
    s = (a+b+c+d)/2; 
    x=pow(cos(angle*3.1415926/360),2);
    S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*x); 
    if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*x)<0)
    {
       printf("Invalid input");
     }
    if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*x)>=0)     
     {
        printf("%.4lf",S);
      }
    return 0;
}
main()
{
    double a,b,c,d,s,p;
    scanf("%lf",&a);
    scanf("%lf",&b);
    scanf("%lf",&c);
    scanf("%lf",&d);
    s=(a+b+c+d)/2;
    double S;
    scanf("%lf",&p);
    p=p/2;
    p=(p/180)*3.1415926;
    double q=cos(p);
    if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(q,2))<0)
    printf("Invalid input");
    else
    {
        S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(q,2));
        printf("%.4f",S);
    }
}
double area(double a,double b,double c,double d,double e)
{
	double s,angle,value,S;
	s=(a+b+c+d)/2;
	angle=(cos(e*PI/360))*(cos(e*PI/360));
	value=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*angle;
	if(value>=0)
	{
		S=sqrt(value);
		return S;
	}
	else
		return -1;
}
void main()
{
	double a,b,c,d,e,j;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	j=area(a,b,c,d,e);
	if(j==-1)
		printf("Invalid input\n");
	else
		printf("%.4lf\n",j);
}
double i(double a,double b,double c,double d,double n)
{
	double s,S,pi,k;
	pi=3.1415926;
	s=(a+b+c+d)/2;
	k=n/180*pi;
	S=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k/2)*cos(k/2);
	if(S<0)
		printf("Invalid input");
	else
		printf("%.4lf",sqrt(S));
	return 0;
}
int main()
{
	double a,b,c,d,n;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&n);
	i(a,b,c,d,n);
}
int main()
{
	double S,s,a,b,c,d,e,f(double a,double b,double c,double d,double e);
	int m,n,i,j,k,t;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	S=f(a,b,c,d,e);
	if(S!=0)
	printf("%.4lf",S);
	else
		printf("Invalid input");
}
double f(double a,double b,double c,double d,double e)
{
	double s,n,m;
	s=(a+b+c+d)/2;m=e/2/360*2*P;
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(m)*cos(m))>0)
	n=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(m)*cos(m)); 
	else
		n=0;
	return(n);
}
int main()
{
	double a,b,c,d,e,s,x,y,z,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	x=e/180*3.1415926;
	y=pow(cos(x/2) ,2);
	s=(a+b+c+d)/2;
    z=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*y;
    S=sqrt(z);
	if(z<0){
		printf("Invalid input");
	}else {
		printf("%.4lf",S);
	}
	return 0;
}
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,mj; 
int main()
{  
    scanf("%f\n%f\n%f\n%f\n%f",&a,&b,&c,&d,&m);
    mj=area(a, b, c, d, s, p);
	if (mj<0)
		printf("Invalid input\n");
	else
		printf("%.4f\n",mj); 
	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;  
    S = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(p)*cos(p); 
	if (S>=0)
		mj= sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(p)*cos(p)); 
	else 
		mj=-1;
	return mj;
}
int main()
{
	double a,b,c,d,s,x,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	s = 1.0/2*(a+b+c+d);
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos((x/360)*3.1415926),2));
	if(S>0)
		printf("%.4lf\n",S);
else printf("Invalid input\n");

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

	
	return 0;

}
void main()
{
	double a,b,c,d,e,S,s,PI=3.1415926,E;
	double A,B,C;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
	E=(e/2)*(PI/180);
	A=(s-a)*(s-b)*(s-c)*(s-d);
	B=cos(E)*cos(E)*a*b*c*d;
	C=A-B;
	if(C<0) printf("Invalid input\n");
	if(C>=0) 
	{
		S=sqrt(C);
		printf("%.4lf\n",S);
	}
}
void main(){
	double a[5],s=0.0,S,c,d,e;
	int i;
	for (i=0;i<5;i++)
	{
	scanf("%lf",&a[i]);
	}
	s=(double)(a[0]+a[1]+a[2]+a[3])/2;
	

	c=(double)(s-a[0])*(s-a[1])*(s-a[2])*(s-a[3]);
	d=(double)a[0]*a[1]*a[2]*a[3];
	e=(double)cos(a[4]*PI/2.0/180.0)*cos(a[4]*PI/2.0/180.0);
	if(c-d*e>=0){
	S=(double)sqrt(c-d*e);
	printf("%.4lf\n",S);
	}
	else printf("Invalid input\n");
}
double sq(double a,double b,double c,double d,double ang);
int main()
{
	double a,b,c,d,ang,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&ang);
	s=sq(a,b,c,d,ang);
         if(s!=0)
         printf("%.4lf",s);
	return 0;
}
double sq(double a,double b,double c,double d,double ang){
	double l=(a+b+c+d)/2;
	double rad=PI*ang/360;
	double m=cos(rad);
	double n=(l-a)*(l-b)*(l-c)*(l-d)-a*b*c*d*m*m;
	if(n<0){
		printf("Invalid input");
                  return 0;
	}
	double t=sqrt(n);
	return t;
}
main()
{
       double a,b,c,d;
       double S,s;
       double q,y,w;
       scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&q);
       s=(a+b+c+d)/2;
       w=(double)q*PI/180;
       y=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((double)(w/2))*cos((double)(w/2));
       if(y<0)
       printf("Invalid input\n");
       else
       {S = sqrt(y); 
       printf("%.4f\n",S);}
}
int main()
{
	double a,b,c,d,aq,s,re;
	cin>>a>>b>>c>>d>>aq;
	if(a+b+c>d&&a+c+d>b&&a+b+d>c&&b+c+d>a)
	{
		s=(a+b+c+d)/2;
		re=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(aq*Pi/360)*cos(aq*Pi/360)); 
		printf("%.4lf",re);
	}
	else cout<<"Invalid input";
}
double getarea(double a,double B,double c,double d,double e);
int main()
{
    double a,B,c,d,e,f;
	scanf("%lf",&a);
	scanf("%lf",&B);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	f=getarea(a,B,c,d,e);
    if(f==-1)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4f",f);
	}
	return 0;
}




double getarea(double a,double B,double c,double d,double e)
{
	double area,s;
	s=(a+B+c+d)/2; 

	if((s-a)*(s-B)*(s-c)*(s-d) - a*B*c*d*cos(e/360*3.1415926)*cos(e/360*3.1415926)>=0)
	    area= sqrt((s-a)*(s-B)*(s-c)*(s-d) -a*B*c*d*cos(e/360*3.1415926)*cos(e/360*3.1415926)); 
    else
        area=-1;
	return area;
}