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,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(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;
}


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);
  }
}


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");
}


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);
}


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;
}


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;
}


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;
}


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(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 ;
}


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();
}


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));
}
}


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);}
}


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;
}


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()
{

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()
{
	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 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;
}


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,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");
}


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,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;
}


const double PI=3.1415926;
int main()
{
	int i;
	double a[6];
	for(i=0;i<5;i++)
	{
		scanf("%lf",&a[i]);
	}
	double area;
	double s;
	double temp;
	double angle=a[4]/180*PI;
	s=(a[0]+a[1]+a[2]+a[3])/2;
	temp=(s-a[0])*(s-a[1])*(s-a[2])*(s-a[3])-a[0]*a[1]*a[2]*a[3]*cos(angle/2)*cos(angle/2);
	if(temp<0)printf("Invalid input");
	else printf("%.4f",sqrt(temp));

	return 0;
}


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


int main()
{
	double a,b,c,d,apha,m=0,S=0,del=0;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&apha);
	apha=apha*PI/360;m=(a+b+c+d)*0.5;
	del=(m-a)*(m-b)*(m-c)*(m-d)-a*b*c*d*cos(apha);
	if (del>=0)
	{S=sqrt((m-a)*(m-b)*(m-c)*(m-d)-a*b*c*d*cos(apha)*cos(apha));printf("%.4lf",S);}
	else printf("Invalid input");
	return 0;
}


int main()
{
	double a,b,c,d,ag,s,sq;

	scanf("%lf\n",&a);
	scanf("%lf\n",&b);
	scanf("%lf\n",&c);
	scanf("%lf\n",&d);
	scanf("%lf\n",&ag);

	s=(a+b+c+d)/2;
	ag=ag/360 * PI;
	sq=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(ag),2);

	if(sq<0)
	{
		printf("Invalid input");
		return 0;
	}

	printf("%.4lf",sqrt(sq));

	return 0;
}


/*double q(double a,b,c,d,w)
{
   w=3.1415926*w/180/2;
   doubles=0.5*(a+b+c+d);
  s=(s-a)* (s-b)* (s-c)* (s-d)-a*b*c*d*cos(w)*cos(w);
  return s
}*/
int main()
{
  double a,b,c,d,w,s;
  //double q(double a,b,c,d,w,s);
  scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&w);
  w=3.1415926*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);
  //s=q (a,b,c,d);
  if(s<0)
  {printf( "Invalid input");}
  else
  {printf( "%0.4lf",sqrt(s));}
  return 0;
getchar();
getchar();
getchar();
}


double  mianji(double x,double y,double z,double m,double n)
{
	double  pan,s;
	s=(x+y+z+m)/2;
	pan=sqrt((s-x)*(s-y)*(s-z)*(s-m)- x*y*z*m*cos(n*pai/180)*cos(n*pai/180));
	if (pan>=0)
		return pan;
	else {
		return -1;
	}
}
int main()
{
	double a,b,c,d,q,mian;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&q);
	mian=mianji(a,b,c,d,q/2);
	if (mian==-1){
	printf("Invalid input\n");
	}
	else {
		printf("%.4lf\n",mian);}
	return 0;
}


double f(double A);
void main()
{
	double a,b,c,d,s,A,S;
	scanf("%lf""%lf""%lf""%lf""%lf",&a,&b,&c,&d,&A);
	s=(a+b+c+d)/2;
	S=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*f(A/2)*f(A/2);

	if(S<0)
		printf("Invalid input");
	else
		printf("%.4lf",sqrt(S));
}

double f(double A)
{
	double z,PI;
	PI = 3.1415926;
	z=(double)cos(A/180*PI);
	return(z);
}


int main()
{
    double a,b,c,d,w;
	double S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&w);
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(w*PI/360)*cos(w*PI/360));
	if (S>=0)
	printf("%.4lf",S);
	else
		printf("Invalid input");
	return 0;
}


int main()
{

    float a,b,c,d;
	float angle,dangle;
	float p,q,outcome;
	float PI=3.1415926;
	scanf("%f\n%f\n%f\n%f\n%f",&a,&b,&c,&d,&angle);
	float s;
	s=(a+b+c+d)/2;
	p=(s-a)*(s-b)*(s-c)*(s-d);
	dangle=(angle/360)*PI;
	q=a*b*c*d*(cos(dangle)*cos(dangle));
	if(p-q>0)
		{outcome=sqrt(p-q);
	printf("%.4f",outcome);}
	else
		printf("Invalid input");
	return 0;
}


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


double max(double a,double b,double c,double d,double f,double s)
{
	double S;
   S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f)*cos(f));
	return(S);
}
void main()
{
	double a,b,c,d,e,f,s,S,g;
	double max(double a,double b,double c,double d,double f,double s);
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
    s = (a+b+c+d)/2;
    f=e/360*3.1415926;
    g=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f)*cos(f);
	if(g>=0)
	{
		S=max(a,b,c,d,f,s);
		printf("%.4lf",S);
	}
	else printf("Invalid input");
}


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


double s(double a,double b,double c,double d)

{

        double s;

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

        return (s);

}

double cos2(double r)

{

        double k,i;

        k=cos(r/2*3.1415926/180);

        i=k*k;

        return (i);

}

void main()

{

        double S,temp;

        double a, b, c, d, r;

        scanf("%lf",&a);

        scanf("%lf",&b);

        scanf("%lf",&c);

        scanf("%lf",&d);

        scanf("%lf",&r);

        temp=(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*cos2(r);

        if (temp<0)

               printf("Invalid input\n");

        else

        {

               S=sqrt(temp);

               printf("%.4lf",S);

        }

}


int main()
{
	double a,b,c,d,h,S,s,sum;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&h);
	s=(a+b+c+d)/2;
	sum=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(h*PI/360),2);
	S=sqrt(sum);
	if (h>360||h<=0)
	{
		printf("Error!");
	}
	else
	{
		if (sum<0)
		{
			printf("%s\n","Invalid input");
		}
		else
			printf("%.4lf\n",S);
	}

	return 0;
}


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


int main()
{
	double a,b,c,d,e,f,m,s,n;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
		s=(a+b+c+d)/2;
	f=e*PI/360;
m=sqrt(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f)));
n=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f);
if(n>=0)
	printf("%.4lf\n",m);
	else
printf("Invalid input\n");

	return 0;
}


int main(int argc, char* argv[])
{
	double pai=3.1415926;
	double a,b,c,d,A,s=0,h;
	double S;
	scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
	scanf("%lf",&A);
    h=A/180*pai;
    s =(a+b+c+d)*0.5;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(h/2)*cos(h/2)>=0)
	{
		S= sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(h/2)*cos(h/2));
		printf("%.4lf",S);
	}
	else
		printf("Invalid input");
	return 0;
}


