#include using namespace std; typedef pair P; vector

mysort(vector A,int m){ vector

res; int N=A.size(); for(int i=0;ii;j--) if(bottom>A[j]){ bottom=A[j]; id=j; } if(id!=i){ res.push_back(P(i,id)); swap(A[i],A[id]); } } return res; } void print(vector

& v){ cout<>s; } bool checkKadomatsu(int a,int b,int c){ return (a!=c&&((a>b&&bc))); } bool test(vector

& v,vector A){ for(auto &it:v){ swap(A[it.first],A[it.second]); } int N=A.size(); for(int i=0;i+2 unko(int N){ vector

res; for(int i=0;i+5>N; vector A(N); for(auto &it:A)cin>>it; auto p=mysort(A,1); auto q=mysort(A,-1); if(p.size()