#include using namespace std; #ifndef ONLINE_JUDGE #define dbg(x...) do{cout << "\033[32;1m" << #x << "->" ; err(x);} while(0) void err(){cout << "\033[39;0m" << endl;} template class T,typename t,typename... A> void err(T a,A... x){for (auto v:a) cout << v << ' '; err(x...);} template void err(T a,A... x){cout << a << ' '; err(x...);} #else #define dbg(...) #endif typedef long long ll; typedef pair pi; typedef vector vi; template using vc=vector; template using vvc=vc>; template void mkuni(vector&v) { sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); } template void print(T x,int suc=1) { cout< void print(const vector&v,int suc=1) { for(int i=0;i=r) return ; int mxpos; for(int i=l;i<=r;++i) { if(a[i]>r||a[i]=mxpos;--j) { swap(a[j],a[j+1]); ans.push_back(j); } for(int j=mxpos+1;j>t; while(t--) { cin>>n; ans.clear(); suc=1; for(int i=1;i<=n;++i) { cin>>a[i]; } int pre=1; for(int i=1;i<=n;++i) { if(a[i]==i) { if(pre!=i) { ok=1; solve(pre,i); if(!ok) { suc=0; break; } pre=i+1; } } else { } } // cout<