int main()
{
    double s,a,b,c,d,angle,S,x;
    scanf("%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");
     }
     else
     {
        printf("%.4lf",S);
      }
    return 0;
}


double mianji(double a,double b,double c,double d,double jiaohe);
int main()
{
double a1,b1,c1,d1,s1,jiaohe1,jiao1,S;
scanf("%lf",&a1);
scanf("%lf",&b1);
scanf("%lf",&c1);
scanf("%lf",&d1);
scanf("%lf",&jiaohe1);
s1=(a1+b1+c1+d1)/2;
jiao1=jiaohe1/360*PI;
if((s1-a1)*(s1-b1)*(s1-c1)*(s1-d1)-a1*b1*c1*d1*cos(jiao1)*cos(jiao1)>=0){
	S=mianji(a1,b1,c1,d1,jiaohe1);
printf("%.4lf",S);
}else{
printf("Invalid input");
}
return 0;
}
double mianji(double a,double b,double c,double d,double jiaohe)
{
	double s,jiao,y;
	s=(a+b+c+d)/2;
	jiao=jiaohe/360*PI;
	y=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(jiao)*cos(jiao);
	if(y>=0) return sqrt(y);
}


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

float function(float a,float b,float c, float d, float angle)
{
float s,genhao;
double fanhuizhi,ANGLE;
ANGLE=angle/360*3.1415926;
s=(a+b+c+d)/2;
genhao=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(ANGLE)*cos(ANGLE);
if(genhao<0){fanhuizhi=-1;}
else{
fanhuizhi=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(ANGLE)*cos(ANGLE));
}
return fanhuizhi;
}


int main(int argc, char *argv[])
{ double mianji(double a,double b,double c,double d,double j);
  double x,y,z,t,w,s;
 scanf("%lf%lf%lf%lf%lf",&x,&y,&z,&t,&w);
 s=mianji(x,y,z,t,w);
 if(s!=-1)
 printf("%.4lf\n",s);
 else
 printf("Invalid input\n") ;

  return 0;
}
 double mianji(double a,double b,double c,double d,double j)
 {double S,s,s2;
 double hudu;
  hudu=j/360*3.1415926;
  S=(a+b+c+d)/2;
  s2=(S-a)*(S-b)*(S-c)*(S-d)-a*b*c*d*cos(hudu)*cos(hudu);
  if(s2<0)
  s=-1;
  else
  s=sqrt(s2);
  return (s);
       }


int main()
{
	double a,b,c,d;
	double angle;
	cin>>a>>b>>c>>d;
	cin>>angle;
	double s;
	double temp1,temp2;
	double pi=3.1415926;
	s=(a+b+c+d)/2;
	temp1=(s-a)*(s-b)*(s-c)*(s-d);
	temp2=angle/360*pi;
	temp2=cos(temp2);
	temp2=temp2*temp2;
	temp2=a*b*c*d*temp2;
	temp1=temp1-temp2;
	if(temp1<0)
		cout<<"Invalid input"<<endl;
	else
	{
		temp1=sqrt(temp1);
		printf("%.4f\n",temp1);
	}
	return 0;
}


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


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


int main()
{
    float a,b,c,d,aef,bt;
    float S,s,m,x;
    scanf("%f\n",&a);
    scanf("%f\n",&b);
    scanf("%f\n",&c);
    scanf("%f\n",&d);
    scanf("%f\n",&aef);
    s=(a+b+c+d)/2;
    bt=aef/180*3.1415926/2;
    m= (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(bt)*cos(bt);
    if(m>0)
    {
        S=sqrt(m);
        printf("%.4f",S);
    }
    else printf("Invalid input");
    scanf("%f",&x);
    return 0;
}


int main()
{
	float a,b,c,d,e;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
	float s=(a+b+c+d)/2;
	float jiao=e*PI/180;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(jiao/2)*cos(jiao/2)<0)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4f",sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(jiao/2)*cos(jiao/2)));
	}

	return 0;
}


void main()
{
	float a,b,c,d,e,ans;
	float sum,multi,anmul;
	float sq(float p,float q);
	float angle,angle2;
	scanf("%f",&a);
	scanf("%f",&b);
	scanf("%f",&c);
	scanf("%f",&d);
	scanf("%f",&angle2);
	sum=(a+b+c+d)/2;
	angle=angle2/2;
    multi=(sum-a)*(sum-b)*(sum-c)*(sum-d);
	e=cos(angle*3.1415926/180)*cos(angle*3.1415926/180);
	anmul=a*b*c*d*e;
	ans=sq(multi,anmul);
	if((multi-anmul)<0) printf("Invalid input");
	else printf("%.4f",ans);
}
float sq(float p,float q)
{
	float z;
	z=sqrt((p-q));
	return z;
}


void main()
{
	double a,b,c,d,m;
	double s,S,n,res;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&m);
	s=(a+b+c+d)/2;
	n=m/2;
	res=cos(n/180*PI);//

	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*res*res)<0)//
		printf("Invalid input");
	else
	{
	    S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*res*res);
		printf("%.4lf",S);
	}
}


main()
{
      double a,b,c,d,s,x,y;
      scanf("%lf",&a);
      scanf("%lf",&b);
      scanf("%lf",&c);
      scanf("%lf",&d);
      scanf("%lf",&x);
      x=x/2/180*pi;
      s=(a+b+c+d)/2;
      y=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(x)*cos(x);
      if(y<0)
      printf("Invalid input") ;
      else
      printf("%.4lf",sqrt(y));
      getchar();
      getchar();
      getchar();

}


int main()
{
float a,b,c,d,f,s;
double e,S;

scanf("%f",&a);printf("\n");
scanf("%f",&b);printf("\n");
scanf("%f",&c);printf("\n");
scanf("%f",&d);printf("\n");
scanf("%f",&f);printf("\n");
e=f*PI/180;
s=(a+b+c+d)/2;
S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/2)*cos(e/2));

if ((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e/2)*cos(e/2)<0)
printf("Invalid input\n");
else
printf("%.4lf\n",S);
return 0;
}


