#Lutece0377. Game
Game
Migrated from Lutece 377 Game
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Standy is playing a cut-sequence game. It gives a sequence of numbers . Standy can remove at most two consecutive fragments. Then he computes the length of the longest consecutive increasing subsequence. What is the maximum possible length he can get?
Input
The first line of the input is an integer (), which stands for the number of test cases you need to solve.
Each test case begins with an integer () indicating the size of the sequence.
The next line contains integers ().
Output
For every test case, you should output Case #k:
first, where indicates the case number and starts at . Then output the maximum possible length of consecutive increasing subsequence after remove at most two consecutive fragments.
Samples
2
4
1 2 3 4
12
10 1 2 7 9 3 4 8 8 5 6 1
Case #1: 4
Case #2: 6
Note
For the Case, we can remove fragments 7 9
and 8 8
, and get sequence 10 1 2 3 4 5 6 1
. So the longest subsequence is 1 2 3 4 5 6
.
Resources
The 9th UESTC Programming Contest Final