2185. Numbers

单点时限: 2.0 sec

内存限制: 256 MB

In this problem, you have to find the last three digits before the decimal point for the number (3 + √5)^n.

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.

1 <= T <= 10

2 <= n <= 2000000000

输出格式

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.

样例

Input
2
5
2
Output
Case #1: 935
Case #2: 027

6 人解决,32 人已尝试。

11 份提交通过,共有 101 份提交。

8.7 EMB 奖励。

创建: 15 年,8 月前.

修改: 6 年,7 月前.

最后提交: 1 月,3 周前.

来源: GCJ 2008

题目标签