[BOJ 12727] Numbers (Small)
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
3
Time limit:
5.0s
Memory limit:
512M
Problem types
Allowed languages
In this problem, you have to find the last three digits before the decimal point for the number (3 + √5)n.</p>
For example, when n = 5, (3 + √5)5 = 3935.73982... The answer is 935.
For n = 2, (3 + √5)2 = 27.4164079... The answer is 027.
입력 형식
The first line of input gives the number of cases, T. T test cases follow, each on a separate line. Each test case contains one positive integer n.</p>
Limits
- 1 <= T <= 100
- 2 <= n <= 30
For each input case, you should output:
Case #X: Y
where X is the number of the test case and Y is the last three integer digits of the number (3 + √5)n. In case that number has fewer than three integer digits, add leading zeros so that your output contains exactly three digits.
예제 입력
2
5
2
예제 출력
Case #1: 935
Case #2: 027
Comments