#include "bits/stdc++.h" #define REP(i,n,N) for(int i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define ALL(v) (v).begin(),(v).end() #define p(s) cout<<(s)<> vt; int main(){ cin>>N; REP(i,0,N){ cin>>a[i]; } REP(i,0,N){ REP(j,1,N){ if(a[j-1]>a[j]){ vt.emplace_back(j-1,j); swap(a[j-1],a[j]); } } } p(vt.size()); for(auto v:vt){ p2(v.first, v.second); } cin>>a[101]; return 0; }