#include <cmath>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>

// Read one whole line so a failed conversion cannot trap the input stream.
bool readNumber(const std::string& prompt, double& value, double low, double high) {
    std::string line;
    while (std::cout << prompt && std::getline(std::cin, line)) {
        std::istringstream input(line);
        char extra = '\0';
        if (input >> value && !(input >> extra) && std::isfinite(value)
            && value >= low && value <= high) {
            return true;
        }
        std::cout << "Enter a finite number in [" << low << ", " << high << "].\n";
    }
    std::cerr << "Input ended before a valid number was supplied.\n";
    return false;
}

int main() {
    double first = 0.0, last = 0.0, step = 0.0;
    if (!readNumber("First radius (m): ", first, 0.0, 1e6)
        || !readNumber("Last radius (m): ", last, first, 1e6)
        || !readNumber("Radius step (m): ", step, 1e-6, 1e6)) return 1;
    const double intervals = (last - first) / step;
    if (intervals > 10000.0) {
        std::cerr << "Table limited to 10001 rows; choose a larger step.\n";
        return 1;
    }
    const int steps = static_cast<int>(std::floor(intervals + 1e-9));
    const double pi = std::acos(-1.0);
    std::cout << "radius_m area_m2 circumference_m\n" << std::fixed << std::setprecision(6);
    // Derive radius from an integer index; never accumulate a floating step.
    for (int index = 0; index <= steps; ++index) {
        const double radius = first + index * step;
        std::cout << radius << ' ' << pi * radius * radius << ' ' << 2.0 * pi * radius << '\n';
    }
}