int main()
{
	double area(double w,double x,double y,double z,double v);
	double a,b,c,d,t,s,p,r;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
scanf("%lf",&t);
s=0.5*(a+b+c+d);
    r=PI*t/360;
	if (((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(r)*cos(r))<0)
		printf("Invalid input");
	else
	{
		p=area(a,b,c,d,t);
		printf("%.4lf",p);
	}
}
   double area(double w,double x,double y,double z,double v)
	{
        double s1,S;
		s1=0.5*(w+x+y+z);
		v=PI*v/360;
        S = sqrt((s1-w)*(s1-x)*(s1-y)*(s1-z) - w*x*y*z*cos(v)*cos(v));
         return(S);
	}


main()
{
    int i,j,k;
    double a,b,c,d;
    double xs;
    double ds;
    double t;
    double p;
    double PI = 3.1415926;
    scanf("%lf",&a);
    scanf("%lf",&b);
    scanf("%lf",&c);
    scanf("%lf",&d);
    scanf("%lf",&t);
    xs=(a+b+c+d)/2;
    p=((t/2)/180)*PI;
    if((xs-a)*(xs-b)*(xs-c)*(xs-d) - a*b*c*d*cos(p)*cos(p)>=0)
    {
        ds= sqrt((xs-a)*(xs-b)*(xs-c)*(xs-d) - a*b*c*d*cos(p)*cos(p));
        printf("%.4lf\n",ds);
    }
    else
    printf("Invalid input\n");
}


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


double f(double a,double b,double c,double d,double angle){
 double s,S;
s = 0.5*(a+b+c+d);
S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle/360*P)*cos(angle/360*P));
return S;}
int main()
{
 double a,b,c,d,angle,s,m;
scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&angle);
s = 0.5*(a+b+c+d);
m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle/360*P)*cos(angle/360*P);
if(m<0)
printf("Invalid input");
else
printf("%.4lf",f(a,b,c,d,angle));
return 0;
}


int main()
{
    float a,b,c,d;
	float e;
	double f,s,S;

	scanf("%f%f%f%f",&a,&b,&c,&d);
	s=(double)1/2*(a+b+c+d);
	scanf("%f",&e);
	f=(double)e/360*pi;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f)<0)
	{
		printf("Invalid input\n");
	}
	else
	{
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f));
	printf("%.4lf\n",S);
	}
	return 0;
}


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


int main ()
{
	double a,b,c,d,q;
	double y(double a,double b,double c,double d,double q);
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&q);
	if(y(a,b,c,d,q)==-1)
		printf("Invalid input\n");
	else
		printf("%.4lf\n",y(a,b,c,d,q));
	return 0;
}

double y(double a,double b,double c,double d,double q)
{
	double s,f,test;
	s=(a+b+c+d)/2;
	f=(q/360)*PI;
	test=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f);
	if (test<0)
		return -1;
	else
		return (sqrt(test));
}


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


/*
 * sibianxingmianji.cpp
 *
 *  Created on: 2010-11-17
 *      Author: Administrator
 */
double S(double a,double b,double c,double d,double e){
	double s=(a+b+c+d)/2;
	double square=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(e*3.1415926/(2*180)),2.0);
    return square;
}
int main(){
	double a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	double y=S(a,b,c,d,e);
	if(y<0)   cout<<"Invalid input"<<endl;
	else      cout<<fixed<<setprecision(4)<<sqrt(y)<<endl;
	return 0;
}


double f(double a,double b,double c,double d,double ang)
{
	double p,q,y;
	ang=ang/2.0/180.0*3.1415926;
	p=(a+b+c+d)/2.0;
	q=(p-a)*(p-b)*(p-c)*(p-d)-a*b*c*d*cos(ang)*cos(ang);
	y=sqrt(q);
	if(q<0)
		printf("Invalid input");
	else
		printf("%.4lf",y);
}
void main()
{
	double a,b,c,d,ang;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&ang);
	f(a,b,c,d,ang);
}


int main()
{
	double a,b,c,d,alf2,mj;
	double Squ(double a1,double b1,double c1,double d1,double alf21);
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&alf2);
	mj=Squ(a,b,c,d,alf2);
	if(mj<0)
		printf("Invalid input\n");
	else
		printf("%.4lf\n",mj);
	return 0;
}
double Squ(double a1,double b1,double c1,double d1,double alf21)
{
	double s,S,alf;
	s=(a1+b1+c1+d1)/2;
	alf=alf21/360*3.1415926;

	if(((s-a1)*(s-b1)*(s-c1)*(s-d1) - a1*b1*c1*d1*pow(cos(alf),2))>=0)
	{
		S=sqrt((s-a1)*(s-b1)*(s-c1)*(s-d1) - a1*b1*c1*d1*pow(cos(alf),2));

	}
	else
		S=-1;
   return S;
}


int main()
{
	double a,b,c,d,x,m,S,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	m=PI/180*x/2;
    s = 1*(a+b+c+d)/2;
	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\n",S);
	else
	printf("Invalid input\n",S);
	return 0;
}


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


main()
{
      double a,b,c,d,e,s,ans,x;
      scanf("%lf",&a);
      scanf("%lf",&b);
      scanf("%lf",&c);
      scanf("%lf",&d);
      scanf("%lf",&e);

      s=(a+b+c+d)/2;
      x=cos(e/2/180*3.1415926);
      ans=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*x*x;
      if (ans<0) printf("Invalid input");
      else printf("%.4lf\n",sqrt(ans));

}


double area (double, double, double, double, double);
int main ()
{
	double a, b, c, d, an, s;
	scanf ("%lf%lf%lf%lf%lf", &a, &b, &c, &d, &an);
	s =area(a, b, c, d, an);
	if (s<0)
		printf ("Invalid input");
	else printf ("%.4f", s);
	return 0;
}

double area (double q, double w, double e, double r, double ty)
{
	double ang, ss, k, t;
	ang = (ty/2)/180*PI;
	t = (q+w+e+r)/2;
	ss = (t-q)*(t-w)*(t-e)*(t-r) - q*w*e*r*cos(ang)*cos(ang);
	/*printf ("%f ", q);*/
	if (ss<0)
		return -1;
	else
	{
		k = sqrt(ss);
		return k;
	}
}


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


double PI=3.1415926;
double f(double a,double b,double c,double d,double alpha)
{
 double s=(a+b+c+d)/2;
double tmp=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(alpha*PI/360),2));
if (tmp<0)
return -1;
else
return sqrt(tmp);
}
int main()
{
 double a,b,c,d,alpha;
 scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&alpha);
if (f(a,b,c,d,alpha)<0)
printf("Invalid input");
else
printf("%.4lf",f(a,b,c,d,alpha));
}


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


double s(double a,double b,double c,double d,double du);
int main()
{
	double a,b,c,d,du,s2;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&du);
	s2=s(a,b,c,d,du);
	if(s2==0)
		printf("Invalid input");
	else
		printf("%.4f",s2);
	return 0;
}
double s(double a,double b,double c,double d,double du)
{
	double ps,ss,rad;
	rad=du*PI/360;
	ss=(a+b+c+d)/2;
	if(((ss-a)*(ss-b)*(ss-c)*(ss-d)-a*b*c*d*cos(rad)*cos(rad))<0)
		return 0;
	else
	{
		ps=sqrt((ss-a)*(ss-b)*(ss-c)*(ss-d)-a*b*c*d*cos(rad)*cos(rad));
		return ps;
	}

}


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

double squ(double a,double b,double c,double d,double e)
{
	double s,m,n,f;
	s=(a+b+c+d)/2;
	f=e*3.1415926/360;
	n=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f);
	m=sqrt(n);
	return (m);
}


