A sequence of integers ($a_1, a_2, \ldots, a_k$) is said to be UpDown, if these inequalities hold true:
- $a_1 \le a_2$
- $a_2 \ge a_3$
- $a_3 \le a_4$
and so on.
That is, every even-indexed element should be at least as large as its adjacent elements. And every odd-indexed element should be at most as large as its adjacent elements. Formally, $a_{2i} \ge a_{2i+1}$ and $a_{2i+1} \le a_{2i+2}$, for all valid positions.
A subsegment is a consecutive portion of a sequence. That is, a subsegment of ($b_1, b_2, \ldots, b_k$)  will be of the form ($b_i, b_{i+1}, \ldots, b_j$), for some $i$ and $j$.
You are given a sequence ($s_1, s_2, \ldots, s_n$). You can insert at most one integer anywhere in this sequence. It could be any integer. After inserting an integer (or choosing not to), suppose you have the new sequence ($t_1, t_2, \ldots, t_m$). Note that $m$ will either be $n$+1 or $n$. You want to maximize the length of the longest subsegment of ($t_1, t_2, \ldots, t_m$) which is UpDown, and output the length of that.

-----Input-----
- The first line contains a single integer, $T$, which is the number of testcases. The description of each testcase follows.
- The first line of every testcase contains a single integer, $n$, which is the number of integers in the original sequence.
- The second line contains $n$ integers: $s_1, s_2, \ldots, s_n$, which forms the original sequence.

-----Output-----
For each testcase output a single line containing one integer, which should be the length of the longest UpDown subsegment that you can get after inserting at most one integer.

-----Constraints-----
- $1 \le T \le 2$
- $1 \le n \le 10^6$
- $1 \le s_i \le 10^9$

-----Subtasks-----
Subtask #1 (20 points): $1 \le n \le 100$
Subtask #2 (10 points): $1 \le n \le 10000$
Subtask #3 (70 points): Original constraints

-----Sample Input-----
2
7
100 1 10 3 20 25 24
5
3 3 2 4 1

-----Sample Output-----
7
6

-----Explanation-----
Testcase 1: The original sequence is (100, 1, 10, 3, 20, 25, 24). Suppose you insert the element 5 between the elements 20 and 25, you will get the new sequence (100, 1, 10, 3, 20, 5, 25, 24). The longest UpDown subsegment of this sequence is (1, 10, 3, 20, 5, 25, 24), whose length is 7. You can check that you cannot do any better, and hence the answer is 7.
Testcase 2: The original sequence is (3, 3, 2, 4, 1). Suppose you insert the element 4 at the end, you will get the new sequence (3, 3, 2, 4, 1, 4). This entire sequence is UpDown, and so the longest UpDown subsegment of this sequence is (3, 3, 2, 4, 1, 4), whose length is 6. You can check that you cannot do any better, and hence the answer is 6.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'def check(b):\r\n    \r\n    ch = True\r\n    \r\n    for m in range(len(b)-1):\r\n        if m % 2 == 0:\r\n            if b[m] > b[m+1]:\r\n                ch = False\r\n        else:\r\n            if b[m] < b[m+1]:\r\n                ch = False\r\n            \r\n    return ch\r\n    \r\ndef big(n,a):\r\n    maxi = 1\r\n    c = []\r\n\t\r\n    for j in range(len(a)):\r\n\t    for l in range(j+1,len(a)):\r\n\t        if check(a[j:l+1]) == True:\r\n\t            if len(a[j:l+1]) > maxi:\r\n\t                maxi = len(a[j:l+1])\r\n\t                c = a[j:l+1]\r\n\t                \r\n    return maxi,c\r\n\r\nt = int(input())\r\nfor i in range(t):\r\n\tn = int(input())\r\n\ta = [int(i) for i in input().split()]\r\n\t\r\n\tfinal_max = 0\r\n\t\r\n\te = a[:]\r\n\te.insert(0,a[0]+1)\r\n\tif len(big(n,e)[1]) > final_max:\r\n\t    final_max = len(big(n,e)[1])\r\n\t\r\n\te = a[:]\r\n\te.insert(0,a[0]+1)\r\n\tif len(big(n,e)[1]) > final_max:\r\n\t    final_max = len(big(n,e)[1])\r\n\t    \r\n\te = a[:]\r\n\te.insert(len(a),a[len(a)-1]-1)\r\n\tif len(big(n,e)[1]) > final_max:\r\n\t    final_max = len(big(n,e)[1])\r\n\t    \r\n\te = a[:]\r\n\te.insert(len(a),a[len(a)-1]+1)\r\n\tif len(big(n,e)[1]) > final_max:\r\n\t    final_max = len(big(n,e)[1])\r\n\t   \r\n\t\r\n\tfor l in range(1,len(a)):\r\n\t    d = a[:]\r\n\t    bef,aft = a[l-1],a[l]\r\n\t    if bef > aft :\r\n\t        d.insert(l,bef+1)\r\n\t    else:\r\n\t        d.insert(l,bef-1)\r\n\t    maxi,c = big(l,d)\r\n\t    if len(c) > final_max:\r\n\t        final_max = len(c)\r\n\tprint(final_max)'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14445