semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	float a,b,c,d;
	float r;
	float s,S;
	scanf("%f%f%f%f",&a,&b,&c,&d);
	scanf("%f",&r);
	if(r<0||r>360)
	{
		return 0;
	}
	else
	{
		s = (a+b+c+d)/2;
		S =(float) sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(r*3.1415926/360)*cos(r*3.1415926/360)); 
	}
	if(((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(r*3.1415926/360)*cos(r*3.1415926/360))<0)
	{
		printf("Invalid input\n");
	}
	else
	{
		printf("%.4f\n",S);
	}
	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(int argc, char* argv[])
{
	double S,s,a,b,c,d,m;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&m);
	s = (double)1/2*(a+b+c+d); 
	S = (double)sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((m/360)*3.1415926)*cos((m/360)*3.1415926)); 
	if ((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos((m/360)*3.1415926)*cos((m/360)*3.1415926)<0)
	{
		printf("Invalid input");
	}
	else
	{
		printf("%.4lf",S);
	}
	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();
}
int main()
{
	double a;
	double b;
	double c;
	double d;
	double e,f,s,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
	s=(a+b+c+d)/2;
	f=((a+b+c+d)/2-a)*((a+b+c+d)/2-b)*((a+b+c+d)/2-c)*((a+b+c+d)/2-d) - a*b*c*d*pow(cos(e*3.1415926/360),2);
	if(f>=0){
		S=sqrt(((a+b+c+d)/2-a)*((a+b+c+d)/2-b)*((a+b+c+d)/2-c)*((a+b+c+d)/2-d) - a*b*c*d*pow(cos(e*3.1415926/360),2));
		printf("%.4f\n",S);}
	else
		printf("Invalid input\n");
	return 0;
}
int main()
{
    double a,b,c,d,i,S,A;
    scanf("%lf\n%lf\n%lf\n%lf\n%lf\n",&a,&b,&c,&d,&i);
    A = (1.0/2*(a+b+c+d)-a)*(1.0/2*(a+b+c+d)-b)*(1.0/2*(a+b+c+d)-c)*(1.0/2*(a+b+c+d)-d) - a*b*c*d*(cos(PI*i/360))*(cos(PI*i/360));
    if(A>0)
    {
        S = sqrt((1.0/2*(a+b+c+d)-a)*(1.0/2*(a+b+c+d)-b)*(1.0/2*(a+b+c+d)-c)*(1.0/2*(a+b+c+d)-d) - a*b*c*d*(cos(PI*i/360))*(cos(PI*i/360)));
        printf("%.4lf",S);
    }
    if(A<0)
    {
        printf("Invalid input");
    }
        return 0;
}
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;
}
void main()
{
	double a,b,c,d,s,x,pi=3.1415926,t;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	s=(a+b+c+d)/2;
	x=x/360*2*pi;
	x=x/2;
	t=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x)*cos(x);
	if(t<0)
	{
		printf("Invalid input\n");
	}
	if(t>0)
	{
		t=sqrt(t);
		printf("%.4lf\n",t);
	}
}
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()
{
	double a,b,c,d,e,f,S,s;
	scanf("%lf\n",&a);
    scanf("%lf\n",&b);
	scanf("%lf\n",&c);
	scanf("%lf\n",&d);
    scanf("%lf\n",&e);
    s = (a+b+c+d)*0.5;
	f= (e/360)*3.1415926;
	S = ((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*(cos(f))*(cos(f)));
	if(S<0){
		printf("Invalid input");
	}
	else{
        printf("%.4lf",sqrt(S));
	}
		return 0;
}
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));
}
int main()
{
     
       double y=0,a,b,c,d,s=0,x=0,e,v=0;
       scanf("%lf\n%lf\n%lf\n%lf\n%lf",&a,&b,&c,&d,&e);
       s = (a+b+c+d)/2; 
       v=e/360*3.1415926;
       x = (s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(v)*cos(v); 
      if(x<0)
      {
       printf("Invalid input");
       }
      else{
      printf("%.4lf",sqrt(x));
       }
 
   return 0;
  }
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(){
	double a,b,c,d,s,S,x,p;
	scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
	s=(a+b+c+d)/2;
	scanf("%lf",&x);
	x=x/360*3.1415926;
	p=(s-a)*(s-b)*(s-c)*(s-d);
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(x)*cos(x));
	if(p<0)
		printf("Invalid input");
	else
		printf("%.4lf",S);
	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;
}
int main(){
	double a,b,c,d,x,y,s,S;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&x);
	if(x>0){
		if(x<360){
           s=(a+b+c+d)/2;
	       y=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(x/360*3.1415926)*cos(x/360*3.1415926);
	       if(y<0){
		       printf("Invalid input");
		   }else{
		       S=sqrt(y);
		       printf("%.4lf",S);
		   }
		}
	}
	return 0;
}
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;
}
main()
{
    double a,b,c,d,e;
    cin>>a;
    cin>>b;
    cin>>c;
    cin>>d;
    cin>>e;
    e=(e/180*3.1415926)/2;
    double s,r;
    s=(a+b+c+d)/2;
    if((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e)*cos(e)<0)
       cout<<"Invalid input";
    else{
    r=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(e)*cos(e));
    printf("%.4lf", r);
    }
    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,S,s,p;
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&p);
	s=(a+b+c+d)/2;
	S=sqrt((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(p*3.1415926/180/2)*cos(p*3.1415926/180/2)); 
	if(((s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(p*3.1415926/180/2)*cos(p*3.1415926/180/2))<0)
		printf("Invalid input");
	else
		printf("%.4lf",S);
	return 0;
}
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));
  
}
int main()
{
   double a,b,c,d,e,f,s,S,m;
   scanf("%lf\n%lf\n%lf\n%lf\n%lf\n",&a,&b,&c,&d,&e);
   s =(a+b+c+d)/2;
   f =e/360*3.1415926;
   m =(s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos (e/360*3.1415926)*cos (e/360*3.1415926);  
    
   if(m<0){printf("Invalid input");}
   else{ S =sqrt(m); printf("%.4lf",S);}
   return 0;
}
int main()
{
	float a,b,c,d,e,s,t,h,g,k;
	scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
         s=(a+b+c+d)/2;   
          h=(s-a)*(s-b)*(s-c)*(s-d) ;
		  t= a*b*c*d;
		  g=cos(3.1415926*e/360)*cos(3.1415926*e/360); 
		  k=h-t*g;
		  if(k>0)
			  printf("%.4f\n",sqrt(k));
		  else printf("Invalid input");
		  return 0;
}
int main(int argc, char* argv[])
{
	double a,b,c,d,e,s,t,S;  //e??????
	scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e);
         s=1.0/2*(a+b+c+d); 
	t=(s-a)*(s-b)*(s-c)*(s-d)-a*b*c*d*cos(e*PI*1/2/180)*cos(e*PI*1/2/180);//(e*PI*1/2/180)???????????2
    if(t<0)
	{
		printf("Invalid input");
	}
	else
	{
		S=sqrt(t);
		printf("%.4f",S);
	}
    return 0;
}
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;
}