Logo
(追記) (追記ここまで)

22701번 - Jaggie Spheres 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 (추가 시간 없음) 512 MB9000.000%

문제

Let J(n) be a three-dimensional body that

  • is a union of unit cubes whose all vertices lie on integer coordinates,
  • contains all points that are closer than the distance of √n to the origin, and
  • is the smallest of all such bodies.

The figure below shows how J(1), J(2), and J(3) look.

Figure 1: Jaggie Spheres for n = 1, 2, 3

Your task is to calculate how many faces J(n) have. Here, we define two square belong to the same face if they are parallel and share an edge, but don’t if they share just a vertex.

입력

The input consists of multiple data sets, each of which comes with a single line containing an integer n (1 ≤ n ≤ 1000000). The end of input is indicated by n = 0.

출력

For each data set, print the number of faces J(n) have.

제한

예제 입력 1

1
2
3
4
0

예제 출력 1

6
30
30
6

힌트

출처

Contest > ICPC Japanese Alumni Group > JAG Summer Camp > JAG Summer Camp 2007 Day 3 B번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /