Problem list
Log in
#coci00002 · COCI 2006/2007 Contest 1

Herman

Bronze III 1.0 s 32 MB

The 19th century German mathematician Hermann Minkowski investigated a non-Euclidean geometry, called the taxicab geometry. In taxicab geometry the distance between two points $T_1 = (x_1, y_1)$ and $T_2 = (x_2, y_2)$ is defined as:

$d(T_1, T_2) = |x_1 - x_2| + |y_1 - y_2|$

All other definitions are the same as in Euclidean geometry, including that of a circle:

A circle is the set of all points in a plane at a fixed distance (the radius) from a fixed point (the centre of the circle).

We are interested in the difference of the areas of two circles with radius $R$, one of which is in normal (Euclidean) geometry, and the other in taxicab geometry. The burden of solving this difficult problem has fallen onto you.

Input

The first and only line of input contains the radius $R$, an integer smaller than or equal to $10,000$.

Output

On the first line, output the area of a circle with radius $R$ in normal (Euclidean) geometry.

On the second line, output the area of a circle with radius $R$ in taxicab geometry.

Note: Outputs within $±0.000001$ of the official solution will be accepted.

Example 1

Input
1
Output
3.141593
2.000000

Euclidean area = π·1² ≈ 3.141593; taxicab area = 2·1² = 2.

Example 2

Input
21
Output
1385.442360
882.000000

Example 3

Input
42
Output
5541.769441
3528.000000
Source
COCI 2006/2007 Contest 1
Appears in
Not part of a ladder, contest or set yet.
Accepted 1 Submissions 1 Acceptance 100% Solvers 1

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code