package main import ( "fmt" "math/rand" "sort" ) func main() { rand.Seed(42) var n int fmt.Scan(&n) a := make([]int, n) for i := 0; i < n; i++ { fmt.Scan(&a[i]) } ans := make([]int, 0) for !allNotKadomatsu(a) { b := rand.Int()%(n) c := rand.Int()%(n) sort.IntSlice(a).Swap(b, c) ans = append(ans, b) ans = append(ans, c) } fmt.Println(len(ans)/2) for i := 0; i < len(ans) / 2; i++ { fmt.Println(ans[i*2], ans[i*2+1]) } } func allNotKadomatsu(a []int)bool{ l := len(a) for i:=0;ia && b>c) || (b