#include using namespace std; //#define int long long #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair #define endl '\n' #define vec vector #define mat vector > #define fi first #define se second typedef long long ll; typedef unsigned long long ull; typedef pair pll; typedef long double ld; typedef complex Complex; const ll INF=1e9+7; const ll inf=INF*INF; const ll mod=998244353; const ll MAX=100010; bool is_k(ll a, ll b,ll c){ bool f=0; if((a>b&&c>b)||(a>t; while(t--){ ll n;cin>>n; vectora(n); rep(i,n)cin>>a[i]; setst; REP(i,2,n){ if(!is_k(a[i-2],a[i-1],a[i])){ st.insert(i); st.insert(i-1); st.insert(i-2); } } if(st.size()>=20){ cout<<"No"<b(0); for(auto e:st){ b.pb(e); } bool f=0; rep(i,b.size()){ REP(j,i+1,b.size()){ vectorc=a; swap(c[b[i]],c[b[j]]); bool g=1; REP(k,2,n){ if(!is_k(c[k],c[k-1],c[k-2]))g=0; } f|=g; } } if(b.size()<=4){ rep(i,b.size()){ rep(j,n){ if(a[b[i]]==a[j])continue; swap(a[b[i]],a[j]); bool g=1; rep(k,3){ if(b[i]-2+k>=0&&b[i]+k=0&&j+k