logo AlgoBeat OnlineJudge
登录 注册

#217326. [ICPC 2017 Urumqi R] Fence Building

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Farmer John owns a farm. He first builds a circle fence. Then, he will choose points and build some straight fences connecting them. Next, he will feed a cow in each region so that cows cannot play with each other without breaking the fences. In order to feed more cows, he also wants to have as many regions as possible. However, he is busy building fences now, so he needs your help to determine what is the maximum number of cows he can feed if he chooses these points properly.

:::align{center} :::

输入格式

The first line contains an integer , the number of test cases. For each test case, there is one line that contains an integer . It is guaranteed that and .

输出格式

For each test case, you should output a line "Case #: ans" where is the test case's number, starting from and ans is the remainder of the maximum number of cows farmer John can feed when divided by .

样例

样例输入 1

3
1
3
5

样例输出 1

Case #1: 1
Case #2: 4
Case #3: 16