int main()
{
	double a,b,c,d,e,s,S,t,f;
    #define PI 3.1415926
	e=f*PI/180;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&f);
	s=(a+b+c+d)/2;
	e=f*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 if(t>=0){
		S=sqrt(t);
		printf("%.4lf",S);
	}
	return 0;
}


int main ()
{
	double a,b,c,d,x,s,y,mj;
	double const pi=3.1415926;
	cin>>a>>b>>c>>d>>x;
	s=(a+b+c+d)/2;
	 y=x/360.0*pi;
	 if ((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y)<0)
		 cout<<"Invalid input"<<endl;
	 else
		 {
		 mj=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y));
		cout<<fixed<<setprecision(4)<<mj<<endl;
		 }
	return 0;
}


double mj(float a,float b,float c,float d,float z)
{
  double y,s;
  s=(a+b+c+d)/2;
	  y=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(z)*cos(z));
  return(y);
}
double main()
{
	double a,b,c,d,x,z,PI=3.1415926,S,s,m;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	s=(a+b+c+d)/2;
	z=((x/2)*PI)/180;
	m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(z)*cos(z);
	if(m<0)
		printf("Invalid input");
	else
	{
		S=mj(a,b,c,d,z);
	printf("%.4lf",S);
	}
}


int main(){
double   a,b,c,d;
double  al;
double s,s0;
scanf("%lf",&a);
scanf("%lf",&b);
scanf("%lf",&c);
scanf("%lf",&d);
s= (a+b+c+d)/2;
scanf("%lf",&al);
al=al/2;
al=3.1415926/180*al;

if (((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(al)*cos(al))<0) {
                            printf( "Invalid input");
                            }
                            else {
                                 s0= sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(al)*cos(al));
                                 printf("%.4lf",s0);
                                 }

return 0;
}


int main(int argc, char* argv[])
{

	double p, a, b, c, d, s, v, x;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&x);
	x=x*3.1415926/360;
	s= (a+b+c+d)/2;
	p=cos(x);
    v= sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*p*p);
	if(v>=0)
    printf("%6.4f\n", v);
    else
		printf("Invalid input");
	return 0;

}


int main ()
{
  double a,b,c,d,s,e,m,n,f;
  double p=3.1415926;
  scanf("%lf",&a);
  scanf("%lf",&b);
  scanf("%lf",&c);
  scanf("%lf",&d);
  scanf("%lf",&e);
  e=e*p/360;
  s=(a+b+c+d)/2;
  m=(s-a)*(s-b)*(s-c)*(s-d);
  f=m-a*b*c*d*cos(e)*cos(e);

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


double square(double a,double b,double c,double d,double angel)
{
	double ans,s;
	s=(a+b+c+d)/2;
	ans=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angel)*cos(angel));
	return(ans);
}
void main()
{
	double square(double,double,double,double,double);
	double a,b,c,d,angel,ans,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&angel);
	s=(a+b+c+d)/2;
	angel=angel*PI/360;
	if((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angel)*cos(angel)<0)
		printf("Invalid input");
	else
	{
		ans=square(a,b,c,d,angel);
	    printf("%.4f",ans);
	}
}


void main()
{
	double square(double x,double y,double z,double w,double m);
	double S,a,b,c,d,M;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&M);
	S=square(a,b,c,d,M);
	if(S>0){
	    printf("%.4lf",sqrt(S));
	}else{
	    printf("Invalid input");
	}
}

double square(double x,double y,double z,double w,double m)
{
	double k;
	double SQUARE;
	k=(x+y+z+w)/2;
	double p,q;
	p=(k-x)*(k-y)*(k-z)*(k-w);
         double hudu;
	hudu=PI*m/180;
	q=x*y*z*w*cos(hudu/2)*cos(hudu/2);
	SQUARE=p-q;
	return SQUARE;
}


double mianji(double a,double b,double c,double d,double e){
	double s,m,n,p;
	s=1/2.0*(a+b+c+d);
	p=e/180*pai;
	m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*pow(cos(p/2.0),2);
	if(m<0)
		printf("Invalid input\n");
	else{
               n=sqrt(m);
	      return n;
         }
}
int main(){
	double a,b,c,d,e;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	double n;
	n=mianji(a,b,c,d,e);
	printf("%.4lf",n);
	return 0;
}


void main()
{

	void S(double a,double b,double c,double d,double jiao);
	double a,b,c,d,jiao;
	scanf("%lf",&a);
    scanf("%lf",&b);
    scanf("%lf",&c);
    scanf("%lf",&d);
    scanf("%lf",&jiao);
    S(a,b,c,d,jiao);

}

   void S(double a,double b,double c,double d,double jiao)
   {    double PI,s,m;

        s = (a+b+c+d)/2;
        PI = 3.1415926;
		jiao=PI*jiao/360;
        m=cos(jiao);
		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",s);
		}
   }


double  area(double  a,double  b,double   c,double  d,double  j)
{      double  s,t,S,pi=3.1415926;
       s=(double)(a+b+c+d)/2;
       t=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos((double)(j*pi)/360)*cos((double)(j*pi)/360);
       if(t<0)
       return(-1);
else
       S = (double)sqrt(t);

       return(S);
}
    int  main()
  {
         double   a,b,c,d,j,S;

         scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&j);
         S=area(a,b,c,d,j);
         if(S==-1)
         printf("Invalid input");
     else
         printf("%.4lf",S);
    }


int main(int argc, char* argv[])
{    double a,b,c,d;
     double m,n;
	 double e,s;

     scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&m);
	 e=(a+b+c+d)/2;
	 n=3.1415926*m/360;
	 if((e-a)*(e-b)*(e-c)*(e-d)-a*b*c*d*pow(cos(n),2)<0)
	 {
		 printf("Invalid input");
	 }
	 else{
	 s=sqrt((e-a)*(e-b)*(e-c)*(e-d)-a*b*c*d*pow(cos(n),2));

	 printf("%.4f",s);
	 }

	return 0;
}


double area(double a,double b,double c,double d,double e)
{
	double s,q,S;
	s=(a+b+c+d)/(2.0);
	q=cos(e*(3.1415926)/(180.0)/(2.0));
        return sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*q*q);
}
int main()
{
	double n1,n2,n3,n4,m;
	scanf("%lf%lf%lf%lf%lf",&n1,&n2,&n3,&n4,&m);
    if(area(n1,n2,n3,n4,m)>=0)
	{
		printf("%.4lf",area(n1,n2,n3,n4,m));
	}
	else printf("Invalid input");
	return 0;
}


