11909

#include <iostream>
#include <cmath>
#include <cstdio>

#define PI acos(-1)
using namespace std;
//using the formulae a/sin A = b/sin B = c/sin C
int main()
{
	double L,W,H,angle;
	double changed_hight,res,changed_base,empty_area;
	while(scanf("%lf%lf%lf%lf",&L,&W,&H,&angle)!=EOF)
	{
		changed_hight= sin(angle*PI/180)*L/sin((90-angle)*PI/180);

		if(angle==0)
		{
			printf("%.3lf mL\n",L*W*H);
		}
		else if(angle==90)
		{
			printf("%.3lf mL\n",0);
		}
		else if(changed_hight<=H)
		{
			empty_area=changed_hight*L*W/2;
			res = L*W*H-empty_area;
			printf("%.3lf mL\n",res);
		}
		else
		{
			changed_base = H * sin((90-angle)*PI/180)/sin(angle*PI/180);
			res = H*changed_base*W/2;
			printf("%.3lf mL\n",res);
		}
	}
	return 0;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *