시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 6025 2628 2016 42.202%

문제

19세기 독일 수학자 헤르만 민코프스키는 비유클리드 기하학 중 택시 기하학을 고안했다.

택시 기하학에서 두 점 T1(x1,y1), T2(x2,y2) 사이의 거리는 다음과 같이 구할 수 있다.

D(T1,T2) = |x1-x2| + |y1-y2|

두 점 사이의 거리를 제외한 나머지 정의는 유클리드 기하학에서의 정의와 같다.

따라서 택시 기하학에서 원의 정의는 유클리드 기하학에서 원의 정의와 같다.

원: 평면 상의 어떤 점에서 거리가 일정한 점들의 집합

반지름 R이 주어졌을 때, 유클리드 기하학에서 원의 넓이와, 택시 기하학에서 원의 넓이를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 반지름 R이 주어진다. R은 10,000보다 작거나 같은 자연수이다.

출력

첫째 줄에는 유클리드 기하학에서 반지름이 R인 원의 넓이를, 둘째 줄에는 택시 기하학에서 반지름이 R인 원의 넓이를 출력한다. 정답과의 오차는 0.0001까지 허용한다.

예제 입력 1

1

예제 출력 1

3.141593
2.000000

힌트

W3sicHJvYmxlbV9pZCI6IjMwNTMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQwZGRcdWMyZGMgXHVhZTMwXHVkNTU4XHVkNTU5IiwiZGVzY3JpcHRpb24iOiI8cD4xOVx1YzEzOFx1YWUzMCBcdWIzYzVcdWM3N2MgXHVjMjE4XHVkNTU5XHVjNzkwIFx1ZDVlNFx1Yjk3NFx1YjljYyBcdWJiZmNcdWNmNTRcdWQ1MDRcdWMyYTRcdWQwYTRcdWIyOTQgXHViZTQ0XHVjNzIwXHVkMDc0XHViOWFjXHViNGRjIFx1YWUzMFx1ZDU1OFx1ZDU1OSBcdWM5MTEgXHVkMGRkXHVjMmRjIFx1YWUzMFx1ZDU1OFx1ZDU1OVx1Yzc0NCBcdWFjZTBcdWM1NDhcdWQ1ODhcdWIyZTQuPFwvcD5cclxuXHJcbjxwPlx1ZDBkZFx1Yz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NoIGlzIGluIG5vcm1hbCAoRXVjbGlkaWFuKSBnZW9tZXRyeSwgYW5kIHRoZSBvdGhlciBpbiB0YXhpY2FiIGdlb21ldHJ5LiBUaGUgYnVyZGVuIG9mIHNvbHZpbmcgdGhpcyBkaWZmaWN1bHQgcHJvYmxlbSBoYXMgZmFsbGVuIG9udG8geW91LiZuYnNwOzxcL3A+XHJcbiIsImlucHV0IjoiPHA+VGhlIGZpcnN0IGFuZCBvbmx5IGxpbmUgb2YgaW5wdXQgd2lsbCBjb250YWluIHRoZSByYWRpdXMgUiwgYW4gaW50ZWdlciBzbWFsbGVyIHRoYW4gb3IgZXF1YWwgdG8gMTAwMDAuJm5ic3A7PFwvcD5cclxuIiwib3V0cHV0IjoiPHA+T24gdGhlIGZpcnN0IGxpbmUgeW91IHNob3VsZCBvdXRwdXQgdGhlIGFyZWEgb2YgYSBjaXJjbGUgd2l0aCByYWRpdXMgUiBpbiBub3JtYWwgKEV1Y2xpZGlhbikgZ2VvbWV0cnkuIE9uIHRoZSBzZWNvbmQgbGluZSB5b3Ugc2hvdWxkIG91dHB1dCB0aGUgYXJlYSBvZiBhIGNpcmNsZSB3aXRoIHJhZGl1cyBSIGluIHRheGljYWIgZ2VvbWV0cnkuJm5ic3A7PFwvcD5cclxuXHJcbjxwPk5vdGU6IE91dHB1dHMgd2l0aGluICZwbHVzbW47MC4wMDAxIG9mIHRoZSBvZmZpY2lhbCBzb2x1dGlvbiB3aWxsIGJlIGFjY2VwdGVkLjxcL3A+XHJcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

Contest > Croatian Open Competition in Informatics > COCI 2006/2007 > Contest #1 2번

  • 문제를 번역한 사람: baekjoon
  • 문제의 오타를 찾은 사람: onjo0127