forked from sitz/UVa-Online-Judge
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path10060.cpp
More file actions
42 lines (38 loc) · 741 Bytes
/
10060.cpp
File metadata and controls
42 lines (38 loc) · 741 Bytes
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
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0f);
const double EPS = 1e-5;
bool cmp(double a, double b)
{
return fabs(a - b) > EPS;
}
int main()
{
double total_mat, area;
double R, T, thickness, x0, y0, xp, yp, x, y;
for (int n; scanf("%d", &n) == 1 && n;)
{
total_mat = 0;
for (int i = 0; i < n; ++i)
{
scanf("%lf%lf%lf", &thickness, &x0, &y0);
area = 0;
xp = x0;
yp = y0;
while (scanf("%lf%lf", &x, &y) == 2)
{
area += xp * y - yp * x;
xp = x;
yp = y;
if (!(cmp(x, x0) || cmp(y, y0)))
{
break;
}
}
total_mat += fabs(area) * thickness;
}
scanf("%lf%lf", &R, &T);
printf("%.0lf\n", floor(total_mat / (2 * PI * R * R * T)));
}
return 0;
}