You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
C++
39 lines
1.0 KiB
C++
#define _CRT_SECURE_NO_WARNINGS
|
|
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
|
|
|
|
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
double pi = acos(-1);
|
|
struct circle {
|
|
double x, y, r;
|
|
};
|
|
|
|
int main() {
|
|
int a, b, n;
|
|
double g;
|
|
scanf("%d%d%lf%d", &a, &b, &g, &n);
|
|
circle *cs = new circle[n];
|
|
g = g / 180 * pi;
|
|
for (int i = 0; i < n; i++) {
|
|
int x, y, z, r;
|
|
scanf("%d%d%d%d", &x, &y, &z, &r);
|
|
cs[i].x = x + z / tan(g);
|
|
cs[i].y = y;
|
|
cs[i].r = r;
|
|
}
|
|
double eps = 0.01;
|
|
long long cnt = 0;
|
|
for (double i = 0; i <= a; i += eps)
|
|
for (double j = 0; j <= b; j += eps) {
|
|
bool flag = true;
|
|
for (int k = 0; k < n && flag; k++)
|
|
if ((i - cs[k].x + eps / 2) * (i - cs[k].x + eps / 2) +
|
|
(j - cs[k].y + eps / 2) * (j - cs[k].y + eps / 2) < cs[k].r * cs[k].r)
|
|
flag = false;
|
|
cnt += flag;
|
|
}
|
|
printf("%.2lf\n", cnt * eps * eps);
|
|
return 0;
|
|
}
|