#include #include #include #include #include #include using namespace std; #define inf 0x3ffffff #define mem(x,y) memset(x,y,sizeof(x)) #define pii pair #define fi first #define se second #define maxn 200005 #define ll long long #define mod 1000000007 ll a[maxn]; ll p[maxn]; int main() { int T; scanf("%d",&T); while(T--) { int n; scanf("%d",&n); for(int i=0;i0&&abs(a[i]-a[i-1])==p[may])may--; if(i+10&&i+1