#t210. 与圆相关的计算

与圆相关的计算

Circle Calculations

Problem Background

Special for beginners, ^_^

Problem Description

Given the radius of a circle, compute its diameter, circumference, and area.

Input Format

The input contains one real number  r \,r\, (0<r≤10 0000 < r \le 10\,000), the radius of the circle.

Output Format

Output one line with three numbers, representing the diameter, the circumference, and the area of the circle, separated by single spaces, each number kept to 44 decimal places.

Sample Input

3.0

Sample Output

6.0000 18.8496 28.2743

Constraints

1s, 1024KiB for each test case.

Hint

  • One line outputting three numbers, space-separated, each to 44 decimal places.
  • The precision of π\pi is the key to this problem: 3.143.14 will already be wrong at the 44th decimal place — the official hint gives the acos(-1) way, so just follow it.

You need a more precise value of π\pi. Add #include <cmath> (or <math.h> in C), and put the following line just above int main(): const double PI = acos(-1);

If the radius is  r \,r\,, then the diameter, circumference, and area are 2*r, 2 * PI * r, and PI * r * r respectively.

You can keep 44 decimal places with printf("%.4lf", ...) or cout << fixed << setprecision(4) << ....