#include <cmath>
int main() {
float a = 1.0;
float b = a - (1.0 / 3.0);
int znak = 1;
unsigned i = 3;
while (fabs(b - a) > 0.001) {
a = b;
b += znak * (1.0 / (2.0 * i - 1.0));
znak *= -1;
i++;
}
}
int main() {
float sum = 1;
int sign = -1;
unsigned n = 10000;
for (int i = 2; i <= n; i++) {
sum += sign * (1.0 / (2.0 * i - 1.0));
sign *= -1;
}
std::cout << sum * 4;
}