#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; int T,N,a[50001]; void solve1(){ for(int i=0;ia[k]&&a[k]>a[k+1])){ f=false; break; } } if(f){ puts("Yes"); return; } swap(a[i],a[j]); } } puts("No"); return; } void solve2(){ vector lis; for(int k=1;ka[k]&&a[k]>a[k+1])){ if(k>1)lis.emplace_back(k-2); lis.emplace_back(k-1); lis.emplace_back(k); lis.emplace_back(k+1); if(k+220){ puts("No"); return; } for(auto x:lis)for(auto y:lis){ if(x>=y)continue; swap(a[x],a[y]); bool f=true; for(int k=1;ka[k]&&a[k]>a[k+1])){ f=false; break; } } if(f){ puts("Yes"); return; } swap(a[x],a[y]); } puts("No"); } int main(){ scanf("%d",&T); for(int z=0;z