-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoyaMilk_UVA11909OJ.cpp
53 lines (41 loc) · 1004 Bytes
/
soyaMilk_UVA11909OJ.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <string>
#include <queue>
#include <vector>
using namespace std;
const double PI = 3.1415926536;
int main()
{
ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
cout << fixed << setprecision(3);
while (true)
{
int i1 = 0, i2 = 0, i3 = 0, i4 = 0; cin >> i1 >> i2 >> i3 >> i4;
if (i1 + i2 + i3 + i4 == 0)
{
break;
}
double l = (double)i1, w = (double)i2, h = (double)i3, a = (double)i4;
double size;
double _tan = tan((90 - a) * PI / 180.0);
if (a < atan(h / l) / PI * 180.0)
{
size = l * h - l * (l / _tan) / 2;
}
else
{
size = h * h * _tan / 2;
}
cout << size * w << " mL\n";
}
cout.flush();
return 0;
}