We need to write a program that calculates area and circumference of a circle for given radius r. Input is a real number r. Output area and circumference, separated by a space, with error less than 10^-5.
Examples: For r=2, area = π * 4 = 12.566370614... circumference = 2π * 2 = 12.566370614... (same). They output 12.566371 12.566371 (rounded to 6 decimal places?). Actually both show 6 decimal places but spec says absolute error not greater than 10^-5. So printing with enough digits is fine.
We can write in any language? The problem statement says "Write a program", but it's from an online judge? Usually it expects a certain language, but it's open-ended. I'll produce a solution in C++ perhaps, or Python. Since we just need to produce code, I can choose Python for simplicity.
Let's compute: area = pi * r * r, circumference = 2 * pi * r. Use math.pi.
Precision: Use double.
Example: For 2: area = math.pi * 4 = 12.566370614359172, circumference = 12.566370614359172. Print with maybe 10 decimal places or use format to ensure precision. In Python, we can just print area, circumference, and by default it prints many digits, but to guarantee error, we can use print("{:.10f} {:.10f}".format(area, circumference)) but ensure not more than 10^-5 error. However if we print fewer digits, we might have error up to 0.510^-k. So to guarantee absolute error less than 10^-5, we need to output with at least 5 decimal places correctly. Using something like print("{:.6f} {:.6f}".format(area, circumference)) gives rounding to 10^-6, error less than 0.510^-6 which is less than 10^-5. So it's fine. Example uses 6 decimal places. We'll match example? It's not required exactly same format, just space separated and error constraint.
Alternatively, just print the numbers as is and Python will output enough digits. But for safety, I'll format to 10 decimal places.
I'll write a solution in Python.
However the problem statement says "Write a program", but the context might be from AIZU or something? Often they want C, C++, Java. But Python is accepted on many judges. Since no language is specified, I'll produce a simple solution.
But we need to produce the final answer: code. Let's produce a Python solution.
Pseudo:
import math
r = float(input())
pi = math.pi
area = pi * r * r
circum = 2 * pi * r
print("{:.10f} {:.10f}".format(area, circum))
But the example has no trailing zeros, but that's okay.
Alternatively, use print(area, circum) -> will print with default representation, which may be scientific if many digits? For 2, it prints "12.566370614359172 12.566370614359172", which has many digits and error 0, definitely fine. So simplest: print(area, circum). But note that the judge might expect exactly one space and maybe specific formatting. But the constraint just says "Print the area and circumference ... The output should not contain an absolute error greater than 10-5." So any representation is fine.
Thus I'll go with: print(area, circum). That prints separated by space.
Edge cases: r integer but real.
Now final answer: We'll write a Python script.
But let's also consider if we need to handle input with multiple lines? Only one number.
So code:
import sys, math
def main():
r = float(sys.stdin.readline())
pi = math.pi
area = pi * r * r
circum = 2 * pi * r
print(area, circum)
if name == "main":
main()
That's it.
Now we might also need to use high precision? double is enough.
Thus answer.
But the user asked: "Write a program which calculates the area and circumference of a circle for given radius r." So we need to provide the program. We'll output the code.
Given the instruction: "You are an AI. Provide the final answer." So we need to produce the program.
We'll give a Python solution.
But maybe we can also provide C++ solution? I'll produce Python as it's simpler.
However, sometimes these problems are from "Introduction to Programming" where they expect C. But the user didn't specify language, so we can choose any.
I'll write a simple, well-commented code.
Actually, I'll write two versions? No, just one.
Thus answer. ```python
import sys
import math
def main():
# Read the radius as a floating-point number
r = float(sys.stdin.readline())
pi = math.pi
# Compute area and circumference
area = pi * r * r
circumference = 2 * pi * r
# Print with a space between them; default formatting provides enough precision
print(area, circumference)
if name == "main":
main()