QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 1024 MB Points totaux : 100

#11331. 梦魇骑士

Statistiques

一个骑士在无限大的棋盘上跳跃。棋盘是一片未开发的领土。秉持着探险家的精神,谁第一次站在一个格子上,谁就拥有该格子的所有权。骑士最初拥有他所站的格子,在感到厌倦之前,他会跳跃 $N$ 次。

回想一下,骑士可以在 8 个方向上跳跃。每个方向由向前两格再向侧面一格组成。

在 $N$ 次跳跃后,骑士可能拥有的领土总共有多少个格子?由于 $N$ 可能非常大,这对不擅长数学的骑士来说成了一场噩梦。你能帮他回答这个问题吗?

输入格式

第一行输入一个整数 $T$,表示测试用例的数量。接下来有 $T$ 个测试用例。 每个测试用例仅包含一个数字 $N$,表示骑士跳跃的次数。

输出格式

对于每个测试用例,输出一行 “Case #x: y”,其中 $x$ 是测试用例编号(从 1 开始),$y$ 是骑士可能拥有的格子总数。

数据范围

  • $1 \le T \le 10^5$
  • $0 \le N \le 10^9$

样例

输入 1

3
0
1
7

输出 1

Case #1: 1
Case #2: 9
Case #3: 649

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.