#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define M_PI 3.14159265
double true_area = 2.828;
int main() {
double a, b, s, x1, x2, y1, y2, q1, q2;
int count, m, n;
x1 = 1.0; y1 = 0.0;
x2 = 0.0; y2 = 1.0;
count = 0;
for (n = 10; n <= 100000; n = n * 5) {
count = 0;
s = 0.0;
for (m = 0; m < n; m++) {
a
= (double)rand() / RAND_MAX
; b
= (double)rand() / RAND_MAX
;
q1 = (a - x1) * (a - x1) + (b - y1) * (b - y1);
q2 = (a - x2) * (a - x2) + (b - y2) * (b - y2);
if (q1 < 1.0 && q2 < 1.0) {
s += 1.0;
}
}
s /= n;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPG1hdGguaD4KCiNkZWZpbmUgTV9QSSAzLjE0MTU5MjY1Cgpkb3VibGUgdHJ1ZV9hcmVhID0gMi44Mjg7CgppbnQgbWFpbigpIHsKICAgIGRvdWJsZSBhLCBiLCBzLCB4MSwgeDIsIHkxLCB5MiwgcTEsIHEyOwogICAgaW50IGNvdW50LCBtLCBuOwoKICAgIHgxID0gMS4wOyB5MSA9IDAuMDsKICAgIHgyID0gMC4wOyB5MiA9IDEuMDsKICAgIGNvdW50ID0gMDsKCiAgICBmb3IgKG4gPSAxMDsgbiA8PSAxMDAwMDA7IG4gPSBuICogNSkgewogICAgICAgIGNvdW50ID0gMDsKICAgICAgICBzID0gMC4wOwoKICAgICAgICBmb3IgKG0gPSAwOyBtIDwgbjsgbSsrKSB7CiAgICAgICAgICAgIGEgPSAoZG91YmxlKXJhbmQoKSAvIFJBTkRfTUFYOwogICAgICAgICAgICBiID0gKGRvdWJsZSlyYW5kKCkgLyBSQU5EX01BWDsKCiAgICAgICAgICAgIHExID0gKGEgLSB4MSkgKiAoYSAtIHgxKSArIChiIC0geTEpICogKGIgLSB5MSk7CiAgICAgICAgICAgIHEyID0gKGEgLSB4MikgKiAoYSAtIHgyKSArIChiIC0geTIpICogKGIgLSB5Mik7CiAgICAgICAgICAgIAogICAgICAgICAgICBpZiAocTEgPCAxLjAgJiYgcTIgPCAxLjApIHsKICAgICAgICAgICAgICAgIHMgKz0gMS4wOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBzIC89IG47CiAgICAgICAgcHJpbnRmKCIlZFx0JWZcbiIsIG4sIGZhYnMocyAtIHRydWVfYXJlYSkpOwogICAgfQoKICAgIHJldHVybiAwOwp9Cg==