#P10892. SDOI2024
SDOI2024
Background
AzureHair was defeated by “Meow Meow” in NOIP 2022, and then got an incurable illness—fear of T2. So in NOIP 2023, he firmly skipped T2 and then spent two hours stuck on T3 with no result, leaving regretfully. His classmates decided to help him cure this incurable illness.
After his classmates cured his fear of T2, he confidently started his SDOI. Then he spent hours writing a partial solution but still could not finish, and left regretfully again.
Problem Description
AzureHair’s classmates lock AzureHair and cats in a room, and require that every day AzureHair hands over cats. But if is odd, AzureHair will struggle with whether to hand over cats or cats. AzureHair does not want to struggle, so please compute the minimum number of times he must struggle until all cats are taken out of the room.
Input Format
This problem has multiple test cases.
The first line contains an integer .
The next lines each contain one integer .
Output Format
Output lines, each containing one integer representing the minimum number of times he struggles.
2
13
7
3
2
Hint
Sample Explanation
For cats, one process with only struggles is as follows:
Choose to hand over cats, leaving ;
No struggle, hand over cats, leaving ;
Choose to hand over cats, leaving ;
Choose to hand over cat, and all cats are taken away.
It is easy to prove that there is no plan with fewer than struggles.
Constraints
For of the testdata, .
For of the testdata, .
For of the testdata, , .
Translated by ChatGPT 5