#L16846. [GKS 2021 #C] Alien Generator

[GKS 2021 #C] Alien Generator

Problem Description

题目描述

Astronauts have landed on a new planet, Kickstartos. They have discovered a machine on the planet: a generator that creates gold bars. The generator works as follows. On the first day, an astronaut inputs a positive integer KK into the generator. The generator will produce KK gold bars that day. The next day, it will produce K+1K + 1, the following day, K+2K + 2, and so on. Formally, on day ii, the generator will produce K+i−1K + i - 1 gold bars.

However, the astronauts also know that the generator will stop producing gold bars after it has produced a total of GG gold bars. They are curious about how many different positive integers KK could have been input into the generator.

Given GG, find the number of different positive integers KK such that the generator will produce exactly GG gold bars before stopping.

Limits

1≤T≤1001 \le T \le 100.

1≤G≤10121 \le G \le 10^{12}.

输入格式

The first line of the input gives the number of test cases, TT. TT lines follow.

Each line contains a single integer GG, representing the maximum number of gold bars the generator can generate.

输出格式

For each test case, output one line containing Case #xx: followed by yy, where xx is the test case number (starting from 11) and yy is the number of possible values of KK on day 11 that would eventually produce exactly GG gold bars.

样例

样例 1

提示

For Sample Case #11, there are 22 possible values of KK (11, 1010) that would eventually produce exactly 1010 gold bars. For K=1K = 1, we will have 1+2+3+4=101 + 2 + 3 + 4 = 10 gold bars after 44 days, and for K=10K = 10, we will have 1010 gold bars after just 11 day.

For Sample Case #22, there are 44 possible values of KK (88, 2323, 6262, 125125) that would eventually produce exactly 125125 gold bars.

2
10
125
Case #1: 2
Case #2: 4