시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 1024 MB | 0 | 0 | 0 | 0.000% |
Polish mathematician Wacław Sierpinski (1882-1969) described the 2D geometric figure known as the ´ Sierpinski triangle as part of his work on set theory in 1915. The triangle, which is really an infinite ´ collection of points, can be constructed by the following algorithm:
Here is an illustration of the first few iterations:
iteration | 0 | 1 | 2 | 3 | 4 |
As the iterations go to infinity, this process creates an infinite number of connected points. However, consider the case of a finite number of iterations. If the initial triangle has a circumference of 3, what is the sum of the circumferences of all (black) triangles at a given iteration? Write a program to find out not the exact circumference, but the number of decimal digits required to represent its integer portion. That is, find the number of decimal digits required to represent the largest integer that is at most as large as the circumference.
Each test case is a line containing a non-negative integer 0 ≤ n ≤ 10,000 indicating the number of iterations
For each case, display the case number followed by the number of decimal digits required to represent the integer portion of the circumference for the given number of iterations. Follow the format of the sample output.
0 1 5 10 100
Case 1: 1 Case 2: 1 Case 3: 2 Case 4: 3 Case 5: 19