int main ()
{
    float a,b,c,d,k,s,x;
    int e;
    scanf("%f",&a);
    scanf("%f",&b);
    scanf("%f",&c);
    scanf("%f",&d);
    scanf("%d",&e);
    k=(float)e*pi/180;
    k=k/2;
    s=a+b+c+d;
    s=s/2;
    x=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k)*cos(k);
    if (x<0) printf("Invalid input\n");
    else printf("%.4f\n",sqrt(x));
    return 0;
}


int main(int argc, char* argv[])
{
float a,b,c,d;
double e,f,g,h,i,s;
scanf("%f%f%f%f%lf",&a,&b,&c,&d,&e);
s=(a+b+c+d)/2;
h=e/360*pi;
f=cos(h);
i=f*f;
if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*i<0)
printf("Invalid input\n");
else
{
g=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*i);
printf("%.4f\n",g);
}
return 0;
}


float find(float a,float b,float c,float d,float p)
{
    float s=(a+b+c+d)/2,k,temp,q;
    q=p*asin(1)/180;
    temp=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(q)*cos(q);
    if(temp>=0)
    {
        k=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(q)*cos(q));
    }
    else
    {
        k=0;
    }
    return k;
}
int main()
{
    float a,b,c,d,p,k;
    scanf("%f",&a);
    scanf("%f",&b);
    scanf("%f",&c);
    scanf("%f",&d);
    scanf("%f",&p);
    k=find(a,b,c,d,p);
    if(k==0)
    {
        printf("Invalid input");
    }
    else
    {
        printf("%.4f",k);
    }
    return 0;
}


double mj(float a,float b,float c,float d,float e)
{

	double t,s,k;
    k=(double)3.1415926*e/360;
	s=(a+b+c+d)/2;
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k)*cos(k))<0)
	{
		t=-1;
	}
	else
    {
	t=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(k)*cos(k));
	}
	return(t);
}
void main()
{

	double f;
    float a,b,c,d,e;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
	f=mj(a,b,c,d,e);
	if(f<0)
	{printf("Invalid input");}
	else
	{printf("%.4f",f);}
}


int main(int argc, char* argv[])
{
	double a,b,c,d,angle,s,area;
	double m;

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

	s = (a+b+c+d)/2;
	angle=angle/720*2*PI;
	m=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(angle)*cos(angle);

	if(m<0)
		printf("Invalid input");
	else
	{
		area=sqrt(m);
		printf("%.4lf\n",area);
	}

	return 0;
}


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


double S(double a, double b, double c, double d, double e)
{
    double s=(a+b+c+d)/2;
    double p=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*pow(cos(e),2);

    if(p<0)
        return -1;
    else
        return sqrt(p);
}

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

    e=j/2*PI/180;

    if(S(a, b, c, d, e)==-1)
        printf("Invalid input\n");
    else
        printf("%.4f\n", S(a, b, c, d, e));

    return 0;
}


int main()
{
	double a,b,c,d;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	double hh;
	scanf("%lf",&hh);
	double s;
	s = (a+b+c+d)/2;
	hh=hh/360*3.141592;
	hh=cos(hh);
	double S;
	double SS=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*hh*hh;
	if (SS<0)
	{
		printf("Invalid input");
		return 0;
	}
	S = sqrt(SS);
	printf ("%0.4lf",S);
	return 0;

}


int main()
{
	double a,b,c,d,e,z,s,S,L;
	double cos(double x);
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	z=e*PI/360;
	s=(a+b+c+d)/2;
	L=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(z)*cos(z);
	if(L<0)
	{
		printf("Invalid input\n");
    }
	else
	{
    S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(z)*cos(z));
	printf("%.4f\n",S);
	}
}


double S(double a, double b, double c, double d, double hudu)
{
	double s=(a+b+c+d)/2;
	double S2=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(hudu)*cos(hudu);
	if(S2<0){
		return 1;
	}else{
		return sqrt(S2);
	}
}
int main()
{
	double a,b,c,d,e;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	double hudu=e/360*PI;
	if(S(a,b,c,d,hudu)==1){
		printf("Invalid input");
	}else{
		printf("%.4lf",S(a,b,c,d,hudu));
	}
	return 0;
}


int main()
{
	double a,b,c,d,e,f,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
    s=0.5*(a+b+c+d);
	e=e/2*3.1415926/180;
	f=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e)*cos(e);
	if (f<0)
	{printf("Invalid input");
	 return 0;
	}
	printf("%.4lf",sqrt(f));
	return 0;
}


double areo(double a,double b,double c,double d,double w)
      {double 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)
      return 0;
      else
      return sqrt(s);
      }
      main()
{
      double a,b,c,d,s,w,S;

      scanf("%lf",&a);
      scanf("%lf",&b);
      scanf("%lf",&c);
      scanf("%lf",&d);
      scanf("%lf",&w);
      w=3.1415926*w/180/2;
      s=0.5*(a+b+c+d);

      if(areo(a,b,c,d,w)==0)
      printf("Invalid input");
     else
      printf("%.4lf",areo(a,b,c,d,w));

      }


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


double calarea(double a,double b,double c,double d,double alpha2);

int main() {
	double A,B,C,D,ALPHA2;
	double area;
	scanf("%lf%lf%lf%lf%lf",&A,&B,&C,&D,&ALPHA2);
	area=calarea(A,B,C,D,ALPHA2);
	if(area!=0){
		printf("%.4lf\n",area);
	}
	return 0;
}

double calarea(double a,double b,double c,double d,double alpha2){
	double s,S,alpha;
	s=(double)(a+b+c+d)/2;
	alpha=((alpha2*PI)/(180*2));
	S=((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(alpha)*cos(alpha));
	if(S>0){
		return sqrt(S);
	}
	else {
		printf("Invalid input\n");
		return 0;
	}
}


int main()
{
	double a,b,c,d,tah,s,tot,tahc;
	int ta;
	scanf("%lf%lf%lf%lf%d",&a,&b,&c,&d,&ta);
	tah=((double)ta)/360*PI;
	s = 0.5*(a+b+c+d);
	tahc=cos(tah);
	tot = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*tahc*tahc;
	if (tot>=0)
		printf("%.4lf",sqrt(tot));
	else printf("Invalid input");
	return 0;
}


double S(double x,double y,double z,double k,double l);
int main()
{
	double a,b,c,d,e,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((PI*e)/360)*cos((PI*e)/360))>0)
	{
       printf("%.4lf",S(a,b,c,d,e));
	}else
	{
		printf("Invalid input");
	}
	return 0;

}
double S(double x,double y,double z,double k,double l)
{
	double c,s;
	s = (x+y+z+k)/2;
	c = sqrt((s-x)*(s-y)*(s-z)*(s-k) - x*y*z*k*cos((PI*l)/360)*cos((PI*l)/360));
	return(c);

}


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


double cos2(float alpha){
 return cos(alpha/360*PI)*cos(alpha/360*PI);
}

int main(){
double a,b,c,d,alpha,s,sum;
scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&alpha);
s = (a+b+c+d)/2;
sum=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos2(alpha);
if(sum<0)
 printf("Invalid input\n");
else
 printf("%.4lf\n",sqrt(sum));
}


//?????????????????
int main()
{
         double mianji(double a,double b,double c,double d,double jiao);
	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;
}
//??????????????????
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 s,S,a,b,c,d,e,f,g;
	scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2.0;
	f=PI*e/360.0;
	g=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f)*cos(f);
	if(g>0||g==0){
	    S=sqrt(g);
	    printf("%.4lf",S);
	}
	if(g<0)
        printf("Invalid input");
	return 0;
}


int main (int argc,char*argv[])
{
	double a,b,c,d,e,s,pi, f,t,N;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
    pi=3.1415926;
	f=e*pi/360;
	N=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(f)*cos(f);
    t = sqrt(N);
	if(N<0)
		printf("Invalid input\n");

	else
	   printf("%.4lf",t);

	return 0;
}


int main(){
	double A,B,C,D,E;
	double f(double a,double b,double c,double d,double e);
	scanf("%lf%lf%lf%lf%lf",&A,&B,&C,&D,&E);
	double SS;
	SS=f(A,B,C,D,E);
	if(SS!=0){
		printf("%.4lf",SS);
	}
	return 0;
}
double f(double a,double b,double c,double d,double e){
	double S,s;
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*p/360)*cos(e*p/360)<0){
		printf("Invalid input");
		return 0;
	}
	else{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e*p/360)*cos(e*p/360));
		return S;
	}
}


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


void main()
{
double a, b, c, d, e, s, S;
scanf("%lf", &a);
scanf("%lf", &b);
scanf("%lf", &c);
scanf("%lf", &d);
scanf("%lf", &e);
s=(a+b+c+d)/2.0;
e=e/2.0;
e=e*PI/180;
S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e)*cos(e));

if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e)*cos(e)>0)
printf("%.4lf\n", S);

else
printf("Invalid input\n");

}


int main()
{
	double s,S;
	double a,b,c,d,A,aerfa;
	double kaifang(double a,double b,double c,double d,double aerfa);
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&A);
	aerfa=A/180*PI/2;
	s=(a+b+c+d)/2;
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(aerfa)*cos(aerfa))<0)
		printf("Invalid input");
	else
	{
		S=kaifang(a,b,c,d,aerfa);
		printf("%.4lf\n",S);
	}
	return 0;
}

double kaifang(double a,double b,double c,double d,double aerfa)
{
	double s,S;
	s=(a+b+c+d)/2;
	while(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(aerfa)*cos(aerfa))>=0)
	{
		S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(aerfa)*cos(aerfa));
		break;
	}
	return S;
}


void main()
{
	double f(double a,double b,double c,double d,double x);
	double a,b,c,d,x,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
    f(a,b,c,d,x);
}
   double f(double a,double b,double c,double d,double x)
   {
	   double y,s,S,PI=3.1415926;
       y=x/360*PI;
       s=(a+b+c+d)/2.0;
       S=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(y)*cos(y);
	   if(S<0)
		   printf("Invalid input");
	  else

		printf("%.4lf",sqrt(S));

   }


int main()
{
	float a,b,c,d,s,S,m,n;
	float A,e;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&A);
	s=(float)(a+b+c+d)/2;
	n=(s-a)*(s-b)*(s-c)*(s-d);
	e=(float)A*3.1415926/360;
	m=a*b*c*d*cos(e)*cos(e);
	if(n<0)
		printf("Invalid input\n");
	else
	{
	S=sqrt(n-m);

	printf("%.4f\n",S);
	}
	return 0;
}


double main()
{
	double a,b,c,d,w,u,s,m,q;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
    scanf("%lf",&d);
    scanf("%lf",&w);
	s=(a+b+c+d)/2;
	q=w/2/180*pi;
     u =(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q);
	 if(u>0)
	 {
	m=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(q)*cos(q));
	printf("%.4f",m);}
	 else
		 printf("Invalid input");
	return 0;
}


void s(float a,float b,float c,float d,float e)
{
	float f,g,h;
	f=(a+b+c+d)/2;
	g=(e/360)*3.1415926;
	if(((f-a)*(f-b)*(f-c)*(f-d)-a*b*c*d*cos(g)*cos(g))>0)
	{
		h=sqrt((f-a)*(f-b)*(f-c)*(f-d)-a*b*c*d*cos(g)*cos(g));
		printf("%.4f\n",h);
	}
	if(((f-a)*(f-b)*(f-c)*(f-d)-a*b*c*d*cos(g)*cos(g))<=0)
	{
		printf("Invalid input\n");
	}
}
void main()
{
	float S,a,b,c,d,e;
	scanf("%f\n%f\n%f\n%f\n%f",&a,&b,&c,&d,&e);
	s(a,b,c,d,e);
}


int main()
{
	double a, b, c, d, angle;
	double output;

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

	float square(double a1, double b1, double c1, double d1, double angle1);

	output = square(a,b,c,d,angle);
	if (output == -1) {
		printf("Invalid input");
	}
	else {
		printf("%.4lf",output);
	}

	return 0;
}

float square(double a1, double b1, double c1, double d1, double angle1){
	double s;
	double S;
	double cs;
	double sqr;
	s = (a1 + b1 + c1 + d1) / 2;
	cs = cos(angle1 * PI / 360 );
	sqr = (s - a1) * (s - b1) * (s - c1) * (s - d1) - a1 * b1 * c1 * d1 * cs * cs;
	if (sqr < 0) {
		return -1;
	}
	else {
		S = sqrt(sqr);
		return S;
	}
}


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


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

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

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


int main()
{double a,b,c,d,e,sum,k;

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

e/=360;

e*=3.1415926;sum=(a+b+c+d)/2;
sum=((sum-a)*(sum-b)*(sum-c)*(sum-d)-a*b*c*d*cos(e)*cos(e));
if(sum<0)printf("Invalid input");
else{sum=(a+b+c+d)/2;
sum=((sum-a)*(sum-b)*(sum-c)*(sum-d)-a*b*c*d*cos(e)*cos(e));
sum=sqrt(sum);
printf("%.4f\n",sum);}return 0;
}


int main()
{
double a,b,c,d,sita,s,tmp;
a=b=c=d=sita=s=tmp=0;
scanf("%lf",&a);
scanf("%lf",&b);
scanf("%lf",&c);
scanf("%lf",&d);
scanf("%lf",&sita);
s=(a+b+c+d)/2;
sita=sita*PI/360;
sita=cos(sita);
tmp=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*sita*sita;
if(tmp<0)
{
printf("Invalid input\n");
goto eof;
}
tmp=sqrt(tmp);
printf("%.4f",tmp);
eof:;
}


