#include <stdio.h>
#include <math.h>
double f(double x)
{
}
int main()
{
const double ANS = 1.0 / 4.0;
double a = 0.0;
int N;
for (N
=1 ; fabs(a
- ANS
) >= 0.001; N
++ ) { double x;
double d = 1.0 / (double)N;
for (x=0.0, a=0.0; x<=1.0; x+=d)
a += ((d + d) * f(x)) / 2.0;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+Cgpkb3VibGUgZihkb3VibGUgeCkKewoJcmV0dXJuIHBvdyh4LCAzLjApOwp9CgppbnQgbWFpbigpCnsKY29uc3QgZG91YmxlIEFOUyA9IDEuMCAvIDQuMDsgCmRvdWJsZSBhID0gMC4wOwppbnQgTjsKCglmb3IgKE49MSA7IGZhYnMoYSAtIEFOUykgPj0gMC4wMDE7IE4rKyApIHsKCQlkb3VibGUgeDsKCQlkb3VibGUgZCA9IDEuMCAvIChkb3VibGUpTjsKCQlmb3IgKHg9MC4wLCBhPTAuMDsgeDw9MS4wOyB4Kz1kKQoJCQlhICs9ICgoZCArIGQpICogZih4KSkgLyAyLjA7Cgl9CgkKCXByaW50ZigiJWZcbiIsIGEpOwoJCglyZXR1cm4gMDsJCn0K