QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 1024 MB Total points: 50

#5756. 数字

Statistics

你需要求出 $(3 + \sqrt{5})^n$ 在小数点前的最后三位数字。

例如,当 $n = 5$ 时,$(3 + \sqrt{5})^5 = 3935.73982\dots$,答案为 $935$。

当 $n = 2$ 时,$(3 + \sqrt{5})^2 = 27.4164079\dots$,答案为 $027$。

输入格式

输入的第一行包含测试用例的数量 $T$。 接下来有 $T$ 行,每行包含一个正整数 $n$。

输出格式

对于每个测试用例,输出: Case #$X$: $Y$

其中 $X$ 是测试用例的编号,$Y$ 是 $(3 + \sqrt{5})^n$ 在小数点前的最后三位整数。如果该数字的整数部分不足三位,请在前面补零,以确保输出恰好为三位数字。

样例

输入格式 1

2
5
2

输出格式 1

Case #1: 935
Case #2: 027

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.