double f(double a,double b,double c,double d,double e)
{
	double z,s,j;
	s=0.5*(a+b+c+d);
	j=e*PI/360;
	z=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(j)*cos(j);
	if(z>0)printf("%.4lf",sqrt(z));
	else printf("Invalid input");
	return z;
}
void main()
{
	double a,b,c,d,e,s,z;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	f(a,b,c,d,e);
}


int main()
{
	double a,b,c,d,S,alpha,m,n;
    scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&alpha);
	double s(double a,double b,double c,double d),t(double a,double b,double c,double d),r(double a,double b,double c,double d,double alpha);
	m=t(a,b,c,d);
	n=r(a,b,c,d,alpha);
	if(m<0)
	{
		printf("Invalid input");
	}
	else
	{
		S=sqrt(m-n);
	    printf("%.4lf",S);
	}
	return 0;
}
double s(double a,double b,double c,double d)
{
	double w,z;
	w=(a+b+c+d);
	z=w/2;
	return(z);
}
double t(double a,double b,double c,double d)
{
	double x,h,i,j,k,l;
	x=s(a,b,c,d);
	h=x-a;
	i=x-b;
	j=x-c;
	k=x-d;
	l=h*i*j*k;
	return(l);
}
double r(double a,double b,double c,double d,double alpha)
{
	double p,q,y;
	p=alpha/720;
	q=p*2*PI;
    y=a*b*c*d*cos(q)*cos(q);
	return(y);
}


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


void f(double a,double b,double c,double d,double alpha)
{
	double s;
	double result;
	alpha=alpha*3.1415926535898/180;
	s=(a+b+c+d)/2;
	result= (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(alpha/2)*cos(alpha/2);
	if(result<0)
		printf("Invalid input\n");
	else
	{
		result=sqrt(result);
		printf("%.4lf",result);
	}

}
main()
{
	double a,b,c,d;
	double alpha;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&alpha);
	f(a,b,c,d,alpha);

}


double compute(double a,double b,double c,double d,double sum)
{
	double mianji=0;
	double s=(a+b+c+d)/2;
	double hudu=sum*PI/360;
	mianji=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(hudu)*cos(hudu);
	if(mianji>=0)
		mianji=sqrt(mianji);
	return mianji;
}

void main()
{
	double a,b,c,d,sum;
	double v;

	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&sum);
	v=compute(a,b,c,d,sum);
	if(v<0)
		printf("Invalid input\n");
	else
		printf("%.4lf\n",v);
}


const double PI = 3.1415926;

int main()
{
	double a , b, c , d, e;
	cin >> a >> b >> c >> d >> e;
	double s = 0;
	double t = (a+b+c+d) / 2;
	s  = sqrt(
			(t-a) * (t-b) * (t-c) * (t-d) -
			a * b * c * d *
			pow(cos(e * PI / 360),2)
		 );
	if (s >=0) printf("%.4lf",s);
		else printf("Invalid input");
	return 0;
}


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


int main()
{
	double a,b,c,d,g;
	double e,f,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	g=(a+b+c+d)/2;
	f=P*e/360;
	S=sqrt((g-a)*(g-b)*(g-c)*(g-d)-a*b*c*d*pow(cos(f),2));
	if((g-a)*(g-b)*(g-c)*(g-d)-a*b*c*d*pow(cos(f),2)<0)
		printf("Invalid input");
	else
		printf("%.4lf",S);
	return 0;
}


const double pri=3.1415926;

double mianji(double a,double b,double c,double d,double x)
{
	double s,t;
	s=1.0/2*(a+b+c+d);
	x=x/360*pri;
	t=((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x));
	if (t<0) return 0;
	else return sqrt(t);
}
void main()
{
	double x,y,u,v,w;
	scanf("%lf%lf%lf%lf%lf",&x,&y,&u,&v,&w);
	if (mianji(x,y,u,v,w))
	   printf("%.4lf",mianji(x,y,u,v,w));
	else printf("Invalid input");
}


main()
{
      double a,b,c,d;
      double e;
      double i;
      scanf("%lf\n%lf\n%lf\n%lf\n",&a,&b,&c,&d);
      scanf("%lf",&e);
      i=(double)(e/2);
      double f,g;
      f=(double)((a+b+c+d)/2);
      double p;
      p=(double)((i/180)*PI);
      g=(double)((f-a)*(f-b)*(f-c)*(f-d)-a*b*c*d*cos(p)*cos(p));
      if(g<0)
      printf("Invalid input");
      else
      {
          double s;
          s=sqrt(g);
          printf("%.4lf",s);
      }
      getchar();
      getchar();
}


void main()
{
	double f(double a,double b,double c,double d,double h);
	double a,b,c,d,h,final;
	char x[]={"Invalid input"};
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&h);
	final=f(a,b,c,d,h);
	if(final<0)
		puts(x);
	else printf("%.4lf",final);

}

double f(double a,double b,double c,double d,double h)
{
	double under,s;
	h=h/180*PI;
	s=(a+b+c+d)/2;
	under=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(h/2)*cos(h/2);
	if(under>=0) return (sqrt(under));
	else return(-1);
}


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


main()
{
	double s,a,b,c,d,alpha;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&alpha);
	s=(a+b+c+d)/2;
	alpha=alpha*3.1415926/180;
	alpha=alpha/2;
	if((s-a)*(s-b)*(s-c)*(s-d)<a*b*c*d*cos(alpha)*cos(alpha)){printf("Invalid input\n");}
	else printf("%.4lf\n",sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(alpha)*cos(alpha)));
}


float surface(float a,float b,float c,float d,float o);
void main()
{
	float a,b,c,d;
	float o;
	scanf("%f%f%f%f",&a,&b,&c,&d);
	scanf("%f",&o);
	if(surface(a,b,c,d,o)==-1)
		printf("Invalid input");
	else
	printf("%.4f",surface(a,b,c,d,o));
}
float surface(float a,float b,float c,float d,float o){
    float face,s;
	s=(a+b+c+d)/2;
	if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(PI*o/360))*(cos(PI*o/360))<0)
	{
		return (-1);
	}
    else
	face=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(PI*o/360))*(cos(PI*o/360))) ;
	return face;
}


void main()
{
	double a,b,c,d,t,z;
	double area(double a,double b,double c,double d,double t);
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&t);
	z=area(a,b,c,d,t);
	if(z<0)
		printf("Invalid input");
	else printf("%.4lf",sqrt(z));
}

double area(double a,double b,double c,double d,double t)
{     double y,s,PI = 3.1415926;
      s=(a+b+c+d)/2;
     y=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(t/360*PI)*cos(t/360*PI);
	 return(y);
}


