A1065 | [COCI-2006_2007-contest1]#3 HERMAN
来源COCI
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
The 19th century German mathematician Hermann Minkowski investigated a non-Euclidian geometry, called the taxicab geometry. In taxicab geometry the distance between two points T1(x1,
y1) and T2(x2, y2) is defined as:
D(T1,T2) = |x1 - x2| + |y1 - y2|
All other definitions are the same as in Euclidian 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 (Euclidian) geometry, and the other in taxicab geometry. The burden of solving this difficult problem has fallen onto you.
y1) and T2(x2, y2) is defined as:
D(T1,T2) = |x1 - x2| + |y1 - y2|
All other definitions are the same as in Euclidian 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 (Euclidian) geometry, and the other in taxicab geometry. The burden of solving this difficult problem has fallen onto you.
输入格式
The first and only line of input will contain the radius R, an integer smaller than or equal to 1000
0.
0.
输出格式
On the first line you should output the area of a circle with radius R in normal (Euclidian) geometry.
On the second line you should output the area of a circle with radius R in taxicab geometry.
On the second line you should output the area of a circle with radius R in taxicab geometry.
输入输出样例
输入 #1
1
输出 #1
3.141593 2.000000
输入 #2
21
输出 #2
1385.442360 882.000000
输入 #3
42
输出 #3
5541.769441 3528.000000
Outputs within ±0.0001 of the official solution will be accepted.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted