#include <iomanip>
#include <iostream>

double functionF(double x) {
    return x * x - 16.0;
}

double functionG(double x, double fValue) {
    if (fValue < 0.0) return 1.0;
    if (fValue == 0.0) return x * x + 16.0;
    return 0.0;
}

int main() {
    std::cout << "x f g sum\n" << std::fixed << std::setprecision(2);
    // Half-integers are exactly representable in binary; the grid contains 4 exactly.
    for (int halfSteps = 2; halfSteps <= 20; ++halfSteps) {
        const double x = halfSteps / 2.0;
        const double f = functionF(x);
        const double g = functionG(x, f);
        std::cout << x << ' ' << f << ' ' << g << ' ' << f + g << '\n';
    }
}