int main()
{
	double a,b,c,d,s,l,S,x,PI = 3.1415926;
	cin>>a;
	cin>>b;
	cin>>c;
	cin>>d;
	cin>>l;
        s=(a+b+c+d)*1.0/2;
	x=(s-a)*(s-b)*(s-c)*(s-d);
	if(x>=0)
	{
	    l=l*PI/360;
	    S=sqrt(x-a*b*c*d*cos(l)*cos(l));
	    printf("%.4f",S);
	}
	else
		cout<<"Invalid input";
	return 0;
}


int main()
{
	double arrey[5] ;
	double m;
	int i ;
	for(i=0 ; i<5 ; i++ )
	{
		scanf("%lf" , &m );
		arrey[i]=m ;
	}
	double s , f , k ;
	k=(arrey[4]*PI)/360 ;
	s = (double)1/2*(arrey[0]+arrey[1]+arrey[2]+arrey[3]);
    if ( ((s-arrey[0])*(s-arrey[1])*(s-arrey[2])*(s-arrey[3]) - arrey[0]*arrey[1]*arrey[2]*arrey[3]*cos(k)*cos(k))>=0 )
	{
		f = sqrt((s-arrey[0])*(s-arrey[1])*(s-arrey[2])*(s-arrey[3]) - arrey[0]*arrey[1]*arrey[2]*arrey[3]*cos(k)*cos(k));
		printf ("%.4f" , f );
	}
	else
		printf ("Invalid input");
	return 0;
}


int main () {
double a, b, c, d, jiaodu, hudu, PI=3.1415926, mianji, s;
scanf( "%lf %lf %lf %lf %lf", &a, &b, &c, &d, &jiaodu);
hudu = jiaodu/180*PI;
s =(a+b+c+d)/2;
mianji= sqrt( (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(hudu/2)*cos(hudu/2) );
if ( (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(hudu) < 0 ) {
printf("Invalid input");}
else {printf("%.4lf", mianji);}
return 0 ;
}


int main(int argc, char* argv[])
{
	double a,b,c,d,w,s;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&w);
	w=3.1415926*w/180/2;
	s = 1.0/2*(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("%.4f\n",sqrt(s));
	return 0;
}


int main ()
{
	double pi=3.1415926,f,s=0,a[4];
	int i;
	for(i=0;i<4;i++)
		scanf("%lf",&a[i]);
	scanf("%lf",&f);
	f=pi/360*f;
	void he(double,double,double,double,double);
    he(a[0],a[1],a[2],a[3],f);

}
void he(double a,double b,double c,double d,double f1)
{  int i;
    double sum,s;
   s=a/2+b/2+c/2+d/2;
    sum=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(f1)*cos(f1);
	if(sum<0) printf("Invalid input");
	else
	{
		sum=sqrt(sum);
		printf("%.4f",sum);
	}
}


int main()
{
	double a,b,c,d;
	double sum,hudu;
	double s;
	double pi=3.1415926;
	double m;

	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&sum);
	m=1.0/2*(a+b+c+d);
	hudu=sum*pi/180;

	if ((m-a)*(m-b)*(m-c)*(m-d) - a*b*c*d*cos(hudu/2)*cos(hudu/2)<0)
	{
		printf("Invalid input");
		return 0;
	}
	else
	{
		s = sqrt((m-a)*(m-b)*(m-c)*(m-d) - a*b*c*d*cos(hudu/2)*cos(hudu/2));
	}
	printf("%.4lf\n",s);
	return 0;
}


double mianji(double a,double b,double c,double d,double n)
{
	double w,m,s;
	m=n*3.1415926/360.0;
	s=(a+b+c+d)/2;
	w=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(m)*cos(m);

		return(w);
}

void main()
{
	double a,b,c,d,n,e,q;

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

	e=mianji(a,b,c,d,n);

     if (e>0)
	{
			q=sqrt(e);
		printf("%.4lf\n",q);
	}
	else
	{
		printf("Invalid input\n");
	}

}


double cal(double a,double b,double c,double d,double ang);
int main()
{
	double a,b,c,d,ang;
	double x,area;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&ang);
	ang/=2 ;
	ang = ang * PI /180;
	x=cal(a,b,c,d,ang);
	if(x<=0){
		printf("Invalid input");
	}else{
		area=sqrt(x);
		printf("%.4lf",area);
	}
	return 0;
}
double cal(double a,double b,double c,double d,double ang)
{
	double ans,s;
	s=(a+b+c+d)/2;
	ans=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(ang)*cos(ang);
	return ans;
}


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

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


int main()
{
    void area(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);

    area(a, b, c, d, e);

        return 0;
}

void area(double a, double b, double c, double d, double e)
{
    double temp;

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

    temp = (s - a) * (s - b) * (s - c) * (s - d) - a * b * c * d * pow(cos(e / 360 * 3.1415926), 2);

    if(temp < 0)
                    printf("Invalid input");
    else
                    printf("%.4lf", sqrt(temp));
}


int main(int argc, char* argv[])
{
	float a,b,c,d;
	double S,s,o,m;
	#define PI 3.1415927
	scanf("%f%f%f%f%lf",&a,&b,&c,&d,&o);
	s = (a+b+c+d)/2;
	m=(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o/2*PI/180)*cos(o/2*PI/180);
	if(m<0)
	{
		printf("Invalid input\n");
	}
	else
	{
		S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(o/2*PI/180)*cos(o/2*PI/180));
	printf("%.4lf\n",S);
	}

	return 0;
}


double mianji(double a,double b,double c,double d,double alpha){
	double jiao,s,S,S2;
	jiao=alpha/180*PI/2;
	s=(a+b+c+d)/2;
	S2=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(jiao)*cos(jiao);
	if(S2<0){
	return 0;
	}else{
	S=sqrt(S2);
	return S;
	}
}
int main(int argc, char* argv[])
{
	double a,b,c,d,alpha;
	scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&alpha);
	if(mianji(a,b,c,d,alpha)==0){
		printf("Invalid input\n");
	}else{
		printf("%.4lf\n",mianji(a,b,c,d,alpha));
	}
	return 0;
}


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

double area(double t)
{
	double S;
	S = sqrt(t);
	return S;
}


int main()
{
	double a;
	double b;
	double c;
	double d;
	double e;
	double S;
	double s;
	scanf("%lf",&a);
	scanf("%lf",&b);
	scanf("%lf",&c);
	scanf("%lf",&d);
	scanf("%lf",&e);
	e=e/180*3.1415926;
	s = (a+b+c+d)/2;

	S = sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(pow(cos(e/2),2)));
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(pow(cos(e/2),2)))<0)
	{
		printf("Invalid input");
	}
	else
	{

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


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

}


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()
{
	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);}


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;
}


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 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;
	}


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 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);
	}

}


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);
}


int main()
{
	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;
	x=x*PI/360;
	S=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x);
	if(S>=0)
	{
		S=sqrt(S);
		printf("%.4lf",S);
	}
	else
	{
		printf("Invalid input");
	}
	return 0;
}