#P16846. [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 into the generator. The generator will produce gold bars that day. The next day, it will produce , the following day, , and so on. Formally, on day , the generator will produce gold bars.
However, the astronauts also know that there is a limitation to the generator: if on any day, the generator would end up producing more than gold bars in total across all the days, then it will break down on that day and will produce gold bars on that day and thereafter. The astronauts would like to avoid this, so they want to produce exactly gold bars.
Consider and . On day , the generator would produce gold bars. On day , the generator would produce more gold bars, making the total gold bars equal to . On day , the generator would produce more gold bars, which would lead to a total of gold bars. Thus, the generator would break on day before producing gold bars. Hence, the total number of gold bars generated is in this case.
Formally, for a given , astronauts would like to know how many possible values of on day would eventually produce exactly gold bars.
Input Format
The first line of the input gives the number of test cases, . lines follow.
Each line contains a single integer , representing the maximum number of gold bars the generator can generate.
Output Format
For each test case, output one line containing Case #: followed by , where is the test case number (starting from ) and is the number of possible values of on day that would eventually produce exactly gold bars.
2
10
125
Case #1: 2
Case #2: 4
Hint
For Sample Case #, there are possible values of (, ) that would eventually produce exactly gold bars. For , we will have gold bars after days, and for , we will have gold bars after just day.
For Sample Case #, there are possible values of (, , , ) that would eventually produce exactly gold bars.
Limits
.
Test Set
.
Test Set
for at most test cases.
For the remaining cases, .