Rope pulling – 2
Maybe, you heard the story about programmers, who pulled the rope. They wanted to reach the situation, when each programmer had competed with each other. They desire to pull the rope again. But now they want, that each pair of programmers will stand in the opposite teams at least twice.
Number of programmers is even. They hold some rounds, and in each round all programmers divide into 2 equal teams. Programmers are very lazy 🙂, so they want to hold as few rounds as possible. What is the minimal quantity of rounds, for which exist such schedule, that any two programmers will be in opposite teams in at least two rounds?
For example, if we have programmers, numbered from to , then we can organize the division in the following way:
(, , , ) – (, , , )
(, , , ) – (, , , )
(, , , ) – (, , , )
(, , , ) – (, , , )
Input
First line of input contains the number of tests (). Each of the next lines contains an even integer () – the number of programmers in a current test.
Output
Ouput lines of the form Case #A: B
, where A
– is the number of test (staring at ), B
– the needed quantity of rounds for given .